Support passing a jobset evaluation as an input
[?]
Nov 11, 2013, 9:17 PM
Z52T2BC4CTXQGBXPW4VZF5A5W67KDJ65RUBCM7MWHUNPMI6XLQCQCDependencies
- [2]
PHNLYPKBCall buildFinished when a cached build is added - [3]
PGSSRA7CAdd an input type "nix" for passing arbitrary Nix expressions - [4]
ZFEN2MAOSimplify jobset cloning - [5]
ODNCGFQ5* Improved the navigation bar: don't include all projects (since that - [6]
LZVO64YGMerge in the first bits of the API work - [7]
J5UVLXOK* Start of a basic Catalyst web interface. - [8]
FPK5LF53* Put the project-related actions in a separate controller. Put the - [9]
OOQ2D3KC* Refactoring: move fetchInput out of hydra_scheduler into a separate - [10]
RHUAFTJAShow aborted/cancelled builds separately in jobset eval pages - [11]
HQGXL4MXAdd validation for project and jobset names - [12]
JAH3UPWASupport revision control systems via plugins - [13]
TQVKZQUGUse the REST API in the web interface for editing jobsets - [14]
QD3NI3JYAllow comparing an eval against the jobset one day/week/month before - [15]
UXXFND4UAdd a redirect to the latest finished jobset evaluation - [16]
DE2DNCOIAllow comparing an evaluation with an arbitrary other evaluation - [17]
LMETCA7GCleanup - [18]
4LBNSOFKPropagate URI parameters - [*]
3HZY24CX* Make jobsets viewable under - [*]
U4TD3AIQAdd support for viewing jobset evaluations - [*]
KQS7DSKJ* Clean up indentation. - [*]
4FWDVNWAPass additional attributes for Git inputs - [*]
JTRG7RDQadd support for git as jobinput - [*]
LBNVQXUB* Build the /build stuff in a separate controller.
Change contents
- replacement in src/lib/Hydra/Controller/Jobset.pm at line 176
my ($c, $type, $value) = @_;my ($c, $name, $type, $value) = @_; - replacement in src/lib/Hydra/Controller/Jobset.pm at line 178
error($c, "Invalid Boolean value ‘$value’.") iferror($c, "The value ‘$value’ of input ‘$name’ is not a Boolean (‘true’ or ‘false’).") if - edit in src/lib/Hydra/Controller/Jobset.pm at line 180
error($c, "The value ‘$value’ of input ‘$name’ does not specify a Hydra evaluation. ". "It should be either the number of a specific evaluation, the name of ". "a jobset (given as <project>:<jobset>), or the name of a job (<project>:<jobset>:<job>).")if $type eq "eval" && $value !~ /^\d+$/&& $value !~ /^$projectNameRE:$jobsetNameRE$/&& $value !~ /^$projectNameRE:$jobsetNameRE:$jobNameRE$/; - replacement in src/lib/Hydra/Controller/Jobset.pm at line 246
$value = checkInputValue($c, $type, $value);$value = checkInputValue($c, $name, $type, $value); - replacement in src/lib/Hydra/Controller/Jobset.pm at line 303
my $eval = getLatestFinishedEval($c, $c->stash->{jobset})my $eval = getLatestFinishedEval($c->stash->{jobset}) - replacement in src/lib/Hydra/Controller/JobsetEval.pm at line 50
$eval2 = getLatestFinishedEval($c, $j);$eval2 = getLatestFinishedEval($j); - replacement in src/lib/Hydra/Controller/Root.pm at line 40
'sysbuild' => 'Build output (same system)''sysbuild' => 'Build output (same system)','eval' => 'Previous Hydra evaluation' - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 20
use Hydra::Helper::CatalystUtils; - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 150
sub fetchInputEval {my ($db, $project, $jobset, $name, $value) = @_;my $eval; - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 157
if ($value =~ /^\d+$/) {$eval = $db->resultset('JobsetEvals')->find({ id => int($value) });die "evaluation $eval->{id} does not exist\n" unless defined $eval;} elsif ($value =~ /^($projectNameRE):($jobsetNameRE)$/) {my $jobset = $db->resultset('Jobsets')->find({ project => $1, name => $2 });die "jobset ‘$value’ does not exist\n" unless defined $jobset;$eval = getLatestFinishedEval($jobset);die "jobset ‘$value’ does not have a finished evaluation\n" unless defined $eval;} elsif ($value =~ /^($projectNameRE):($jobsetNameRE):($jobNameRE)$/) {$eval = $db->resultset('JobsetEvals')->find({ project => $1, jobset => $2, hasnewbuilds => 1 },{ order_by => "id DESC", rows => 1, where =>\ [ # All builds in this jobset should be finished..."not exists (select 1 from JobsetEvalMembers m join Builds b on m.build = b.id where m.eval = me.id and b.finished = 0) "# ...and the specified build must have succeeded.. "and exists (select 1 from JobsetEvalMembers m join Builds b on m.build = b.id where m.eval = me.id and b.job = ? and b.buildstatus = 0)", [ 'name', $3 ] ]});die "there is no successful build of ‘$value’ in a finished evaluation\n" unless defined $eval;} else {die;}my $jobs = {};foreach my $build ($eval->builds) {next unless $build->finished == 1 && $build->buildstatus == 0;# FIXME: Handle multiple outputs.my $out = $build->buildoutputs->find({ name => "out" });next unless defined $out;# FIXME: Should we fail if the path is not valid?next unless isValidPath($out->path);$jobs->{$build->get_column('job')} = $out->path;}return { jobs => $jobs };} - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 205
}elsif ($type eq "eval") {@inputs = fetchInputEval($db, $project, $jobset, $name, $value); - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 297
die "input type ‘nix’ only supported for Nix-based jobsets\n" unless $exprType eq "nix"; - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 299
}when ("eval") {die "input type ‘eval’ only supported for Nix-based jobsets\n" unless $exprType eq "nix";my $s = "{ ";# FIXME: escape $_. But dots should not be escaped.$s .= "$_ = builtins.storePath ${\$alt->{jobs}->{$_}}; "foreach keys %{$alt->{jobs}};$s .= "}";push @res, "--arg", $input, $s; - replacement in src/lib/Hydra/Helper/CatalystUtils.pm at line 179
my ($c, $jobset) = @_;my ($jobset) = @_;