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

fix(cli): diff against multiple stacks do not always fail if any have a diff #7690

Merged
merged 6 commits into from
Jul 14, 2020

Conversation

polothy
Copy link
Contributor

@polothy polothy commented Apr 29, 2020

Commit Message

Currently, the diff command only remembers if there are any diffs
with the last stack that was diffed. So, if all of your stacks have
a diff except for the last one, the diff command would exit
successfully even if told to fail on diff.

This fix corrects the behavior so that if any of the stacks have
a diff, then the exit code would be non-zero if configured to do so.

fixes #7492

End Commit Message


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

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.

thanks for putting this fix together! I think we should also add an integ test here. We recently converted the integ tests to be in jest, so it should be a bit easier to add one now.

packages/aws-cdk/test/diff.test.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed shivlaks’s stale review May 26, 2020 17:17

Pull request has been modified.

polothy and others added 2 commits May 26, 2020 10:17
Currently, the diff command only remembers if there are any diffs
with the last stack that was diffed. So, if all of your stacks have
a diff except for the last one, the diff command would exit
successfully even if told to fail on diff.

This fix corrects the behavior so that if any of the stacks have
a diff, then the exit code would be non-zero if configured to do so.

fixes aws#7492
Co-authored-by: Shiv Lakshminarayan <[email protected]>
@polothy
Copy link
Contributor Author

polothy commented May 26, 2020

Rebased the PR

@polothy
Copy link
Contributor Author

polothy commented May 26, 2020

I think we should also add an integ test here. We recently converted the integ tests to be in jest, so it should be a bit easier to add one now.

That might be a little tricky for me. I don't feel comfortable running integration tests against my work AWS account. Feel like I got lucky getting unit tests working and figured out hah

@shivlaks are you interesting in writing the integration test?

@shivlaks
Copy link
Contributor

@polothy sure thing, I'll see if I can pick that up later this week and bring this one home

@polothy
Copy link
Contributor Author

polothy commented May 26, 2020

Thanks for the assist and for the review!

@polothy
Copy link
Contributor Author

polothy commented Jun 12, 2020

@shivlaks any chance we can get this going again? 😄

@shivlaks
Copy link
Contributor

@polothy thanks for the gentle prod - writing up that integ test this week

@polothy
Copy link
Contributor Author

polothy commented Jul 13, 2020

@shivlaks wondering if we can just merge as is? I'm not really seeing the advantage of integration test, because it isn't a problem with the diffing mechanism, just the flag for keeping track of changes over X stacks.

@shivlaks
Copy link
Contributor

@polothy i'll try to get it in ahead of the next release. i'm less worried about the integ test for this specific change, but would like it to be there to prevent a regression in the future.

@polothy
Copy link
Contributor Author

polothy commented Jul 14, 2020

i'll try to get it in ahead of the next release.

❤️

i'm less worried about the integ test for this specific change, but would like it to be there to prevent a regression in the future.

Ah, gotchya.

Thanks again for commenting back and helping!

@shivlaks shivlaks changed the title fix(cli): diff against multiple stacks should fail if any have a diff fix(cli): diff against multiple stacks do not always fail if any have a diff Jul 14, 2020
@mergify
Copy link
Contributor

mergify bot commented Jul 14, 2020

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
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 5f462fc
  • 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 Jul 14, 2020

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

@mergify mergify bot merged commit 85f4a83 into aws:master Jul 14, 2020
@polothy polothy deleted the fix-diff-exit branch July 14, 2020 22:55
@polothy
Copy link
Contributor Author

polothy commented Jul 14, 2020

Yah! Thanks so much!

curtiseppel pushed a commit to curtiseppel/aws-cdk that referenced this pull request Aug 11, 2020
… a diff (aws#7690)

### Commit Message
Currently, the diff command only remembers if there are any diffs
with the last stack that was diffed. So, if all of your stacks have
a diff except for the last one, the diff command would exit
successfully even if told to fail on diff.

This fix corrects the behavior so that if any of the stacks have
a diff, then the exit code would be non-zero if configured to do so.

fixes aws#7492
### End Commit Message

----

*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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CDK diff against multiple stacks does not fail
3 participants