-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
CLI: Add an option for not showing diffs for stacks with no changes #26526
Labels
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p1
package/tools
Related to AWS CDK Tools or CLI
Comments
nomike
added
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
labels
Jul 26, 2023
peterwoodworth
added
p1
effort/small
Small work item – less than a day of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Jul 27, 2023
Thanks for opening the full feature request 🙂 I can see why this is desired and would be helpful |
Hello! I will work on this and submit a PR. Thanks! |
MatasNed
added a commit
to MatasNed/aws-cdk
that referenced
this issue
Aug 7, 2023
Adds support for the --quiet flag within cdk diff command, for users that would not like the following messages 'Stack <name>' and 'There were no differences' to be silenced for stacks which have identified differences
MatasNed
added a commit
to MatasNed/aws-cdk
that referenced
this issue
Aug 7, 2023
Adds support for the --quiet flag within cdk diff command, for users that would not like the following messages 'Stack <name>' and 'There were no differences' to be silenced for stacks which have identified differences
MatasNed
added a commit
to MatasNed/aws-cdk
that referenced
this issue
Aug 7, 2023
Adds support for the --quiet flag within cdk diff command, for users that would not like the following messages 'Stack <name>' and 'There were no differences' to be silenced for stacks which have identified differences
MatasNed
added a commit
to MatasNed/aws-cdk
that referenced
this issue
Aug 7, 2023
Adds support for the --quiet flag within cdk diff command, for users that would not like the following messages 'Stack <name>' and 'There were no differences' to be silenced for stacks which have identified differences
mergify bot
pushed a commit
that referenced
this issue
Aug 10, 2023
Hello maintainers This is my first PR, so all feedback is welcome. This change adds support for the `--quiet` flag within cdk diff command, for users that would not like the following messages 'Stack <name>' and 'There were no differences' to be silenced for stacks which do not have *any* identified differences. The request was made by @nomike in the #26526, I simply followed the very well detailed description. The change follows similar structure to existing command and how they are passed, I have also added to the README as per the contributing guidelines. Before submitting I have. - Built the packages & linted them - Ran unit tests for the entire module - Ran all integration tests in the suite from `@aws-cdk-testing/cli-integ/bin/run-suite -a cli-integ-tests` - E2E tested by launching my small stack in account and executing diffs on it from my build. Closes #26526 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p1
package/tools
Related to AWS CDK Tools or CLI
Describe the feature
I recommend adding an option to the
cdk diff
command, which suppresses the display ofmessages completely.
If this feature is enabled, cdk will not even print the names of those stacks.
Use Case
I maintain a rather big CDK repository with over 700 stacks. When our developers change something, the CI/CD pipeline runs
cdk diff
as a first step. The developer and a colleague (4-eyes principle) is then expected to review what consequences their code change would have, in addition to reviewing the code-diff. This is to prevent unexpected side-effects bringing down our production systems.With the current behavior the diff is very long which makes this process time-consuming, which leads to people not looking through the diff thoroughly.
In Addition, sometimes important changes get lost in the vast amount of text.
Proposed Solution
A flag should be introduced which allows to enable or disable printing of those "There were no differences" messages.
It should ideally be configurable via CLI option and via
cdk.json
and~/.cdk.json
.To remain backwards compatible, the default setting should still print those messages.
Other Information
A few years back I wrote a wrapper around
cdk
in python3 calledpcdk
where I added support for parallel deployments (something which later was included directly intocdk
) and one of the features is a command line option called--supress-unchanged-stacks
which does exactly what I described.Similar to
cdk
my script collects the output of thediff
run for a single stack and prints it to the terminal in one go, as soon as thediff
run is complete. If the flag is set though and the output consists of "There were no differences", the print function is not called and the output is thus never printed to screen.If this were implemented directly in cdk, it will certainly be a cleaner solution as the code would have access to internal metrics, like the number of actual changes and such.
Unfortunately my companies policy doesn't allow me to share the source of
pcdk
publicly.Acknowledgements
CDK version used
2.88.0 (build 5d497f9)
Environment details (OS name and version, etc.)
Ubuntu 23.04
The text was updated successfully, but these errors were encountered: