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

❗ NOTICE: List stack output change issue. #29420

Closed
byF opened this issue Mar 9, 2024 · 2 comments Β· Fixed by #29447
Closed

❗ NOTICE: List stack output change issue. #29420

byF opened this issue Mar 9, 2024 · 2 comments Β· Fixed by #29447
Assignees
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. cli Issues related to the CDK CLI investigating This issue is being investigated and/or work is in progress to resolve the issue. management/tracking Issues that track a subject or multiple issues p0 package/tools Related to AWS CDK Tools or CLI

Comments

@byF
Copy link

byF commented Mar 9, 2024

Please add your +1 πŸ‘ to let us know you have encountered this

Status: RESOLVED

Overview

The latest release has changed the output of the list command, removing the path hierarchy.

Expected Behavior

Until now, the output of the cdk list was:

dev-us-east-1/primary/primary-stack
test-us-east-1/primary/primary-stack
prod-us-east-1/primary/primary-stack

Current Behavior

In 2.132.0, the output of the cdk list produces:

devuseast1primaryprimarystackAAF42913
testuseast1primaryprimarystack64CA4E80
produseast1primaryprimarystack6EE57081

Reproduction Steps

Run cdk list with 2.131.0 and 2.132.0 and compare the results

Workaround

This is not a bug but, the existing functionality was altered and an edge case has been missed. Workaround to get the expected behavior would be to downgrade to 2.131.0 version of aws-cdk.

Possible Solution

Adding a check to fetch the displayName and if not available then fetch the id.
#29447

Additional Information/Context

No response

CDK CLI Version

2.132.0

Framework Version

No response

Node.js Version

20

OS

macOS 14.4, Ubuntu 22

Language

TypeScript

Language Version

No response

Other information

No response

@byF byF added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 9, 2024
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Mar 9, 2024
@pahud pahud added p1 investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 11, 2024
@pahud pahud self-assigned this Mar 11, 2024
@pahud pahud added @aws-cdk/core Related to core CDK functionality cli Issues related to the CDK CLI labels Mar 11, 2024
@vinayak-kukreja
Copy link
Contributor

Hey, thank you for letting us know. We are taking a look into this.

@vinayak-kukreja vinayak-kukreja added p0 and removed p1 labels Mar 11, 2024
@SankyRed SankyRed changed the title cdk list: Output has changed with the latest release ❗ NOTICE: List stack output change issue. Mar 11, 2024
@SankyRed SankyRed added the management/tracking Issues that track a subject or multiple issues label Mar 11, 2024
@SankyRed SankyRed pinned this issue Mar 11, 2024
@mergify mergify bot closed this as completed in #29447 Mar 12, 2024
mergify bot pushed a commit that referenced this issue Mar 12, 2024
…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*
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.

mergify bot pushed a commit to cdklabs/aws-cdk-notices that referenced this issue Mar 12, 2024
SankyRed added a commit that referenced this issue Mar 12, 2024
…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*
mergify bot added a commit that referenced this issue Mar 12, 2024
### Issue # (if applicable)

Closes #[29420](#29420).

### Reason for this change

The latest release has changed the output of the `list` command, removing the path hierarchy.

### 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 unit tests 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*
@paulhcsun paulhcsun unpinned this issue Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. cli Issues related to the CDK CLI investigating This issue is being investigated and/or work is in progress to resolve the issue. management/tracking Issues that track a subject or multiple issues p0 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants