my $storePath;
if (defined $inputInfo->{$argName}) {
# The argument name matches an input.
$storePath = $inputInfo->{$argName}->{storePath};
} else {
(my $prevBuild) = $db->resultset('Builds')->search(
{project => $project->name, jobset => $jobset->name, attrname => $argName},
{order_by => "timestamp DESC", rows => 1});
if (defined $prevBuild) {
# The argument name matches a previously built
# job in this jobset. Pick the most recent
# build. !!! refine the selection criteria:
# e.g., most recent successful build.
if (!isValidPath($prevBuild->outpath)) {
die "input path " . $prevBuild->outpath . " has been garbage-collected";
}
$storePath = $prevBuild->outpath;
} else {
# !!! reschedule?
die "missing input `$argName'";
}
}
$extraArgs .= " --arg $argName '{path = " . $storePath . ";}'";