Add a redirect to the evaluation page of a view result

E.g.

  http://hydra.nixos.org/view/nixpkgs/unstable/latest/eval

Thus this is the channel representing the latest Nixpkgs for which the
elements of the view "unstable" succeeded:

  http://hydra.nixos.org/view/nixpkgs/unstable/latest/eval/channel
This commit is contained in:
Eelco Dolstra 2012-04-03 15:45:48 +02:00
parent 2c677ec71a
commit bd93ca9316
2 changed files with 9 additions and 0 deletions

View file

@ -193,6 +193,14 @@ sub result : Chained('view') PathPart('') {
[$c->stash->{project}->name, $release->name]));
}
elsif (scalar @args >= 1 && $args[0] eq "eval") {
my $eval = $c->stash->{result}->{eval};
notFound($c, "This view result has no evaluation.") unless defined $eval;
my $uri = $c->uri_for($c->controller('JobsetEval')->action_for("view"), [$eval->id]);
$uri .= "/" . join("/", @args[1..$#args]) if scalar @args > 1;
$c->res->redirect($uri);
}
# Provide a redirect to the specified job of this view result
# through `http://.../view/$project/$viewName/$viewResult/$jobName'.
# Optionally, you can append `-$system' to the $jobName to get a

View file

@ -216,6 +216,7 @@ sub getViewResult {
, jobs => [@jobs]
, status => $status
, timestamp => $timestamp
, eval => $ev
};
}