Skip to content

Conversation

@a-wai
Copy link
Contributor

@a-wai a-wai commented Oct 8, 2025

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 the former
should only happen 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 at all)
  • 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

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

a-wai added 2 commits October 8, 2025 17:45
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 <arnaud.ferraris@collabora.com>
Ensure all messages indicating a node creation is denied due to rules
are formatted in a similar way, so we can more easily search for them in
logs. Also make it clear whenever we're printing a deny-list by
prefixing the list with `!`.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
@JenySadadia
Copy link
Collaborator

@JenySadadia JenySadadia added this pull request to the merge queue Oct 9, 2025
Merged via the queue into kernelci:main with commit 4a54093 Oct 9, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incomplete coverage jobs for kunit

2 participants