Repository navigation
fix(cloudformation-diff): handle removed resource metadata - #1741
fukunaga-kengo wants to merge 3 commits into
Conversation
Pull request was closed
|
@abhiramshaji-cyber @fukunaga-kengo Thanks for both of your fixes! I think each PR is missing a test case:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1741 +/- ##
=======================================
Coverage 92.08% 92.08%
=======================================
Files 83 83
Lines 13246 13246
Branches 1886 1886
=======================================
Hits 12197 12197
Misses 1011 1011
Partials 38 38
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Automated review A maintainer will still review this — treat the notes below as a starting point. 📌 Commit This PR fixes a bug in the 🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews. |
There was a problem hiding this comment.
See the review summary comment for the overview; the notes below are inline.
|
Congrats @fukunaga-kengo on getting this fix in, and thanks @mrgrain for the thoughtful review and for folding the extra test cases into the table. Really glad the removed and added cases from #2106 could help round out the coverage 🙂 |
|
Thanks @mrgrain for adding the extra test cases and reviewing this PR! Thanks also to @abhiramshaji-cyber for sharing the removal and addition tests from #2106. I really appreciate the help from both of you! |
Issue # (if applicable)
Fixes #390.
Fixes an assertion failure when a CloudFormation resource's
Metadatais removed.The template/change-set merger intentionally hides resource Metadata differences. It previously
did this by constructing a replacement difference from the new Metadata value twice. When Metadata
was removed, both values were
undefined, violating theDifferenceinvariant and throwing anAssertionError.
The fix marks the existing Metadata difference as unchanged instead of constructing another
difference. This preserves the existing behavior of hiding Metadata-only changes and handles
additions, modifications, and removals uniformly.
Testing
@aws-cdk/cloudformation-diff: 147 tests passed.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license