Skip to content

fix(cli): flag is incorrectly modified when it's the only one detected#1183

Merged
aws-cdk-automation merged 1 commit intomainfrom
otaviom/single-flag-all
Feb 27, 2026
Merged

fix(cli): flag is incorrectly modified when it's the only one detected#1183
aws-cdk-automation merged 1 commit intomainfrom
otaviom/single-flag-all

Conversation

@otaviomacedo
Copy link
Copy Markdown
Contributor

When the command cdk flags --set --all --recommended is run, and the CLI detects that a single flag needs to be modified, it always sets the value of that flag to false, regardless of the recommended value.

This is the result of conflating this use case with the one in which the user explicitly sets a single flag to be modified, and passes no value (which defaults to false).

Differentiate these two cases, by checking whether the --all option was passed.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.76%. Comparing base (88b8417) to head (613ced1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1183      +/-   ##
==========================================
+ Coverage   87.70%   87.76%   +0.05%     
==========================================
  Files          72       72              
  Lines       10136    10136              
  Branches     1336     1339       +3     
==========================================
+ Hits         8890     8896       +6     
+ Misses       1221     1215       -6     
  Partials       25       25              
Flag Coverage Δ
suite.unit 87.76% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Merged via the queue into main with commit 9b82da1 Feb 27, 2026
46 checks passed
@aws-cdk-automation aws-cdk-automation deleted the otaviom/single-flag-all branch February 27, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants