Merged
Conversation
This commit changes the package name of all the policy rules to a single level, e.g. `release.cve` becomes `cve`. This better aligns with how these packages are used today. It moves the EC ecosystem closer to using package names as they are defined without having to rely on dynamically alterations to the package name. All package shortening code is removed from this repository. The package name used is now an exact match to the value provided to the `package` keyword in the rego files. (Note that package shortening still exists in the EC CLI, but that is expected to be removed soon as well.) The docs generation code is modified to take into account the file path of the policies in addition to its annotations. This is needed to distinguish between the policies in different directories. The "Package full name" section from the docs is removed since it is now exactly the same as the value of "Package name". Although policy rules under different directories are never used together, the tests in this repo load them all at once. As such, the package names have to be unique across the different directories. The one case where this caused a conflict was with `policy/build_task/labels` and `policy/release/labels`. To mitigate this, `policy/build_task/labels` is renamed to `policy/build_task/build_labels`. This is a breaking change but given that this policy is not widely used, this is ok. Ref: EC-864 Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
lcarva
commented
Oct 17, 2024
| # required build type label. | ||
| # | ||
| package build_task.labels | ||
| package build_labels |
Contributor
Author
There was a problem hiding this comment.
As mentioned in the description, this is a breaking change. That should be ok as, likely, the only place that uses it is here, and that references the bundle, not the package itself.
simonbaird
added a commit
to simonbaird/conforma-policy
that referenced
this pull request
May 2, 2025
The files being fixed here were using the old convention of nested namespace package names, which we used to do, but stopped doing in conforma#1198 . The symptom is a little unexpected -- some missing description/solution text in a violation report due to how the the metadata lookup is done by the cli. This could actually could be a separate bug, out of scope in this PR, but possibly in scope for https://issues.redhat.com/browse/EC-945 which I am also looking at currently. Anyway, this change should be enough to fix EC-1233. Note: The collection.rhtap_multi_ci change might not have any impact, but I'll change it anyhow so it's consistent with the others. Ref: https://issues.redhat.com/browse/EC-1233
st3penta
added a commit
to st3penta/policy
that referenced
this pull request
Feb 25, 2026
The conventions-check validation has been broken since PR 1198 when package names were flattened from policy.release.* to their current flat structure. The validation was filtering for namespaces starting with "data.policy" which no longer exist. This updates the policy_rule_files function to filter by file path instead of namespace prefix, and removes hardcoded "data.policy.release" assumptions throughout the validation rules. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Ref: conforma#1198 Ref: https://issues.redhat.com/browse/EC-1671
st3penta
added a commit
to st3penta/policy
that referenced
this pull request
Mar 6, 2026
The conventions-check validation has been broken since PR 1198 when package names were flattened from policy.release.* to their current flat structure. The validation was filtering for namespaces starting with "data.policy" which no longer exist. This updates the policy_rule_files function to filter by file path instead of namespace prefix, and removes hardcoded "data.policy.release" assumptions throughout the validation rules. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Ref: conforma#1198 Ref: https://issues.redhat.com/browse/EC-1671
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit changes the package name of all the policy rules to a single level, e.g.
release.cvebecomescve. This better aligns with how these packages are used today. It moves the EC ecosystem closer to using package names as they are defined without having to rely on dynamically alterations to the package name.All package shortening code is removed from this repository. The package name used is now an exact match to the value provided to the
packagekeyword in the rego files. (Note that package shortening still exists in the EC CLI, but that is expected to be removed soon as well.)The docs generation code is modified to take into account the file path of the policies in addition to its annotations. This is needed to distinguish between the policies in different directories.
The "Package full name" section from the docs is removed since it is now exactly the same as the value of "Package name".
Although policy rules under different directories are never used together, the tests in this repo load them all at once. As such, the package names have to be unique across the different directories. The one case where this caused a conflict was with
policy/build_task/labelsandpolicy/release/labels. To mitigate this,policy/build_task/labelsis renamed topolicy/build_task/build_labels. This is a breaking change but given that this policy is not widely used, this is ok.Ref: EC-864