fix(cli): --exclusively leads to 0 stacks being selected#21663
Closed
fix(cli): --exclusively leads to 0 stacks being selected#21663
--exclusively leads to 0 stacks being selected#21663Conversation
The new concurrency logic introduced in #20345 was checking for all dependencies to a stack to have been deployed previously for the stack to be unblocked, but if not all stacks are selected, they will never become unblocked. Because there was no check on being "complete" at the end, this silently leads to no stacks being deployed and the CLI no-opping. Fix by only waiting for selected stacks among the dependencies, and adding a safeguard at the end to make sure we deployed all stacks successfully (or failed halfway through).
Naumel
reviewed
Aug 18, 2022
packages/aws-cdk/lib/deploy.ts
Outdated
| // We shouldn't be able to get here, but check it anyway | ||
| const neverUnblocked = Object.entries(deploymentStates).filter(([_, s]) => s === 'pending').map(([n, _]) => n); | ||
| if (neverUnblocked.length > 0) { | ||
| throw new Error(`The following stacks never became unblocked: ${neverUnblocked.join(', ')}`); |
Contributor
There was a problem hiding this comment.
Should we add the Cut us a ticket prompt too?
Contributor
TheRealAmazonKendra
requested changes
Aug 19, 2022
Contributor
TheRealAmazonKendra
left a comment
There was a problem hiding this comment.
Definitely want some tests here.
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
josephedward
pushed a commit
to josephedward/aws-cdk
that referenced
this pull request
Aug 30, 2022
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.
The new concurrency logic introduced in #20345 was checking for all
dependencies to a stack to have been deployed previously for the stack
to be unblocked, but if not all stacks are selected, they will never
become unblocked.
Because there was no check on being "complete" at the end, this silently
leads to no stacks being deployed and the CLI no-opping.
Fix by only waiting for selected stacks among the dependencies, and
adding a safeguard at the end to make sure we deployed all stacks
successfully (or failed halfway through).
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license