Add manage:projects-add-feature-conditionally command#94
Merged
Conversation
Adds a target feature to projects that already have a given condition feature. Scope can be narrowed with mutually exclusive --maintainer-id, --organization-id or --project-id options; defaults to the whole stack. Runs as a dry run unless -f/--force is passed.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Symfony Console command to conditionally add a target project feature only for projects that already have a condition feature, with optional scoping (project/org/maintainer) and dry-run by default.
Changes:
- Introduces
manage:projects-add-feature-conditionallycommand, reusingProjectsAddFeatureclient setup, feature existence checks, and counters. - Registers the command in
cli.php. - Documents the new command usage and examples in
README.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Keboola/Console/Command/ProjectsAddFeatureConditionally.php |
Implements the conditional feature-add command with mutually exclusive scope options and result reporting. |
cli.php |
Registers the new command with the CLI application. |
README.md |
Adds usage documentation and examples for the new command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
odinuv
reviewed
Jun 1, 2026
| * features: string[] | ||
| * } $project | ||
| */ | ||
| $this->addFeatureToProjectConditionally($client, $output, $project, $conditionFeature, $targetFeature, $force); |
Member
There was a problem hiding this comment.
nehodil by se tu nějakej try-catch, aby to celý nekřáplo?
odinuv
approved these changes
Jun 1, 2026
c59ae77 to
60feb83
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.
Summary
Adds a new console command
manage:projects-add-feature-conditionallythat adds a target feature to projects, but only to those that already have a given condition feature.Behavior
For each project in scope:
-f/--force; without it the command runs as a dry run)Scope
The whole stack is processed by default. The scope can be narrowed with one of the mutually exclusive options:
--project-id– a single project--organization-id– all projects of one organization--maintainer-id– all projects of all organizations of one maintainerImplementation notes
ProjectsAddFeatureConditionallyextendsProjectsAddFeatureto reusecreateClient(),checkIfFeatureExists()and the result counters, following the existingOrganizationsAddFeaturepattern.project) or the command exits early.cli.phpand documented inREADME.md.Verification
composer phpcs– passescomposer phpstan– no errors