Support passing a jobset evaluation as an input

[?]
Nov 11, 2013, 9:17 PM
Z52T2BC4CTXQGBXPW4VZF5A5W67KDJ65RUBCM7MWHUNPMI6XLQCQC

Dependencies

  • [2] PHNLYPKB Call buildFinished when a cached build is added
  • [3] PGSSRA7C Add an input type "nix" for passing arbitrary Nix expressions
  • [4] ZFEN2MAO Simplify jobset cloning
  • [5] DE2DNCOI Allow comparing an evaluation with an arbitrary other evaluation
  • [6] J5UVLXOK * Start of a basic Catalyst web interface.
  • [7] LZVO64YG Merge in the first bits of the API work
  • [8] TQVKZQUG Use the REST API in the web interface for editing jobsets
  • [9] ODNCGFQ5 * Improved the navigation bar: don't include all projects (since that
  • [10] LMETCA7G Cleanup
  • [11] FPK5LF53 * Put the project-related actions in a separate controller. Put the
  • [12] HQGXL4MX Add validation for project and jobset names
  • [13] UXXFND4U Add a redirect to the latest finished jobset evaluation
  • [14] JAH3UPWA Support revision control systems via plugins
  • [15] OOQ2D3KC * Refactoring: move fetchInput out of hydra_scheduler into a separate
  • [16] RHUAFTJA Show aborted/cancelled builds separately in jobset eval pages
  • [17] QD3NI3JY Allow comparing an eval against the jobset one day/week/month before
  • [18] 4LBNSOFK Propagate URI parameters
  • [*] 3HZY24CX * Make jobsets viewable under
  • [*] U4TD3AIQ Add support for viewing jobset evaluations
  • [*] KQS7DSKJ * Clean up indentation.
  • [*] 4FWDVNWA Pass additional attributes for Git inputs
  • [*] JTRG7RDQ add 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
    [5.1950][5.1950:1983]()
    my ($c, $type, $value) = @_;
    [5.1950]
    [5.1983]
    my ($c, $name, $type, $value) = @_;
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 178
    [5.2009][5.1054:1110]()
    error($c, "Invalid Boolean value ‘$value’.") if
    [5.2009]
    [5.2059]
    error($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
    [5.2131]
    [5.2131]
    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
    [4.930][4.930:987]()
    $value = checkInputValue($c, $type, $value);
    [4.930]
    [5.4272]
    $value = checkInputValue($c, $name, $type, $value);
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 303
    [5.155][5.0:62]()
    my $eval = getLatestFinishedEval($c, $c->stash->{jobset})
    [5.155]
    [5.62]
    my $eval = getLatestFinishedEval($c->stash->{jobset})
  • replacement in src/lib/Hydra/Controller/JobsetEval.pm at line 50
    [5.1024][5.1024:1076]()
    $eval2 = getLatestFinishedEval($c, $j);
    [5.1024]
    [5.1076]
    $eval2 = getLatestFinishedEval($j);
  • replacement in src/lib/Hydra/Controller/Root.pm at line 40
    [5.434][5.434:485]()
    'sysbuild' => 'Build output (same system)'
    [5.434]
    [5.485]
    'sysbuild' => 'Build output (same system)',
    'eval' => 'Previous Hydra evaluation'
  • edit in src/lib/Hydra/Helper/AddBuilds.pm at line 20
    [2.122]
    [5.2759]
    use Hydra::Helper::CatalystUtils;
  • edit in src/lib/Hydra/Helper/AddBuilds.pm at line 150
    [22.6139]
    [23.0]
    sub fetchInputEval {
    my ($db, $project, $jobset, $name, $value) = @_;
    my $eval;
  • edit in src/lib/Hydra/Helper/AddBuilds.pm at line 157
    [23.1]
    [24.2204]
    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
    [5.948]
    [24.2591]
    }
    elsif ($type eq "eval") {
    @inputs = fetchInputEval($db, $project, $jobset, $name, $value);
  • edit in src/lib/Hydra/Helper/AddBuilds.pm at line 297
    [3.118]
    [3.118]
    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
    [3.181]
    [3.181]
    }
    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
    [5.220][5.220:247]()
    my ($c, $jobset) = @_;
    [5.220]
    [5.247]
    my ($jobset) = @_;