Add mutually exclusive feature support via conflicts metadata#610
Open
ehelms wants to merge 1 commit into
Open
Add mutually exclusive feature support via conflicts metadata#610ehelms wants to merge 1 commit into
ehelms wants to merge 1 commit into
Conversation
2 tasks
jeremylenz
approved these changes
Jul 1, 2026
jeremylenz
left a comment
Contributor
There was a problem hiding this comment.
I like the bidirectional conflict validation here better than mine. 👍
Member
Author
|
I wasn't a huge fan of having to declare it bidirectionally as that feels like repeating. The other option would be to keep a separate list of things that conflict with one another which didn't feel great either. |
Contributor
|
I thought your PR added the bidirectionality where mine didn't have it. I guess I failed to see what the other difference is here, other than separation of concerns? |
Features can now declare conflicts in features.yaml to prevent incompatible features from being enabled together. The check_features role validates enabled_features for conflicts during deploy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6eeed47 to
1bfa50c
Compare
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.
Why are you introducing these changes? (Problem description, related links)
Features in foremanctl can declare dependencies but have no way to declare that two features conflict with each other. When incompatible features are both enabled — whether via
--add-featureon the same command, from a previous deploy's persisted state, or from flavor defaults — the deploy proceeds silently and produces a broken deployment. For example,cloud-connectorandiopboth provide connectivity to the Red Hat Hybrid Cloud Console using different mechanisms and cannot coexist (see #569).What are the changes introduced in this pull request?
conflictsproperty to the feature metadata schema infeatures.yaml, allowing features to declare mutual exclusivity alongside existingdependenciesconflicting_featuresJinja2 filter insrc/filter_plugins/foremanctl.pythat checksenabled_featuresfor conflict violations and returns deduplicated conflict pair descriptionsasymmetric_conflictsfilter that validates all conflict declarations are bidirectional (both sides must declare the conflict)src/roles/check_features/tasks/main.yamlwith a "Validate feature conflicts" assertion that fails the deploy early with a clear error messagedocs/developer/feature-metadata.mdanddocs/developer/how-to-add-a-feature.mdwith conflicts documentation and examplesHow to test this pull request
Steps to reproduce:
src/features.yaml(e.g. whencloud-connectorlands via Add cloud-connector as a native foremanctl feature #569, addconflicts: [iop]to it andconflicts: [cloud-connector]toiop)./foremanctl deploy --add-feature <feature-a> --add-feature <feature-b>with both conflicting features — deploy should fail with "Conflicting features detected" error.venv/bin/python -m pytest tests/unit/filter_test.py -vv --noconftestcd src; ansible-lint roles/check_features/tasks/main.yamlChecklist