-
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
fix(cli): cdk ls
returns stack id instead of stack display name
#29447
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
list
stack fix when using addDependency
to show displayName
addDependency
.
addDependency
.cdk ls
returns stack id instead of stack dispaly name
cdk ls
returns stack id instead of stack dispaly namecdk ls
returns stack id instead of stack display name
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…9447) ### Issue # (if applicable) Closes #29420 ### Reason for this change The `cdk list` functionality displays the stacks . For instance ``` > cdk ls producer consumer ``` With the latest changes for list stack dependencies we did add a new flag `-d` to show the dependencies. The dependencies between stacks can be established in 2 ways: 1. Using the resource defined from one stack in another. 2. Using `addDependency()` to add dependency among stacks. Current we are fetching the dependency details through the `CloudStackArtifact`. * Establishing the dependency between stacks through the first method would have the same `displayName` and `id` for the stacks. Using the `-d` flag to display dependencies - ``` ❯ cdk list --show-dependencies - id: producer dependencies: [] - id: consumer dependencies: - id: producer dependencies: [] ``` * Establishing the dependency through `addDependency()` will create a different `displayName` and `id`. In such a case when a user runs `cdk ls` we would want to show the `displayName` and if not present then use the `id` For instance: ``` > cdk ls producer producer/consumer ``` With the `-d` flag we would want to display something like: ``` > cdk ls -d - id: producer dependencies: [] - id: producer/consumer dependencies: - id: producer dependencies: [] ``` With our previous change we didn't consider `displayName` and just fetched `id`s which changes the previous functionality and caused a regression. ### Description of changes With the new changes we are looking out for `displayName` first and if it does not exist we fetch the `id`. ### Description of how you validated changes Added a new unit test and updated integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Issue # (if applicable)
Closes #29420
Reason for this change
The
cdk list
functionality displays the stacks .For instance
With the latest changes for list stack dependencies we did add a new flag
-d
to show the dependencies.The dependencies between stacks can be established in 2 ways:
addDependency()
to add dependency among stacks.Current we are fetching the dependency details through the
CloudStackArtifact
.displayName
andid
for the stacks.Using the
-d
flag to display dependencies -addDependency()
will create a differentdisplayName
andid
.In such a case when a user runs
cdk ls
we would want to show thedisplayName
and if not present then use theid
For instance:
With the
-d
flag we would want to display something like:With our previous change we didn't consider
displayName
and just fetchedid
s which changes the previous functionality and caused a regression.Description of changes
With the new changes we are looking out for
displayName
first and if it does not exist we fetch theid
.Description of how you validated changes
Added a new unit test and updated integ tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license