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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Allow making successful run of terraform apply a statues check on GitHub #4140

Open
1 task done
brandon-fryslie opened this issue Jan 11, 2024 · 0 comments
Open
1 task done
Labels
feature New functionality/enhancement

Comments

@brandon-fryslie
Copy link

brandon-fryslie commented Jan 11, 2024

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Describe the user story

As a DevOps/platform engineer, I'd like to have a tool that automatically runs terraform apply against my PRs. The tool will set a "status check" on the PR that will only be set to "success" when terraform apply has been run successfully. Atlantis currently has a similar feature, but it doesn't require terraform apply to run before it is set to successful so I find the naming somewhat confusing.

Right now I don't see any way to configure Atlantis to require running terraform apply before the status check is marked as "successful". That would be really killer functionality that would seemingly allow a lot of really cool workflows.
Describe the solution you'd like

This would be especially powerful when combined with the "mergability requirements" feature in github. You could even in theory have a setup where Atlantis changes must be deployed before the PR could be merged.!

I would like to be able to configure Atlantis to require that terraform apply has run before a similarly named status check was marked as successful. Right now there is a check called apply but if you look at the code it does not actually require that terraform apply has ever run. I suspect its an unused legacy status because of the limited utility. I couldn't imagine depending on it for anything important since it can be marked as a success based on the result of plan or even a failure to run plan. This new check should be set from only one place - after terraform plan has run. I would possibly rename the old check to something like ur good brah or send it. Then add a new status check called apply.

What I think would be useful is this status check would be configured in a way that it's only set to "successful" when Atlantis has run a successful terraform apply. That might confusing so I can elaborate. Running plan should not set it to "success". Failing to find any changes should not set it to "success", nor should failing to run any hook, query any data, generate a config file, or any other action or inaction beyond "successful execution of terraform apply.

Describe the drawbacks of your solution

It does make sending it a bit more gnar (bad gnar not good gnar). Sometimes you'll have to type various commands several times before a PR would be ready for merge. It might slow down some teams' workflows, especially if they heavily depend on optimism as a testing strategy.

Describe alternatives you've considered

I considered naming it really apply, super apply, yes this actually ran your changes, it would be crazy to just skip the apply process entirely and even plan (it would be the ultimate ironic twist).

But ultimately I went with the simple apply. Considering the terraform command is apply, and the altantis command is apply, I think having the new status check named apply would be a good indicator to users that terraform apply has run. This would require renaming the old legacy check, but since it can be set to "success" whether an apply has run or not, I think the new one will actually be more useful.

@brandon-fryslie brandon-fryslie added the feature New functionality/enhancement label Jan 11, 2024
@brandon-fryslie brandon-fryslie changed the title Add the ability to require running Atlantis apply before marking status check as approved FEAT: Allow making successful run of terraform apply a statues check on GitHub Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement
Projects
None yet
Development

No branches or pull requests

1 participant