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

CLI: give an error message and return 1 when trying to deploy a non-existent stack #15866

Closed
KTamas opened this issue Aug 3, 2021 · 2 comments · Fixed by #16073 or #16150
Closed

CLI: give an error message and return 1 when trying to deploy a non-existent stack #15866

KTamas opened this issue Aug 3, 2021 · 2 comments · Fixed by #16073 or #16150
Assignees
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p1 package/tools Related to AWS CDK Tools or CLI

Comments

@KTamas
Copy link

KTamas commented Aug 3, 2021

When trying to deploy a stack that does not exist (for example, cdk deploy thisstackdoesnotexist), the CDK simply gives no output, even the return code is 0. This is confusing, especially for people new to the CDK.

Use Case

Use case is people not getting tripped up by this and scratching their heads, especially for people new to the CDK.

Proposed Solution

Exit with return code 1 and give some sort of error i.e. Error: stack 'thisstackdoesnotexist' does not exist." Could implement some sort of fuzzy matching for stack name suggestions, so it could also say Did you mean [x]? or something like that.

This is a 🚀 Feature Request

@KTamas KTamas added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2021
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Aug 3, 2021
@rix0rrr
Copy link
Contributor

rix0rrr commented Aug 10, 2021

Sounds like a good idea!

@rix0rrr rix0rrr added effort/small Small work item – less than a day of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Aug 10, 2021
@rix0rrr rix0rrr removed their assignment Aug 10, 2021
@rix0rrr rix0rrr added the good first issue Related to contributions. See CONTRIBUTING.md label Aug 10, 2021
@kaizencc kaizencc self-assigned this Aug 18, 2021
@kaizencc kaizencc added bug This issue is a bug. and removed feature-request A feature should be added or improved. labels Aug 18, 2021
@mergify mergify bot closed this as completed in #16073 Aug 18, 2021
mergify bot pushed a commit that referenced this issue Aug 18, 2021
…n stack name (#16073)

Currently, `cdk deploy` and `cdk diff` on stacks that do not exist return no output on the command line. This PR introduces a descriptive error message for those cases so it is easier to understand what happened.

Leaving the idea of fuzzy matching for stack name suggestions to a (potential) future PR, I can open a new issue for that if this one goes through.

For the linter, I'm not sure if anything of value can be added to the readme so I'm wondering if this would be a candidate for exemption.

closes #15866 while adding the same idea to `diff` as well as `deploy`.

----

*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.

smguggen pushed a commit to smguggen/aws-cdk that referenced this issue Aug 24, 2021
…n stack name (aws#16073)

Currently, `cdk deploy` and `cdk diff` on stacks that do not exist return no output on the command line. This PR introduces a descriptive error message for those cases so it is easier to understand what happened.

Leaving the idea of fuzzy matching for stack name suggestions to a (potential) future PR, I can open a new issue for that if this one goes through.

For the linter, I'm not sure if anything of value can be added to the readme so I'm wondering if this would be a candidate for exemption.

closes aws#15866 while adding the same idea to `diff` as well as `deploy`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this issue Aug 26, 2021
…n stack name (aws#16073)

Currently, `cdk deploy` and `cdk diff` on stacks that do not exist return no output on the command line. This PR introduces a descriptive error message for those cases so it is easier to understand what happened.

Leaving the idea of fuzzy matching for stack name suggestions to a (potential) future PR, I can open a new issue for that if this one goes through.

For the linter, I'm not sure if anything of value can be added to the readme so I'm wondering if this would be a candidate for exemption.

closes aws#15866 while adding the same idea to `diff` as well as `deploy`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Sep 6, 2021
…n stack name (aws#16073)

Currently, `cdk deploy` and `cdk diff` on stacks that do not exist return no output on the command line. This PR introduces a descriptive error message for those cases so it is easier to understand what happened.

Leaving the idea of fuzzy matching for stack name suggestions to a (potential) future PR, I can open a new issue for that if this one goes through.

For the linter, I'm not sure if anything of value can be added to the readme so I'm wondering if this would be a candidate for exemption.

closes aws#15866 while adding the same idea to `diff` as well as `deploy`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
david-doyle-as24 pushed a commit to david-doyle-as24/aws-cdk that referenced this issue Sep 7, 2021
…n stack name (aws#16073)

Currently, `cdk deploy` and `cdk diff` on stacks that do not exist return no output on the command line. This PR introduces a descriptive error message for those cases so it is easier to understand what happened.

Leaving the idea of fuzzy matching for stack name suggestions to a (potential) future PR, I can open a new issue for that if this one goes through.

For the linter, I'm not sure if anything of value can be added to the readme so I'm wondering if this would be a candidate for exemption.

closes aws#15866 while adding the same idea to `diff` as well as `deploy`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mergify bot pushed a commit that referenced this issue Sep 8, 2021
…n stack name (#16150)

**second attempt as last PR failed integration tests**

Currently, `cdk deploy` and `cdk diff` on stacks that do not exist return no output on the command line. This PR introduces a descriptive error message for those cases so it is easier to understand what happened.

The behavior of the error is that **if** you specify a stack or stacks, the CLI expects to match at least one known stack. If the CLI cannot find a matching stack, the error is thrown. However, if you specify multiple stacks (i.e. `cdk deploy ThisStackExists ThisStackDoesnt`) and one of those stacks do not match, the CLI will silently ignore the request to deploy `ThisStackDoesnt` without throwing an error.

closes #15866 while adding the same idea to `diff` as well as `deploy`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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 good first issue Related to contributions. See CONTRIBUTING.md p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
3 participants