Commit fdc7c87
kernelci: api: helper: fix rules enforcement for missing params
By default, if a rule refers to a param that can be found neither in
the to-be-created node nor in any of its ancestors we assume the rule
is verified (as in, we don't block creating the node). This behaviour
felt safe enough until we encountered a rare corner case:
`coverage-report` nodes were created with a `kunit-x86_64` parent,
although such nodes should only be created on jobs run for a kernel
built with the `coverage` fragment.
This could happen because `kunit-x86_64` is created from a `checkout`
node, not a `kbuild` one, and therefore neither this job nor its parent
contain a `fragments` attribute.
The above showed we needed to be a bit stricter when checking rules. To
this end, the following behaviour is enforced for missing attributes:
- if the rule only contains a deny-list, the rule is verified and the
node can be created (a non-existing attribute cannot have a forbidden
value, precisely because it doesn't have a value)
- if an allow-list is present, then the attribute's value MUST be part
of this list; as a consequence, we now require the attribute to exist,
and deny the node creation if it doesn't
Fixes kernelci/kernelci-pipeline#1290
Signed-off-by: Arnaud Ferraris <[email protected]>1 parent f16f2fd commit fdc7c87
1 file changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
166 | | - | |
167 | 165 | | |
168 | 166 | | |
169 | 167 | | |
170 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
| |||
0 commit comments