-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(aws-cdk): Improvements to IAM diff rendering (#1542)
Contains the following changes: - Print table to STDOUT instead of STDERR. This ensures the diff output and the "confirm (y/n)" prompt that follows it don't interleave on the terminal, degrading readability. - Control table width to not exceed the terminal width, so that it doesn't wrap and lead to a mess of lines. - Switch back to the new version of the `table` library (instead of `cli-table`) which now has in-cell newline support, to get rid of the rendering bugs in `cli-table` that would occasionally eat newlines. - Render resource `replace` impact as red instead of yellow, to indicate that data loss will be happening here (fixes #1458). - Change replacement diffing in order to not trigger IAM changes dialog (fixes #1495). - Print a message instead of an empty table if 'cdk context' has no information in it (fixes #1549). Explanation: We used to modify the new target template in place, causing changes to the logical ids of replaced resources, which would trigger downstream changes, which would further trigger potential downstream replacements, etc. This would properly calculate the set of impacted resources, but would also lead to the modified logical ID popping up in the IAM diff, which was not desirable. In this change, we do the same processing but we throw away the template after all changes have been propagated, and only copy the resultant property *statuses* onto the diff object that gets returned to the user. This leads to the same displayed result without the changes to the template actually propagating. In the course of this modification, the diff classes have been changed to also have objects in places of resources and properties that didn't actually change (so that they could be modified in-place), and diff objects have a boolean telling whether they are actual changes or not.
- Loading branch information
Showing
15 changed files
with
395 additions
and
189 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.