All our old branch results will have bad data. Boombatower suggests a script on d.o that runs to go through all of them and clean out and requeue.

all the code that does this now is in function pift_versioncontrol_git_refs_updated($repository, $refs)
so we just need to loop over all project releases...check if they are active
and then run that code
pift_test_requeue
so should be copy paste and add a loop around it
and delete te pift_test_add()
since we only want to requeue existing tests

CommentFileSizeAuthor
#4 clean_branches.php_.txt1.57 KBrfay

Comments

boombatower’s picture

Status: Active » Needs review

Here is the sudo code that just needs the two magically functions replaced with project calls.

  module_load_include('cron.inc', 'pift');
  $api_versions = pift_core_api_versions();
  $projects = magical_magic_stuff();
  foreach ($projects as $project) {
    if (!pift_project_enabled($project->project_nid)) {
      continue;
    }

    $releases = magical_magic_stuff2($project);
    foreach ($releases as $release) {
      foreach ($api_versions as $api_version) {
        if (array_key_exists($api_version, $release->taxonomy)) {
          if ($test_id = db_result(db_query('SELECT test_id FROM {pift_test} WHERE type = %d AND id = %d', PIFT_TYPE_RELEASE, $release->release_id))) {
            pift_test_requeue($test_id);
          }
        }
      }
    }
  }

once cron is run (may require multiple runs since it stops after 100 requests or so per cron run) each branch test will be sent to qa.d.o

rfay’s picture

I have a script at https://gist.github.com/835507 - it seems to do what's intended, but would like review.

Run it with drush

drush php-script ~/workspace/git_migration_retest_projects/clean_branches.php 

Thanks,
-Randy

boombatower’s picture

Forked, no bugs just a simplification. I didn't execute since I don't have test environment, but seems to have filled in the missing items.

rfay’s picture

Status: Needs review » Fixed
StatusFileSize
new1.57 KB

OK, I tested it on my local and things seem to be fine, so I'll call this fixed. I'm attaching the script, but it will live on the github gist if anybody needs it. (That's editable and is a git repo)

Status: Fixed » Closed (fixed)
Issue tags: -git deployment blocker

Automatically closed -- issue fixed for 2 weeks with no activity.