-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cli): empty non top-level stack does not get deleted #21624
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure that your PR title confirms to the conventional commit standard (fix, feat, chore) and that it is written in a style that will reflect correctly in the change log (See Contributing Guide, Pull Requests). Your PR body should describe the problem the PR is solving, and the design approach and alternatives considered. Explain why the PR solves the problem. A link to an issue is helpful, but does not replace an explanation of your thought process.
Additionally, we cannot provide a meaningful review for PRs without any testing. Please add tests for this change. If this is not a change that automated tests can be written for, please explain how this change has been manually tested.
Pull request has been modified.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Fixed selector pattern for the empty stack which must be deleted during the deployment. I set stack selector pattern as `stack.hierarchicalId` because hierarchicalId is used in `selectMatchingStacks` method which is called when destroy logic is looking for the stack to be deleted. https://github.com/aws/aws-cdk/blob/92d6d58029595735df6902db5f820b1182dfb27b/packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts#L138 There is also existing integration test which covers destroy logic and it works now without additional modifications: https://github.com/aws/aws-cdk/blob/92d6d58029595735df6902db5f820b1182dfb27b/packages/aws-cdk/test/integ/cli/cli.integtest.ts#L685 **How I tested it locally?** - Prepared a package with fix with `yarn package` and installed with `npm install -g dist/js/aws-cdk-0.0.0.tgz` - Reproduced steps from the bug aws#20822 - Ensured that the issue is fixed closes aws#20822 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Fixed selector pattern for the empty stack which must be deleted during the deployment. I set stack selector pattern as
stack.hierarchicalId
because hierarchicalId is used inselectMatchingStacks
method which is called when destroy logic is looking for the stack to be deleted.aws-cdk/packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts
Line 138 in 92d6d58
There is also existing integration test which covers destroy logic and it works now without additional modifications:
aws-cdk/packages/aws-cdk/test/integ/cli/cli.integtest.ts
Line 685 in 92d6d58
How I tested it locally?
yarn package
and installed withnpm install -g dist/js/aws-cdk-0.0.0.tgz
closes #20822
All Submissions:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license