Repository navigation
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
…tring with an intrinsic Since #1785 deploy describes its change set with IncludePropertyValues too, so the diff shown for --require-approval can leave out the same changes as cdk diff did (#2036). Pass the templates to the describer when updating a stack, so it describes the change set again when the approval diff would otherwise hide a template difference.
…and test the approval diff end to end
…ted change set cases
… --no-rollback test before it replaces anything
…lates Make `templates` required on `ChangeSetDescriber`, so that every description is completed when CloudFormation silently leaves a change out: - deploy and `execute-change-set` pass the deployed and synthesized templates, so `hasReplacement` (`--no-rollback`, paused and express stacks) sees a replacement the description dropped - `cdk validate` and the change set cleanup pass them too - toolkit-lib `diff` passes each nested stack its own templates - `Deployments.describeChangeSet` requires the deployed template - the failure diagnoser describes without property values, which never drops changes, using the paging describe the describer now shares
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2045 +/- ##
=======================================
Coverage 92.10% 92.10%
=======================================
Files 82 82
Lines 13189 13189
Branches 1880 1880
=======================================
Hits 12148 12148
Misses 1003 1003
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:
|
…tack being created or deleted
|
Automated review A maintainer will still review this — treat the notes below as a starting point. 📌 Commit This PR threads the deployed and generated templates through every change-set-describer call site so the hide-detection introduced for No issues found on this change. The surface changes resolve to internal classes rather than the tracked public API, the reordered template read stays inside its existing guard with no new call path, and the diagnoser consumes only resource changes and status, so dropping property values loses nothing it relies on. The behavior is well covered by one integration test per scenario against a dedicated fixture plus matching unit tests. 🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews. |
Follow-up to #2042, which fixed
cdk difffor #2036.Since #1785 (2.1135.0)
cdk deployalso describes its change set withIncludePropertyValues. Everything on the deploy path that reads a diff's description misses the changes described in #2042.So, with
--require-approval any-change, 2.1146.0 asks for approval with "There were no differences". toolkit-lib'sdiffhas the same gap for nested stacks.This PR adds a set of cases to capture this behavior in the paths that were not included in #2042
Every case starts from the following deployed value, built with an intrinsic:
and then adds a key (
b: '2') to make it:The last two rows put the same JSON in a container environment variable of an ECS task definition instead. Any change there replaces the task definition, so those rows are about a dropped replacement:
cdk deploy --require-approval any-changecdk deploy --no-execute --require-approval any-change, then--method=execute-change-setdeploy, approval request datadeploywithexecute-change-set, approval request datadiff, the parameter in a nested stackcdk diff --method=change-set, the parameter in a nested stackcdk deploy --require-approval destructive, task definitioncdk deploy --no-rollback, task definition(2.1146.0 = toolkit-lib 1.44.0)
Each row has an integ test in this PR. The last three rows already work on 2.1146.0, and their tests make sure that stays true:
cdk diffdiffs nested stacks from their templates, not their change setsIn order to fix the behavior defined in these cases:
templatesrequired onChangeSetDescriber, so no caller can skip the checkIncludePropertyValuesCloudFormation lists every change, so it needs no templates (reading them would add aGetTemplatecall)small caveat:
Reading the deployed template costs nothing extra for an ordinary deploy, which already read it to decide whether it can skip. With
--no-execute,--force,--revert-drift,--method=execute-change-setorcdk validateit costs oneGetTemplateper stack.For
execute-change-setthe check assumes the change set was created from the current synth, as the approval diff already does. If it was not, the worst case is one extra describe, since everything put back comes from CloudFormation's own description.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license