fix: stack header emoji respects allowedDestroyTypes#164
Open
igraves wants to merge 1 commit into
Open
Conversation
Removals whose resource type is in allowedDestroyTypes are excluded from destructiveChanges (no failure, no warning banner), but getEmoji() still keyed ❌ on the raw removedResources count — so routine churn like the AWS::ApiGateway::Deployment roll CDK performs on every REST API change painted the stack header red with no corresponding warning. Key ❌ on the filtered destructiveChanges only; allowed-type removals render 🟡 like other updates.
Author
|
@corymhall Feel free to take this or not. It was an issue I bumped into when visually filtering destructive changes from updates and an artifact of how CDK considers certain updates in an immutable context. |
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.
Problem
Removals whose resource type is listed in
allowedDestroyTypesare correctly excluded fromdestructiveChanges— they don't fail the job and don't appear in the "Destructive Changes" warning banner. But the per-stack header emoji still keys on the raw removal count:So routine, by-design churn — e.g. the
AWS::ApiGateway::Deploymentroll CDK performs on every REST API change (new hash-suffixed logical ID + removal of the old one) — paints the stack header ❌ even though there's no warning banner and the job passes. Reviewers see a red X with nothing destructive reported, which reads as inconsistent.Fix
Key
:x:on the filtereddestructiveChangesonly. Removals of allowed types render:yellow_circle:like other routine updates. Any non-allowed removal still lands indestructiveChanges(the early-return inStackDiff.evaluateDiffonly skips allowed types), so it keeps the ❌.Tests
Two new cases in
stage-processor.test.ts:allowedDestroyTypes→destructiveChanges == 0, comment contains:yellow_circle:and not:x:allowedDestroyTypes→destructiveChanges == 1, comment contains:x:npx projen buildrun;dist/included per repo convention.🤖 Generated with Claude Code