Add --condition-mode option to projects-add-feature-conditionally#99
Merged
Merged
Conversation
Allows inverting the condition check. With --condition-mode=present (default) the target feature is added to projects that have the condition feature; with --condition-mode=absent it is added to projects that do not have it. Invalid values are rejected.
Contributor
Author
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the manage:projects-add-feature-conditionally CLI command with a --condition-mode option to control whether projects are selected when the condition feature is present (default, backward compatible) or absent (inverted behavior), and updates user-facing output and documentation accordingly.
Changes:
- Added
--condition-mode(present|absent) input option with validation and plumbing through all processing paths. - Updated per-project output and result counters/summary to reflect whether the condition was met.
- Updated
README.mdusage and examples to document the new option and inverted mode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Keboola/Console/Command/ProjectsAddFeatureConditionally.php | Adds --condition-mode option, validates it, applies inverted condition logic, and updates skip/output + summary counters. |
| README.md | Documents the new --condition-mode option and provides an absent mode example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The condition-feature argument now accepts a comma-separated list. With --condition-mode=present the target feature is added to projects that have all of them; with --condition-mode=absent to projects that have none of them.
Contributor
Author
|
asi jo, mám to vyzkoušený na obou PAYGO stacích |
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.
Summary
Adds a
--condition-modeoption to themanage:projects-add-feature-conditionallycommand, allowing the condition check to be inverted.Behavior
--condition-mode(defaultpresent) controls how the condition feature is evaluated:present– add the target feature only to projects that have the condition feature (previous behavior)absent– add the target feature only to projects that do not have the condition featureIn both modes, projects that already have the target feature are skipped, and disabled projects are skipped. Invalid
--condition-modevalues are rejected with a clear error.Notes
present, so the change is backward compatible.projectsSkippedByConditionand the summary line reworded, since inabsentmode the skipped projects are the ones that do have the condition feature.README.mdupdated with the new option and anabsentexample.Verification
composer phpcs– passescomposer phpstan– no errors