This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
nix-packages/ci/hydra/jobset-inputs-for-flakes.patch

71 lines
2.9 KiB
Diff
Raw Normal View History

2023-04-22 06:59:53 +00:00
diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm
index eeb4232a..b6e9519c 100644
--- a/src/lib/Hydra/Controller/Jobset.pm
+++ b/src/lib/Hydra/Controller/Jobset.pm
@@ -294,26 +294,24 @@ sub updateJobset {
# Set the inputs of this jobset.
$jobset->jobsetinputs->delete;
- if ($type == 0) {
- foreach my $name (keys %{$c->stash->{params}->{inputs}}) {
- my $inputData = $c->stash->{params}->{inputs}->{$name};
- my $type = $inputData->{type};
- my $value = $inputData->{value};
- my $emailresponsible = defined $inputData->{emailresponsible} ? 1 : 0;
- my $types = knownInputTypes($c);
-
- badRequest($c, "Invalid input name $name.") unless $name =~ /^[[:alpha:]][\w-]*$/;
- badRequest($c, "Invalid input type $type; valid types: $types.") unless defined $c->stash->{inputTypes}->{$type};
-
- my $input = $jobset->jobsetinputs->create(
- { name => $name,
- type => $type,
- emailresponsible => $emailresponsible
- });
-
- $value = checkInputValue($c, $name, $type, $value);
- $input->jobsetinputalts->create({altnr => 0, value => $value});
- }
+ foreach my $name (keys %{$c->stash->{params}->{inputs}}) {
+ my $inputData = $c->stash->{params}->{inputs}->{$name};
+ my $type = $inputData->{type};
+ my $value = $inputData->{value};
+ my $emailresponsible = defined $inputData->{emailresponsible} ? 1 : 0;
+ my $types = knownInputTypes($c);
+
+ badRequest($c, "Invalid input name $name.") unless $name =~ /^[[:alpha:]][\w-]*$/;
+ badRequest($c, "Invalid input type $type; valid types: $types.") unless defined $c->stash->{inputTypes}->{$type};
+
+ my $input = $jobset->jobsetinputs->create(
+ { name => $name,
+ type => $type,
+ emailresponsible => $emailresponsible
+ });
+
+ $value = checkInputValue($c, $name, $type, $value);
+ $input->jobsetinputalts->create({altnr => 0, value => $value});
}
}
diff --git a/src/root/edit-jobset.tt b/src/root/edit-jobset.tt
index 61e3636f..73f11a72 100644
--- a/src/root/edit-jobset.tt
+++ b/src/root/edit-jobset.tt
@@ -42,7 +42,15 @@
[% END %]
[% BLOCK renderJobsetInputs %]
- <table class="table table-striped table-condensed show-on-legacy">
+ <div class="card show-on-flake border-danger">
+ <div class="text-danger card-body">
+ <h5 class="card-title">Jobset Inputs don't take any effect for flakes</h5>
+ <p class="card-text">
+ These are only available to configure Hydra plugins.
+ </p>
+ </div>
+ </div>
+ <table class="table table-striped table-condensed">
<thead>
<tr><th></th><th>Input name</th><th>Type</th><th style="width: 50%">Value</th><th>Notify committers</th></tr>
</thead>