CFE-3635: Prototyped dnf_appstream custom promise type#117
Open
nickanderson wants to merge 1 commit intocfengine:masterfrom
Open
CFE-3635: Prototyped dnf_appstream custom promise type#117nickanderson wants to merge 1 commit intocfengine:masterfrom
nickanderson wants to merge 1 commit intocfengine:masterfrom
Conversation
af7b8f4 to
568afb1
Compare
Member
Author
|
ok @larsewi 🫣 |
2c33c57 to
a1d6535
Compare
larsewi
previously requested changes
Jan 23, 2026
d336e98 to
bdfd6b2
Compare
Member
Author
|
OK fixed up review comments, renamed to just appstreams, ready for review again. |
bdfd6b2 to
e1bd74c
Compare
A CFEngine custom promise type for managing AppStream modules (https://www.redhat.com/en/blog/introduction-appstreams-and-modules-red-hat-enterprise-linux) on compatible systems. - Enable, disable, install, and remove AppStream modules - Support for specifying streams and profiles Ticket: CFE-3653
e1bd74c to
a5be74c
Compare
larsewi
approved these changes
Mar 31, 2026
Contributor
larsewi
left a comment
There was a problem hiding this comment.
The promise type LGTM 🚀 The pytests are written with a framework that I don't know.
Comment on lines
+57
to
+68
| if value not in ( | ||
| "enabled", | ||
| "disabled", | ||
| "installed", | ||
| "removed", | ||
| "default", | ||
| "reset", | ||
| ): | ||
| raise ValidationError( | ||
| "State attribute must be 'enabled', 'disabled', 'installed', " | ||
| "'removed', 'default', or 'reset'" | ||
| ) |
Contributor
There was a problem hiding this comment.
Consider:
Suggested change
| if value not in ( | |
| "enabled", | |
| "disabled", | |
| "installed", | |
| "removed", | |
| "default", | |
| "reset", | |
| ): | |
| raise ValidationError( | |
| "State attribute must be 'enabled', 'disabled', 'installed', " | |
| "'removed', 'default', or 'reset'" | |
| ) | |
| accepted = ( | |
| "enabled", | |
| "disabled", | |
| "installed", | |
| "removed", | |
| "default", | |
| "reset", | |
| ) | |
| if value not in accepted: | |
| raise ValidationError( | |
| f"State attribute must be '{"', '".join(accepted)}'" | |
| ) |
|
|
||
| def _validate_module_name(self, name): | ||
| # Validate module name to prevent injection | ||
| if not re.match(r"^[a-zA-Z0-9_.-]+$", name): |
Contributor
There was a problem hiding this comment.
re.match always anchors to the start of the string. Hence, the ^ is redundant. However, it does not hurt to be explicit. You can also consider using re.fullmatch (it reads better):
Suggested change
| if not re.match(r"^[a-zA-Z0-9_.-]+$", name): | |
| if not re.fullmatch(r"[a-zA-Z0-9_.-]+", name): |
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.
Ticket: CFE-3635