So, in order to see commitlogs and data inside versioncontrol tables, we need to have git repos asociated to at least some of the current projects on the profile.

So, this is basically about adding lines on the makefile to download some repo(s) to some directory(not profiles/*/modules directory) and run the association between projects.

PS: This should be the first step, next we need to have hooks on those repos to actually re parse on commit.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marvil07’s picture

Status: Active » Needs work
FileSize
3.83 KB

starting, but will follow dww suggestions

dww’s picture

Title: Associate dummy projects with git clones for versioncontrol » Associate default projects with git clones for versioncontrol

This will be amazing. Previously, mikey_p, hunmonk and I discussed how this should work. I just filled marvil07 in with the vision in person here at DCC. Documenting it for implementation:

We'll want a drupalorg_testing_module.module included in the profile, which provides:

A) A drush command ("drush drupalorg-testing-git-init" perhaps?). We're already depending on drush (and drush make) to even install the profile, so this wouldn't be a new dependency. The command should be run after you've visited install.php and have a working site. It will:

- Query {project_projects} to find all the nids and shortnames of projects setup by the profile (so we don't have yet another list to keep in sync with the .make file and the .profile file).

- Use the shortnames to anonymously clone a repo from git.d.o for each project into some directory (maybe "git-repos", could be an arg to the drush command with a default?). We don't want to use drush make for this since we want to keep the code that's running the site (and which you're working on patches for) separate from the dummy repo where you're testing commits for the VCAPI stuff). drush make doesn't really let you put modules wherever you want (except for a global setting in the .make file or only as subdirs of that directory for specific projects). Since we're running this as a drush command, we also don't have to worry about if httpd is running as a separate user, etc.

- Setup all the VCAPI repo objects for each project and populate versioncontrol_project_projects} with the repo_ids and project nids.

- Setup the hooks in each of these repos to run the vc_git parse job on each commit (we're not going to be pushing into them, so we might as well just parse on each commit).

B) The module could implement hook_requirements() to check if {vc_project_projects} is empty, and if so, complain about it and encourage the admin to run the drush command from A.

Pretty sure we need a separate module since it doesn't appear that drush searches profiles for .drush.inc files. However, that's okay since we're going to want the hook_requirements() check once the installer is done and the site is up. We should include this module directly as part of the profile, so it won't be any extra work to maintain it as a separate project or anything.

Obviously, once this is done, we'll want to update the profile's project page to add running this drush command as another step to run after visiting install.php.

Perhaps the drush command should take an argument to do the whole clone/init stuff on a specific project so if you add new projects you could clone and configure Git repos for those. It should probably LEFT JOIN {versioncontrol_project_projects} and ensure repo_id is NULL so that if you run it again without any project argument it doesn't try to re-do work for repos that already exist, but it'll still pick up new projects you created manually on the site or something.

Anyway, this is going to be a huge win once it's done.

Thanks so much!
-Derek