New: [AEA-6536] - Added support for cleaning up arbitrary PR stacks#713
New: [AEA-6536] - Added support for cleaning up arbitrary PR stacks#713MatthewPopat-NHS wants to merge 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for deleting PR-related CloudFormation stacks that include additional suffix segments beyond the previously supported -sandbox pattern, ensuring more PR stack variants can be cleaned up automatically.
Changes:
- Extended PR stack name matching to allow arbitrary suffixes (e.g.
-front-door,-stateful). - Added a unit test covering deletion of multiple PR stack variants for the same PR number.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/cdkConstructs/src/stacks/deleteUnusedStacks.ts | Broadens PR stack name regex to match additional PR stack naming variants. |
| packages/cdkConstructs/tests/stacks/deleteUnusedStacks.test.ts | Adds coverage for deleting multiple stacks that share the same PR id but differ by suffix. |
There was a problem hiding this comment.
Pull request overview
Adds support for cleaning up PR CloudFormation stacks that include arbitrary suffixes (e.g. -front-door, -stateful) and reduces repeated GitHub API lookups when multiple stacks belong to the same PR.
Changes:
- Broaden PR stack name matching to allow an arbitrary suffix after the PR number.
- Add an in-memory PR state cache so multiple stacks for the same PR don’t trigger multiple GitHub API requests.
- Add a test case covering deletion of multiple same-PR stacks with different suffixes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/cdkConstructs/src/stacks/deleteUnusedStacks.ts | Expands PR stack regex matching and introduces PR state caching during a run. |
| packages/cdkConstructs/tests/stacks/deleteUnusedStacks.test.ts | Adds coverage for deleting multiple stacks sharing the same PR id but different suffixes. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|



Summary