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

feat(cli): faster "no-op" deployments #6346

Merged
merged 4 commits into from
Feb 19, 2020
Merged

feat(cli): faster "no-op" deployments #6346

merged 4 commits into from
Feb 19, 2020

Conversation

eladb
Copy link
Contributor

@eladb eladb commented Feb 18, 2020

Bail-out before executing and creating change sets when the currently deployed template is identical to the one we are about to deploy.

This resolves #6046, where a stack that contains nested stack(s) will always try to update since CloudFormation assumes the nested template might have changed. In the CDK, since nested template URLs are immutable, we can trust that the URL will be changed, and therefore invalidate the parent template.

This also fixes the bug described in #2553, where a stack that includes a Transform always fail to deploy with No updates are to be performed when there are no changes to it.

The switch --force can be used to override this behavior.

Added unit test and performed a few manual tests to verify both bugs are resolved.

Resolves #6216


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Bail-out before executing and creating change sets when the currently deployed template is identical to the one we are about to deploy.

This resolves #6046, where a stack that contains nested stack(s) will always try to update since CloudFormation assumes the nested template might have changed. In the CDK, since nested template URLs are immutable, we can trust that the URL will be changed, and therefore invalidate the *parent* template.

This also fixes the bug described in #2553, where a stack that includes a `Transform` always fail to deploy with `No updates are to be performed` when there are no changes to it.

The switch `--force` can be used to override this behavior.

Added unit test and performed a few manual tests to verify both bugs are resolved.

Resolves #6216
@eladb eladb requested a review from shivlaks February 18, 2020 17:22
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 18, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 50a585d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@eladb eladb changed the title feat(cli): skip deployment if template did not change feat(cli): faster "no-op" deployments Feb 19, 2020
Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nice and super valuable functionality! - should we add an integ test for exercising the force flag (and for bailing out)

packages/aws-cdk/lib/api/deploy-stack.ts Show resolved Hide resolved
packages/aws-cdk/lib/api/deploy-stack.ts Show resolved Hide resolved
@eladb
Copy link
Contributor Author

eladb commented Feb 19, 2020

Let me look into an integ test. Good call.

@eladb eladb requested a review from shivlaks February 19, 2020 09:20
@eladb
Copy link
Contributor Author

eladb commented Feb 19, 2020

@shivlaks added an integration test!

Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify
Copy link
Contributor

mergify bot commented Feb 19, 2020

Thank you for contributing! Your pull request is now being automatically merged.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: a1473ae
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Feb 19, 2020

Thank you for contributing! Your pull request is now being automatically merged.

@mergify mergify bot merged commit d4a132b into master Feb 19, 2020
@mergify mergify bot deleted the benisrae/skip-update branch February 19, 2020 11:38
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: dfea8db
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

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
3 participants