Skip to content

fix(cli): 'deploy' and 'diff' silently does nothing when given unknown stack name#16150

Merged
mergify[bot] merged 4 commits intoaws:masterfrom
kaizencc:cli-error
Sep 8, 2021
Merged

fix(cli): 'deploy' and 'diff' silently does nothing when given unknown stack name#16150
mergify[bot] merged 4 commits intoaws:masterfrom
kaizencc:cli-error

Conversation

@kaizencc
Copy link
Copy Markdown
Contributor

@kaizencc kaizencc commented Aug 20, 2021

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

@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Aug 20, 2021

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 20, 2021
@kaizencc kaizencc requested a review from rix0rrr August 20, 2021 15:59
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Sep 8, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 9ba0a42
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 74776f3 into aws:master Sep 8, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Sep 8, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants