-
Notifications
You must be signed in to change notification settings - Fork 35
fix(toolkit-lib)!: diff message payloads are incomplete #546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(toolkit-lib)!: diff message payloads are incomplete #546
Conversation
@@ -71,7 +71,7 @@ interface FormatStackDiffOptions { | |||
* | |||
* @default 3 | |||
*/ | |||
readonly context?: number; | |||
readonly contextLines?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just makes the calling a little nicer.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #546 +/- ##
=======================================
Coverage 79.10% 79.10%
=======================================
Files 47 47
Lines 7074 7074
Branches 794 793 -1
=======================================
Hits 5596 5596
Misses 1457 1457
Partials 21 21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
private permissionType(): PermissionChangeType { | ||
const diff = this.diff(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleanup. permissionType
is never called with a stackName. Let's not pretend it should.
Fixes #494
The messages emitted as part of diff were incomplete when multiple stacks are diffed. Previously the code would overwrite the formatted output with the last processed stack. We are also removing the already deprecated
securityOnly
option.To solve this properly, the diff messages have been restructured: For each stack we emit a new message with code
CDK_TOOLKIT_I4002
that contains all formatted diffs for the stack (including any nested stacks).The collated result message
CDK_TOOLKIT_I4001
does not contain formatted diffs anymore, but instead has a count for stacks with changes and the structured diff as returned by the action.BREAKING CHANGE: The data emitted by message
CDK_TOOLKIT_I4001
has changed. Instead of formatted diffs, it now contains a stack count and the template diff as returned by the action. The formatted output is now available on a new messageCDK_TOOLKIT_I4002
. Deprecated optionsecurityOnly
removed fromDiffOptions
used byToolkit.diff()
. Instead the action always prints and returns a security diff. Use a customIoHost
implementation to customize the exact diff output.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license