* Allow users to change the value of a build's "keep" flag, which

[?]
Mar 14, 2009, 11:56 PM
NEWDDAOFCDLYBXQCZNQ2GDH7HPAHVN3YRDL52ZYEMVA4YH6LBDXAC

Dependencies

  • [2] 3E6IP3R3 * Add the name of the jobset to ReleaseSetJobs, otherwise we can't
  • [3] ZILILXXK * Allow scheduled builds to be cancelled. They're not removed from
  • [4] IN272KZW * Automatically keep all builds in the latest successful release in
  • [5] A52HEFHQ * Allow builds to be restarted (if they failed with a transient error,
  • [6] 4X6NS66Q * Keep the most recent builds for each job.
  • [7] BD3GRK4B * Get rid of "positive failures" and separate log phases.
  • [8] WZ3AEJ67 * hydra_update_gc_roots.pl registers build outputs that should be kept
  • [9] 2T42QGZD * Register builds as GC roots so they don't get deleted.
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.

Change contents

  • replacement in src/lib/Hydra/Controller/Build.pm at line 217
    [3.954][3.954:1042]()
    $build->finished(1);
    $build->timestamp(time());
    $build->update;
    [3.954]
    [3.1042]
    $build->update({finished => 1, timestamp => time});
  • edit in src/lib/Hydra/Controller/Build.pm at line 229
    [3.1325]
    [3.818]
    $c->res->redirect($c->uri_for($self->action_for("view_build"), $c->req->captures));
    }
    sub keep : Chained('build') PathPart Args(1) {
    my ($self, $c, $newStatus) = @_;
    my $build = $c->stash->{build};
    requireProjectOwner($c, $build->project);
    die unless $newStatus == 0 || $newStatus == 1;
    $c->model('DB')->schema->txn_do(sub {
    $build->resultInfo->update({keep => int $newStatus});
    });
    $c->flash->{buildMsg} =
    $newStatus == 0 ? "Build will not be kept." : "Build will be kept.";
  • replacement in src/root/build.tt at line 60
    [3.1518][3.1518:1606]()
    [% IF build.resultInfo.buildstatus == 3 || build.resultInfo.buildstatus == 4 %]
    [3.1518]
    [3.1781]
    [% IF c.user_exists && (build.resultInfo.buildstatus == 3 || build.resultInfo.buildstatus == 4) %]
  • edit in src/root/build.tt at line 175
    [3.2942]
    [3.3083]
    </tr>
    [% END %]
    [% IF build.finished && build.buildproducts %]
    <tr>
    <th>Availability:</th>
    <td>
    [% IF !available %]
    <em>Build output is no longer available</em>
    [% ELSIF build.resultInfo.keep %]
    <em>Build output will be kept permanently</em>
    [% IF c.user_exists %]
    <form action="[% c.uri_for('/build' build.id 'keep' 0) %]" method="post" class="inline">
    <button id="unkeep" type="submit">Unkeep</button>
    </form>
    [% END %]
    [% ELSE %]
    <em>Build output is available, but may be garbage-collected</em>
    [% IF c.user_exists %]
    <form action="[% c.uri_for('/build' build.id 'keep' 1) %]" method="post" class="inline">
    <button id="keep" type="submit">Keep</button>
    </form>
    [% END %]
    [% END %]
    </td>
  • replacement in src/script/hydra_update_gc_roots.pl at line 24
    [3.177][3.177:223]()
    print "keeping build ", $build->id, " (",
    [3.177]
    [3.223]
    print STDERR "keeping build ", $build->id, " (",
  • replacement in src/script/hydra_update_gc_roots.pl at line 40
    [3.577][3.577:627](),[3.627][2.5567:5626](),[2.5626][3.696:702](),[3.696][3.696:702](),[3.702][2.5627:5721]()
    foreach my $job ($project->builds->search({},
    {select => [{distinct => 'job'}], as => ['job']}))
    {
    print "*** looking for builds to keep in job ", $project->name, ":", $job->job, "\n";
    [3.577]
    [3.797]
    foreach my $job ($project->jobs->all) {
    print STDERR "*** looking for builds to keep in job ",
    $project->name, ":", $job->jobset->name, ":", $job->name, "\n";
  • replacement in src/script/hydra_update_gc_roots.pl at line 46
    [3.886][3.886:939](),[3.939][2.5722:5753](),[2.5753][3.980:1008](),[3.980][3.980:1008]()
    my @recentBuilds = $project->builds->search(
    { job => $job->job
    , finished => 1
    [3.886]
    [3.1008]
    # !!! Take time into account? E.g. don't delete builds that
    # are younger than N days.
    my @recentBuilds = $job->builds->search(
    { finished => 1
  • edit in src/script/hydra_update_gc_roots.pl at line 58
    [3.3895][3.3895:3896]()
  • replacement in src/script/hydra_update_gc_roots.pl at line 63
    [3.4006][3.4006:4116]()
    print "*** looking for builds to keep in release set ", $project->name, ":", $releaseSet->name, "\n";
    [3.4006]
    [3.4116]
    print STDERR "*** looking for builds to keep in release set ", $project->name, ":", $releaseSet->name, "\n";
  • replacement in src/script/hydra_update_gc_roots.pl at line 71
    [3.4440][3.4440:4558]()
    print "keeping latest successful release ", $latest->id, " (", $latest->get_column('releasename'), ")\n";
    [3.4440]
    [3.4558]
    print STDERR "keeping latest successful release ", $latest->id, " (", $latest->get_column('releasename'), ")\n";
  • replacement in src/script/hydra_update_gc_roots.pl at line 81
    [3.1318][3.1318:1357]()
    print "*** looking for kept builds\n";
    [3.1318]
    [3.1357]
    print STDERR "*** looking for kept builds\n";
  • replacement in src/script/hydra_update_gc_roots.pl at line 87
    [3.769][3.1501:1545](),[3.1685][3.1501:1545]()
    print "*** looking for scheduled builds\n";
    [3.769]
    [3.1685]
    print STDERR "*** looking for scheduled builds\n";
  • replacement in src/script/hydra_update_gc_roots.pl at line 90
    [3.1825][3.770:830]()
    print "keeping scheduled build ", $build->id, " (",
    [3.1825]
    [3.830]
    print STDERR "keeping scheduled build ", $build->id, " (",
  • replacement in src/script/hydra_update_gc_roots.pl at line 101
    [3.2031][3.950:992]()
    print "*** removing unneeded GC roots\n";
    [3.2031]
    [3.992]
    print STDERR "*** removing unneeded GC roots\n";