Add a ‘latest-finished’ action

[?]
Aug 12, 2013, 8:17 PM
CJRWFVKZVTU2FBPN4J7OVIHO5YVPLW2QUKISN4PCTLXSOABDIA2QC

Dependencies

  • [2] N4ODPYP7 Job page: Remove channel tab
  • [3] LZVO64YG Merge in the first bits of the API work
  • [4] IHUZXOK2 Reply 404 for requests for non-existent .narinfo.
  • [5] HAI5TY47 Make negative narinfo responses much smaller
  • [6] IDT3SO3P Generate *.narinfo files on the fly to support the binary cache substituter
  • [*] FPK5LF53 * Put the project-related actions in a separate controller. Put the
  • [*] BTUDUY6F * Provide some redirects to the latest successful build for a job (or
  • [*] 3PNG7NIB Remove trailing whitespace
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] ODNCGFQ5 * Improved the navigation bar: don't include all projects (since that
  • [*] WGUKOIQZ Fix indentation

Change contents

  • edit in src/lib/Hydra/Base/Controller/ListBuilds.pm at line 117
    [9.1031]
    [10.848]
    $c->res->redirect($c->uri_for($c->controller('Build')->action_for("build"), [$latest->id], @rest));
    }
    # Redirect to the latest successful build in a finished evaluation
    # (i.e. an evaluation that has no unfinished builds).
    sub latest_finished : Chained('get_builds') PathPart('latest-finished') {
    my ($self, $c, @rest) = @_;
  • edit in src/lib/Hydra/Base/Controller/ListBuilds.pm at line 127
    [10.849]
    [3.1844]
    my $latest = $c->stash->{allBuilds}->find(
    { finished => 1, buildstatus => 0 },
    { order_by => ["id DESC"], rows => 1, join => ["jobsetevalmembers"]
    , where => \
    "not exists (select 1 from jobsetevalmembers m2 join builds b2 on jobsetevalmembers.eval = m2.eval and m2.build = b2.id and b2.finished = 0)"
    });
    notFound($c, "There is no successful build to redirect to.") unless defined $latest;
  • replacement in src/lib/Hydra/Controller/Root.pm at line 286
    [5.144][4.0:28]()
    $c->response->status(404);
    [5.144]
    [5.144]
    $c->response->status(404);
  • edit in src/root/job.tt at line 27
    [2.194]
    [13.1366]
    <li><a href="[% c.uri_for('/job' project.name jobset.name job.name 'latest-finished') %]">Latest successful build from a finished evaluation</a></li>