Merge pull request #815 from helsinki-systems/fix/non-static-decl

Fix non-static declarative jobsets
This commit is contained in:
Eelco Dolstra 2020-09-14 15:52:05 +02:00 committed by GitHub
commit b8a4ed0c77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -573,7 +573,14 @@ sub checkJobsetWrapped {
die "Declarative specification file $declFile not valid JSON: $@\n" if $@; die "Declarative specification file $declFile not valid JSON: $@\n" if $@;
if (ref $declSpec eq "HASH") { 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 # Since all of its keys are hashes, assume the json document
# itself is the entire set of jobs # itself is the entire set of jobs
handleDeclarativeJobsetJson($db, $project, $declSpec); handleDeclarativeJobsetJson($db, $project, $declSpec);