Skip to content

Chore: [AEA-0000] - handle stack does not exist in check destructive changes#710

Merged
anthony-nhs merged 1 commit intomainfrom
handle_no_stack
Apr 27, 2026
Merged

Chore: [AEA-0000] - handle stack does not exist in check destructive changes#710
anthony-nhs merged 1 commit intomainfrom
handle_no_stack

Conversation

@anthony-nhs
Copy link
Copy Markdown
Contributor

Summary

  • Routine Change

Details

  • handle stack not exist in check destructive changes

Copilot AI review requested due to automatic review settings April 27, 2026 08:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates destructive change-set checking to gracefully handle the case where the target CloudFormation stack no longer exists, avoiding an error in that scenario.

Changes:

  • Add a pre-flight DescribeStacks check in checkDestructiveChangeSet and skip processing when the stack is missing.
  • Update Vitest mocks to include DescribeStacksCommand and adjust expectations for the additional SDK call.
  • Add a new test case asserting the “stack does not exist” path logs and exits cleanly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/cdkConstructs/src/changesets/checkDestructiveChanges.ts Adds a stack-existence check (via DescribeStacks) and early-return behavior when the stack is missing.
packages/cdkConstructs/tests/changesets/checkDestructiveChanges.test.ts Extends AWS SDK mocks and updates/adds tests to cover the new stack-missing behavior.

Comment thread packages/cdkConstructs/src/changesets/checkDestructiveChanges.ts
Comment thread packages/cdkConstructs/src/changesets/checkDestructiveChanges.ts
@sonarqubecloud
Copy link
Copy Markdown

@anthony-nhs anthony-nhs enabled auto-merge (squash) April 27, 2026 09:05
@anthony-nhs anthony-nhs merged commit 727cb0a into main Apr 27, 2026
15 checks passed
@anthony-nhs anthony-nhs deleted the handle_no_stack branch April 27, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants