Skip to content

Conversation

@go-to-k
Copy link
Contributor

@go-to-k go-to-k commented Dec 10, 2025

Fixes: #1003


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

codecov-commenter commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.98%. Comparing base (4813f35) to head (989cb78).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #985      +/-   ##
==========================================
+ Coverage   87.72%   87.98%   +0.26%     
==========================================
  Files          72       72              
  Lines       10077    10082       +5     
  Branches     1327     1335       +8     
==========================================
+ Hits         8840     8871      +31     
+ Misses       1212     1186      -26     
  Partials       25       25              
Flag Coverage Δ
suite.unit 87.98% <100.00%> (+0.26%) ⬆️

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.

auto-merge was automatically disabled December 10, 2025 18:25

Head branch was pushed to by a user without write access

@go-to-k go-to-k marked this pull request as draft December 10, 2025 18:47
@go-to-k go-to-k marked this pull request as ready for review December 10, 2025 19:06
@go-to-k go-to-k marked this pull request as draft December 10, 2025 19:06
@go-to-k go-to-k marked this pull request as ready for review January 10, 2026 16:27
docs

docs
@go-to-k go-to-k changed the title fix(cli): deploy and destroy with --all option fails on apps with no top-level stacks fix(cli): deploy and destroy with --all option fail on apps with no top-level stacks Jan 13, 2026
Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this behavior is desirable or intuitive.

The constraints are:

  • --all was introduced before Stages existed. When Stages were introduced, it would continue to select stacks only in the top-level assembly.
  • Stages are intended to be deployed using a pipeline in the same application. For that use case, you don't really want to select them using cdk deploy.
  • I think having a "sometimes cdk deploy deploys stacks in stages and sometimes not" kind of behavior will be extremely confusing.

I understand this might be desirable for your specific use case, but is your use case represenative?

As written on your issue,

$ cdk deploy '**' 

Should solve your particular problem exactly, and it's not that much more to type than --all.


Don't get me wrong: I'm not against making changes here altogether. But I think it should be a co-operation between the CDK app and the CLI. Perhaps a Stack gets a new option that interplays with a new selection mechanism:

new Stack(this, 'SomeStack', {
  deployUsingCli: WITH_ALL_FLAG | ONLY_IF_EXPLICITLY_SELECTED | NEVER,
});

And then we set appropriate defaults to retain existing behavior.

I'm also not opposed to changing the documentation to better reflect actual behavior.

But as-is, I think changing this behavior in the CLI only will get too confusing.

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.

(cli): deploy and destroy with --all option fails on apps with no top-level stacks

3 participants