Skip to content
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

feat(cli): warn of non-existent stacks in cdk destroy #32636

Merged
merged 22 commits into from
Jan 7, 2025

Conversation

go-to-k
Copy link
Contributor

@go-to-k go-to-k commented Dec 22, 2024

Issue # (if applicable)

Closes #32545.
Fixes #27179.

Reason for this change

Once this PR was reverted by other cli-integ test regression.

But the regression was apparently due to a cause unrelated to that PR. That has been corrected in this PR (see: https://github.com/aws/aws-cdk/blob/v2.173.1/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts#L286-L291).

Therefore, I submit the same PR again.

Description of changes

This PR for cli is to warn if stacks with wrong cases (=not exist) specified in cdk destroy.

* It does not display the message Are you sure you want to delete: if there is no matching stack.
* Even if the stack does not exist, cdk destroy will not fail, it will just print a warning.

Actual Outputs:

cdk-destroy-warn

Describe any new or updated permissions being added

<!— What new or updated IAM permissions are needed to support the changes being introduced ? -->

Nothing.

Description of how you validated changes

Both of unit tests and cli-integ tests.

The changes were already approved in the last PR.

Checklist


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

@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 labels Dec 22, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team December 22, 2024 19:14
@github-actions github-actions bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label Dec 22, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@aws-cdk-automation aws-cdk-automation added the pr/needs-cli-test-run This PR needs CLI tests run against it. label Dec 22, 2024
Copy link

codecov bot commented Dec 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.52%. Comparing base (428bf21) to head (bb189c2).
Report is 13 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #32636       +/-   ##
===========================================
+ Coverage   66.96%   81.52%   +14.55%     
===========================================
  Files         329      222      -107     
  Lines       18667    13715     -4952     
  Branches     3260     2417      -843     
===========================================
- Hits        12501    11181     -1320     
+ Misses       5839     2254     -3585     
+ Partials      327      280       -47     
Flag Coverage Δ
suite.unit 81.52% <100.00%> (+14.55%) ⬆️

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

Components Coverage Δ
packages/aws-cdk 80.97% <100.00%> (+0.26%) ⬆️
packages/aws-cdk-lib/core 82.09% <ø> (ø)

@go-to-k go-to-k changed the title feat(cli): warn of non-existent stacks in cdk destroy feat(cli): warn of non-existent stacks in cdk destroy Dec 22, 2024
@go-to-k
Copy link
Contributor Author

go-to-k commented Dec 23, 2024

Exemption Request:

The change was already approved in the last PR.

Features must contain a change to a README file.

This PR just outputs warnings so I didn't change README.

Features must contain a change to an integration test file and the resulting snapshot.

No snapshot is needed because this PR is for CLI. And I'm waiting for cli-integ-tests to run.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Dec 23, 2024
@go-to-k go-to-k marked this pull request as ready for review December 23, 2024 10:14
@go-to-k go-to-k requested a review from a team as a code owner December 23, 2024 10:14
@go-to-k
Copy link
Contributor Author

go-to-k commented Dec 24, 2024

@mrgrain

Thanks for your review! I have made all the suggested changes and added tests for the suggested stacks messages. I would love to see a review from you or the team.

This is a sample image:
cdk-destroy-warn

Happy Xmas!

@go-to-k
Copy link
Contributor Author

go-to-k commented Jan 3, 2025

@mrgrain

Thank you, fixed it!

CI failed due to lack of Copyright changes in 2025, but incorporated it from main branch.

@aws-cdk-automation
Copy link
Collaborator

➡️ PR build request submitted to test-main-pipeline ⬅️

A maintainer must now check the pipeline and add the pr-linter/cli-integ-tested label once the pipeline succeeds.

@kaizencc kaizencc added pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested and removed pr/needs-cli-test-run This PR needs CLI tests run against it. labels Jan 7, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 7, 2025 04:03

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link
Contributor

mergify bot commented Jan 7, 2025

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: bb189c2
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit c199378 into aws:main Jan 7, 2025
18 of 19 checks passed
Copy link
Contributor

mergify bot commented Jan 7, 2025

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).

Copy link

github-actions bot commented Jan 7, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 2025
@go-to-k go-to-k deleted the cdk-destroy-warn branch January 7, 2025 05:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/medium Medium work item – several days of effort p2 pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
4 participants