Propagate URI parameters
This allows URIs like http://hydra.nixos.org/jobset/nixpkgs/trunk/latest-eval?compare=stdenv to do the right thing.
This commit is contained in:
parent
05d03ee153
commit
e9dd3158a0
@ -364,9 +364,7 @@ sub latest_eval : Chained('jobset') PathPart('latest-eval') {
|
|||||||
my ($self, $c, @args) = @_;
|
my ($self, $c, @args) = @_;
|
||||||
my $eval = getLatestFinishedEval($c, $c->stash->{jobset})
|
my $eval = getLatestFinishedEval($c, $c->stash->{jobset})
|
||||||
or notFound($c, "No evaluation found.");
|
or notFound($c, "No evaluation found.");
|
||||||
my $uri = $c->uri_for($c->controller('JobsetEval')->action_for("view"), [$eval->id]);
|
$c->res->redirect($c->uri_for($c->controller('JobsetEval')->action_for("view"), [$eval->id], @args, $c->req->params));
|
||||||
$uri .= "/" . join("/", @args) if scalar @args > 0;
|
|
||||||
$c->res->redirect($uri);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ sub latest : Chained('view') PathPart('latest') {
|
|||||||
my $latest = getLatestSuccessfulViewResult(
|
my $latest = getLatestSuccessfulViewResult(
|
||||||
$c->stash->{project}, $c->stash->{primaryJob}, $c->stash->{jobs}, 0);
|
$c->stash->{project}, $c->stash->{primaryJob}, $c->stash->{jobs}, 0);
|
||||||
error($c, "This view set has no successful results yet.") if !defined $latest;
|
error($c, "This view set has no successful results yet.") if !defined $latest;
|
||||||
$c->res->redirect($c->uri_for($self->action_for("view_view"), $c->req->captures, $latest->id, @args));
|
$c->res->redirect($c->uri_for($self->action_for("view_view"), $c->req->captures, $latest->id, @args, $c->req->params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ sub latest_finished : Chained('view') PathPart('latest-finished') {
|
|||||||
my $latest = getLatestSuccessfulViewResult(
|
my $latest = getLatestSuccessfulViewResult(
|
||||||
$c->stash->{project}, $c->stash->{primaryJob}, $c->stash->{jobs}, 1);
|
$c->stash->{project}, $c->stash->{primaryJob}, $c->stash->{jobs}, 1);
|
||||||
error($c, "This view set has no successful results yet.") if !defined $latest;
|
error($c, "This view set has no successful results yet.") if !defined $latest;
|
||||||
$c->res->redirect($c->uri_for($self->action_for("view_view"), $c->req->captures, $latest->id, @args));
|
$c->res->redirect($c->uri_for($self->action_for("view_view"), $c->req->captures, $latest->id, @args, $c->req->params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -209,9 +209,8 @@ sub result : Chained('view') PathPart('') {
|
|||||||
elsif (scalar @args >= 1 && $args[0] eq "eval") {
|
elsif (scalar @args >= 1 && $args[0] eq "eval") {
|
||||||
my $eval = $c->stash->{result}->{eval};
|
my $eval = $c->stash->{result}->{eval};
|
||||||
notFound($c, "This view result has no evaluation.") unless defined $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]);
|
$c->res->redirect($c->uri_for($c->controller('JobsetEval')->action_for("view"),
|
||||||
$uri .= "/" . join("/", @args[1..$#args]) if scalar @args > 1;
|
[$eval->id], @args[1..$#args], $c->req->params));
|
||||||
$c->res->redirect($uri);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Provide a redirect to the specified job of this view result
|
# Provide a redirect to the specified job of this view result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user