From a69693a8328aa457adc06c185911ac4f5260ef87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Mon, 10 Jan 2022 18:28:41 +0100 Subject: [PATCH] hydra-eval-jobset: Fix two minor bugs I'm honestly too lazy to create two commits for fixing these one-line issues so here's one. The first hunk fixes the name of the projectName input. This is relevant now because it gets logged and the log message looks stupid when there is an input without a name. The second hunk fixes a warning when using declarative non-flake jobsets. The implementation may look weird but it's just the same as the logical implication operator of nix. --- src/script/hydra-eval-jobset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script/hydra-eval-jobset b/src/script/hydra-eval-jobset index f442565d..4848075f 100755 --- a/src/script/hydra-eval-jobset +++ b/src/script/hydra-eval-jobset @@ -607,7 +607,7 @@ sub checkJobsetWrapped { updateDeclarativeJobset($db, $project, ".jobsets", $declSpec); $jobset->discard_changes; $inputInfo->{"declInput"} = [ $declInput ]; - $inputInfo->{"projectName"} = [ fetchInput($plugins, $db, $project, $jobset, "", "string", $project->name, 0) ]; + $inputInfo->{"projectName"} = [ fetchInput($plugins, $db, $project, $jobset, "projectName", "string", $project->name, 0) ]; } } else { @@ -652,7 +652,7 @@ sub checkJobsetWrapped { my @args = ($jobset->nixexprinput // "", $jobset->nixexprpath // "", inputsToArgs($inputInfo)); my $argsHash = sha256_hex("@args"); my $prevEval = getPrevJobsetEval($db, $jobset, 0); - if (defined $prevEval && $prevEval->hash eq $argsHash && !$dryRun && !$jobset->forceeval && $prevEval->flake eq $flakeRef) { + if (defined $prevEval && $prevEval->hash eq $argsHash && !$dryRun && !$jobset->forceeval && (!defined($flakeRef) || ($prevEval->flake eq $flakeRef))) { print STDERR " jobset is unchanged, skipping\n"; Net::Statsd::increment("hydra.evaluator.unchanged_checkouts"); $db->txn_do(sub {