fix(cli): cdk ls returns stack id instead of stack display name#29447
fix(cli): cdk ls returns stack id instead of stack display name#29447mergify[bot] merged 4 commits intomainfrom
cdk ls returns stack id instead of stack display name#29447Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
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 displayNameaddDependency.
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 listfunctionality displays the stacks .For instance
With the latest changes for list stack dependencies we did add a new flag
-dto 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.displayNameandidfor the stacks.Using the
-dflag to display dependencies -addDependency()will create a differentdisplayNameandid.In such a case when a user runs
cdk lswe would want to show thedisplayNameand if not present then use theidFor instance:
With the
-dflag we would want to display something like:With our previous change we didn't consider
displayNameand just fetchedids which changes the previous functionality and caused a regression.Description of changes
With the new changes we are looking out for
displayNamefirst 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