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(integ-runner): support snapshot diff on nested stacks #22881

Merged
merged 9 commits into from
Nov 16, 2022

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Nov 11, 2022

Previously we did not run diff Nested Stack templates separately. Any change would have been detected by the changed asset hash in the AWS::CloudFormation::Stack resource. With this change, nested templates are diff'ed as part of the integ test and any errors will be printed.

The change allows us to then ignore the asset hash in the s3 url for nested stacks if diffAsset: false (the default) is set. Previously this was the only way to detect changes in a nested stack. However the hash would also change if an asset inside the nested stack has changed (which should be ignored). With the change to diff nested stack templates, asset hashes in nested stack template are now transparently ignored.


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

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

gitpod-io bot commented Nov 11, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team November 11, 2022 15:04
@github-actions github-actions bot added the p2 label Nov 11, 2022
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 11, 2022
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

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.

@mrgrain mrgrain force-pushed the mrgrain/feat/snapshot-nested-stacks branch 2 times, most recently from bc8d82e to 3476def Compare November 15, 2022 18:26
@mrgrain mrgrain force-pushed the mrgrain/feat/snapshot-nested-stacks branch from 3476def to f8bb688 Compare November 15, 2022 19:36
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 16, 2022 10:15

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

@mrgrain mrgrain marked this pull request as ready for review November 16, 2022 10:30
@corymhall corymhall added the pr/do-not-merge This PR should not be merged at this time. label Nov 16, 2022
Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

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

Looks good! Just one nit.

* @param actualSnapshot The directory of the snapshot that is used for of the actual (current) app
* @returns Diagnostics as they would be returned by testSnapshot
*/
public snapshotTest(integTestFile: string, actualSnapshot?: string): {
Copy link
Contributor

Choose a reason for hiding this comment

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

Much better!

Co-authored-by: Cory Hall <43035978+corymhall@users.noreply.github.com>
@mrgrain mrgrain removed the pr/do-not-merge This PR should not be merged at this time. label Nov 16, 2022
@mergify
Copy link
Contributor

mergify bot commented Nov 16, 2022

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: aa4603d
  • 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 5b3d06d into aws:main Nov 16, 2022
@mergify
Copy link
Contributor

mergify bot commented Nov 16, 2022

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

agusti-t pushed a commit to agusti-t/aws-cdk that referenced this pull request Nov 22, 2022
Previously we did not run diff Nested Stack templates separately. Any change would have been detected by the changed asset hash in the `AWS::CloudFormation::Stack` resource. With this change, nested templates are diff'ed as part of the integ test and any errors will be printed.

The change allows us to then ignore the asset hash in the s3 url for nested stacks if `diffAsset: false` (the default) is set. Previously this was the only way to detect changes in a nested stack. However the hash would also change if an asset inside the nested stack has changed (which should be ignored). With the change to diff nested stack templates, asset hashes in nested stack template are now transparently ignored.

----

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@mrgrain mrgrain deleted the mrgrain/feat/snapshot-nested-stacks branch July 26, 2023 10:50
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. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants