Closed (fixed)
Project:
Version Control API -- Git backend
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
7 Jan 2011 at 19:54 UTC
Updated:
26 Mar 2014 at 15:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tizzo commentedI coded this up fast and haven't tested it (or even turned it on). It's incomplete and broken but it's a start, I'll update as I continue to develop this.
Comment #2
tizzo commentedUpdated repo manager module for versioncontrol_git
Comment #3
tizzo commentedThis definitely still needs a little tweaking but the core functionality is there.
This patch provides the ability to have either nodeapi or drush manage git repositories via the drupal queue.
Nodeapi enqueues operations and drush processes them.
Comment #4
tizzo commentedI found a few bugs and stomped them out.
I think this should be working, we'll still need to get a slimmed down version running for the always-on queue. But I think this should be pretty close.
Comment #5
tizzo commentedMessed up that last patch, re-rolling
Comment #6
Anonymous (not verified) commentedtrying to tie all the bits together here, as well as review this patch.
for the tie-it-all-together bits:
* i've created a small module to process a queue where the worker will wait indefinitely for a job, and keep processing jobs indefinitely.
https://github.com/justinrandell/Drupal-Waiting-Queue
* we should implement hook_drupal_queue_load_classes() so we can use drupal_queue_get().
* we should implement hook_cron_queue_info() so we can set 'worker callback' somewhere. (wow, that's a badly named hook, and yeah, we could just have waiting_queue use one of its own hooks, but for now it seems cleaner to use drupal_queue's code seeing as we are already relying on it.
* sdboyer recommended drupalorg_versioncontrol module for that, so i'll create an issue and patch for that
now, for this patch.
that looks like it lives in a VersionControlGitRepository method somewhere.
build() is implemented by VersionControl, and sdboyer said in IRC: "sdboyer: beejeebus: build() is a VersioncontrolEntityInterface method, and is invoked by VersioncontrolBackend::buildEntity(), it should really never be called directly" and "sdboyer: beejeebus: one of VersioncontrolBackend's roles is as a factory", so it looks like we need to a) add the bare calls to make directories and call git commands into VersionControlGitRepository(), and call in to the write methods.
i don't know the VersionControl code well enough to say what the right way is just yet, but i'll get to that unless someone else beats me to it.
also, i'm not 100% of the relation between this ticket and #893114: Implement job queue system for creating new Git repos based on projects, but i suppose that's the meta-ticket for this one?
Comment #7
Anonymous (not verified) commentedshould be just drupal_queue_get(), which calls in to drupal_queue_include().
Comment #8
Anonymous (not verified) commentedcreated this issue for calling in to this module from drupal.org code: #1022540: add a queue for processing git repo jobs.
Comment #9
sdboyer commentedNew patch, mostly just fixing spelling errors and using the proper method for creating a repo object. Something that needs doing but I didn't do yet is to add some error handling to the worker. We don't want to erroneously insert a repo into the db if it's creation on disk didn't work, and we also want to watchdog() it if repo creation failed.
Next step, though, is to refactor this a fair bit to use a new ctools plugin for actually doing the work of creating the repo. That's something mikey_p and I talked about, and it's really preferable because there are lots of options, and certainly d.o-specific things, which the repo manager will need to take into account, and trying to make the job interface rich enough that it could handle it all via parameters would just be crazy.
Comment #10
tizzo commentedCommitted! http://drupal.org/cvs?commit=479574
Comment #11
mikey_p commentedI found the following snippet worked fine for saving permissions after updating {versioncontrol_project_projects}.repo_id
Comment #12
mikey_p commentedWanted to add that this could be node_load caching if the node is already loaded for some reason, before {vc_project_projects} was updated.
Should definitely do it.
Comment #13
tizzo commentedThat still didn't work... Assigning to mikey_p though I'm not sure he has time to address this this weekend.
Comment #14
tizzo commentedupdating title
Comment #15
sdboyer commentedTruth is that we'd probably fixed this problem a few times today...but didn't know it because the supervisord script just kept on running using the same old code. So the new code was never parsed into memory. Zoiks. Anyway, I fixed & verified the problem with the plugins & auth permissions not being properly set, finally. I did it in a way that is HORRIBLY d.o-specific, and committed it, but that's OK because it's really clear at this point that the logic is going to be moved into a plugin. So when we plugin-i-fy it (very early next week), we'll move the logic out into drupalorg. But for now, this works.
Comment #16
sdboyer commentedSetting title back, I had a really old cached version when I commented.