Add alternatives to mandatory keys#11268
Merged
jan-cerny merged 1 commit intoNov 13, 2023
Merged
Conversation
jan-cerny
requested changes
Nov 10, 2023
Collaborator
jan-cerny
left a comment
There was a problem hiding this comment.
I tried this and it works for me as expected 👍
| msg = "Profile {0} unselects all groups.".format(self.id_) | ||
| msg = ("Profile {0} unselects all groups. " | ||
| "Check whether it selects any rule or extends any profile." | ||
| .format(self.id_)) |
Member
Author
There was a problem hiding this comment.
Thanks for the review, should be fixed now.
cd8b25b to
58eea27
Compare
yuumasato
commented
Nov 10, 2023
| @@ -55,6 +55,10 @@ class Profile(XCCDFEntity, SelectionHandler): | |||
| "selections", | |||
Member
Author
There was a problem hiding this comment.
@jan-cerny Another approach would be to remove selections from MANDATORY_KEYS, I don't think this would open gaps that could lead to problems. But the ALTERNATIVE_KEYS seem to guard and lead better to what is expected.
Don't require profiles to have 'selections' if they have an 'extends'. This allows a profile to just extend a profile without having to add any selection. Making it possible to have non-versioned profiles to extend versioned profiles.
58eea27 to
521a4dc
Compare
|
Code Climate has analyzed commit 521a4dc and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 37.5% (50% is the threshold). This pull request will bring the total coverage in the repository to 58.8%. View more on Code Climate. |
jan-cerny
approved these changes
Nov 13, 2023
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.
Description:
selectionsif they have anextends.Rationale:
Add profile aliases for OpenShift versioned profiles #11241
Review Hints:
extendsto any profile and remove the wholeselectionskey.