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

Avoid unnecessary terraform plans for closed (unmerged) PRs #2294

Conversation

pbrumblay
Copy link
Contributor

@pbrumblay pbrumblay commented May 20, 2024

This change avoids unnecessary terraform plan operations.

When closing a PR without merging, the github workflow still kicks off and runs a terraform plan. This is a minor issue, but it surprised me. In this PR I've added a conditional check to avoid running unnecessary plans when a PR is discarded.

Checklist

I applicable, I acknowledge that I have:

  • Read the contributing guide
  • Ran terraform fmt on all modified files
  • Regenerated the relevant README.md files using tools/tfdoc.py
  • Made sure all relevant tests pass

Copy link

google-cla bot commented May 20, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@juliocc juliocc requested a review from ludoo May 20, 2024 22:23
Copy link
Collaborator

@ludoo ludoo left a comment

Choose a reason for hiding this comment

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

This is nice, thanks for addressing this!

Unfortunately, to work around Windows inabilty to support symlinks we've had to copy these templates in stages 0 and 1. Can you make sure the changes is applied there too?

@juliocc
Copy link
Collaborator

juliocc commented May 21, 2024

@ludoo does it make sense to try to replicate the same functionality in the gitlab workflow?

@pbrumblay
Copy link
Contributor Author

@lodoo - I've updated the other three files in stages 0 and 1 for this PR.

@ludoo
Copy link
Collaborator

ludoo commented May 21, 2024

@lodoo - I've updated the other three files in stages 0 and 1 for this PR.

Thanks!!! We will log an issue to trakc this for gitlab too, as Julio suggests. I'll put this on automerge so it should go in as soon as all tests pass.

@ludoo ludoo enabled auto-merge (squash) May 21, 2024 12:25
@ludoo
Copy link
Collaborator

ludoo commented May 21, 2024

Checks seem to be stuck for some reason...

@ludoo ludoo merged commit a04d63e into GoogleCloudPlatform:master May 21, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants