Closed nomike closed 1 month ago
Thanks for reporting @nomike,
@rix0rrr @MatasNed was this the desired outcome for the quiet
flag?
Thanks for reporting @nomike,
@rix0rrr @MatasNed was this the desired outcome for the
quiet
flag?
Looks like a bug on the first glance, will submit a PR this
The desired output of the --quiet
flag is to show stacks with changed resources, just like they would be shown without it, but if a stack doesn't have any changes, it should not be shown at all.
@sakurai-ryo @nomike Hello, I'm a member of the CDK team and I've been investigating this issue. I notice that some progress has been made on it. I'm reaching out to see if either of you would like to take ownership of this task, or if you prefer, I can handle it myself?
Hi @SankyRed Sorry for leaving the PR out. I missed notifications from reviewers. I will create a new PR within 2 ~ 3 days. If you need to fix this problem immediately, feel free to create a new PR.
@sakurai-ryo No hurry, the CDK team is looking into P1s, and since you've made progress on it, I wanted to check if you'd be interested in getting it over the line. I could follow up with you, and if not, I can take it on.
Hi @SankyRed
I created the new PR.
However, the pr/needs-cli-test-run
label is not assigned. Is it possible to assign it?
https://github.com/aws/aws-cdk/pull/30186
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.
Describe the bug
I originally filed a feature request #26526 to suppress output of
When you have a lot of stacks and want to know what will be change on deploy, those messages clutter the output and one might miss the real changes in between.
The
--quiet
flag was introduced in pull request 26652. Using this flag however, suppresses "Stack stackname" also for stacks which do have changes, so it's not clear anymore to which stack a change belongs.Expected Behavior
Output without using the
--quiet
flag:Current Behavior
Output when using the
--quiet
flag:Reproduction Steps
Introduce changes to your stacks, run
cdk diff --quiet
.Possible Solution
I have written a wrapper for cdk in the past, which added parallel deployments (unfortunately company policy prevents me from sharing the source). I've added a feature like this in my code.
If the operating mode is "diff", the output for each stack is cached and printed all at once, once the stack is processed. This is to prevent the output of stacks becoming all mixed up. In other modes ("deploy", "destroy", ...) this caching does not happen, as you want to see immediately if something goes wrong, so you could introduce emergency counter-measures.
When the "--quiet" flag is present (I named it "--suppress-unchanged-stacks"), at the end of a stacks diff, the code checks whether the line ~"^There were no differences$" is part of the output and just skips printing it to the screen if it is.
As my script was an external wrapper I was fairly limited in how to do this. Thus that solution has a lot of short-comings and potential issues (e.g. it doesn't work at all with i18n or l10n).
I'm sure that inside the cdk codebase itself a much more resilient method could be found to assert whether there have been changes in a stack.
Additional Information/Context
No response
CDK CLI Version
2.94.0 (build 987c329)
Framework Version
No response
Node.js Version
v20.5.1
OS
Ubuntu 22.04.3 LTS
Language
Typescript, Python, .NET, Java, Go
Language Version
not applicable
Other information
No response