Skip to content
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

"Number of stacks with differences" is wrong #26818

Closed
trondhindenes opened this issue Aug 19, 2023 · 2 comments · Fixed by #26796
Closed

"Number of stacks with differences" is wrong #26818

trondhindenes opened this issue Aug 19, 2023 · 2 comments · Fixed by #26796
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p1 package/tools Related to AWS CDK Tools or CLI

Comments

@trondhindenes
Copy link

Describe the bug

WHen running cdk diff (and also "cdk deploy" I think), cdk produces this:
"Number of stacks with differences: xx". This is not correct. It should read "Number of resources with differences: xx"

Expected Behavior

the message should read "Number of resources with differences"

Current Behavior

The message reads: "Number of stacks with differences"

Reproduction Steps

just run cdk diff/deploy and look at the output

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.89.0

Framework Version

No response

Node.js Version

18.17

OS

Ubuntu 22

Language

Python

Language Version

No response

Other information

No response

@trondhindenes trondhindenes added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 19, 2023
@trondhindenes trondhindenes changed the title (module name): "Number of stacks with differences" is wrong "Number of stacks with differences" is wrong Aug 19, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Aug 19, 2023
@peterwoodworth 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 Aug 21, 2023
@peterwoodworth
Copy link
Contributor

peterwoodworth commented Aug 21, 2023

Yeah, I get

Resources
[-] AWS::IAM::Role fn/ServiceRole fnServiceRole5D180AFD destroy
[-] AWS::Lambda::Function fn fn5FF616E3 destroy
[+] AWS::IAM::Role fndfsdf/ServiceRole fndfsdfServiceRoleC234D9DC 
[+] AWS::Lambda::Function fndfsdf fndfsdf4F4834C5 


✨  Number of stacks with differences: 4

Here's the source code

stream.write(format('\n✨ Number of stacks with differences: %s\n', diffs));

According to the PR, it was intending to print the number of stacks. So the solution here should probably be to actually accomplish that, rather than switch the wording to "resources"

@mergify mergify bot closed this as completed in #26796 Aug 21, 2023
mergify bot pushed a commit that referenced this issue Aug 21, 2023
The current logic counts the number of changes in any parent stacks. It doesn't count nested stacks correctly, and doesn't count parent stacks correctly.

With this change:
<img width="1047" alt="Screenshot 2023-08-18 at 9 43 49 AM" src="https://github.com/aws/aws-cdk/assets/66279577/b417baa7-58d9-454a-a735-4bd406f1c126">

Without this change: 
<img width="1047" alt="Screenshot 2023-08-18 at 9 51 55 AM" src="https://github.com/aws/aws-cdk/assets/66279577/85e87e72-25ec-47af-96af-f47f7c43a4f2">

Closes #26818.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants