Add a redirect to the latest finished jobset evaluation

[?]
Apr 2, 2012, 11:30 PM
UXXFND4UYVY6WHWPRL3YIRKWTGFM3PR32JZCYKYNQOX7MZAFEG5AC

Dependencies

  • [2] U4TD3AIQ Add support for viewing jobset evaluations
  • [*] 3HZY24CX * Make jobsets viewable under

Change contents

  • edit in src/lib/Hydra/Controller/Jobset.pm at line 362
    [2.1300]
    [4.1141]
    # Redirect to the latest finished evaluation of this jobset.
    sub latest_eval : Chained('jobset') PathPart('latest-eval') {
    my ($self, $c, @args) = @_;
    my ($eval) = $c->stash->{jobset}->jobsetevals->search(
    { hasnewbuilds => 1 },
    { order_by => "id DESC", rows => 1
    , where => \ "not exists (select 1 from JobsetEvalMembers m join Builds b on m.build = b.id where m.eval = me.id and b.finished = 0)"
    });
    notFound($c, "No evaluation found.") unless defined $eval;
    my $uri = $c->uri_for($c->controller('JobsetEval')->action_for("view"), [$eval->id]);
    $uri .= "/" . join("/", @args) if scalar @args > 0;
    $c->res->redirect($uri);
    }