Fix rules behaviour for missing params #2991
Merged
+24
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-reportnodes were created with a
kunit-x86_64parent, although the formershould only happen on jobs run for a kernel built with the
coveragefragment.
This could happen because
kunit-x86_64is created from acheckoutnode, not a
kbuildone, and therefore neither this job nor its parentcontain a
fragmentsattribute.The above showed we needed to be a bit stricter when checking rules. To
this end, the following behaviour is enforced for missing attributes:
node can be created (a non-existing attribute cannot have a forbidden
value, precisely because it doesn't have a value at all)
of this list; as a consequence, we now require the attribute to exist,
and deny the node creation if it doesn't
This PR also adds minor improvements to messages printed in the context
of rules verification in order to improve the consistency of said messages.
Fixes kernelci/kernelci-pipeline#1290