From 24acb9d6bb9ebf182628ff756f039f185471e95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Sun, 13 Sep 2020 18:19:20 +0200 Subject: [PATCH] Fix non-static declarative jobsets With the current implementation, if ANY hash was found inside the decl spec, the spec would be treated as static. This is problematic since `inputs` is a hash and hence any configuration would be handled as a static one. This fixes the code to match the documentation and only switch to static processing when ALL values are hashes. --- src/script/hydra-eval-jobset | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/script/hydra-eval-jobset b/src/script/hydra-eval-jobset index ff76f4ef..6766beaf 100755 --- a/src/script/hydra-eval-jobset +++ b/src/script/hydra-eval-jobset @@ -573,7 +573,14 @@ sub checkJobsetWrapped { die "Declarative specification file $declFile not valid JSON: $@\n" if $@; if (ref $declSpec eq "HASH") { - if (grep ref $_ eq "HASH", values %$declSpec) { + my $isStatic = 1; + foreach my $elem (values %$declSpec) { + if (ref $elem ne "HASH") { + $isStatic = 0; + last; + } + } + if ($isStatic) { # Since all of its keys are hashes, assume the json document # itself is the entire set of jobs handleDeclarativeJobsetJson($db, $project, $declSpec);