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

plan_requirements (similar to apply_requirements) #2073

Closed
jbg opened this issue Feb 17, 2022 · 5 comments 路 Fixed by #2979
Closed

plan_requirements (similar to apply_requirements) #2073

jbg opened this issue Feb 17, 2022 · 5 comments 路 Fixed by #2979
Labels
feature New functionality/enhancement
Milestone

Comments

@jbg
Copy link

jbg commented Feb 17, 2022

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.

"apply_requirements": ["mergeable"] (with appropriate branch protection settings) is great for preventing accidental applying of a plan generated based on a branch that isn't up-to-date with changes in master. However, we still waste time and resources on planning those branches. Since the apply requirements prevent the plan from being applied without merging/rebasing the base branch, and since that merge/rebase will cause a new plan to be generated, running a plan before the merge/rebase is done serves no purpose.

It would be great if there was a way to make atlantis refuse to run a plan if the branch is not up-to-date with all changes from the base branch. This way, we don't have locks held unnecessarily, for plans that can never be applied anyway, blocking other work from progressing.

@jbg jbg added the bug Something isn't working label Feb 17, 2022
@Skeen
Copy link
Contributor

Skeen commented Mar 10, 2022

We are also very interested in plan_requirements, but from a different perspective, namely security.

As described here: https://www.runatlantis.io/docs/security.html#protect-terraform-planning, planning involves security risks similar to applying (i.e. by simply local-execing credentials to a sniffer-site). Thus apply_requirements do not cover all security bases, and it would make sense to be able to apply the same policies for planning and application.

@jamengual jamengual added feature New functionality/enhancement and removed bug Something isn't working labels Aug 26, 2022
@nitrocode
Copy link
Member

While not directly related to this, one of our passionate contributions has been working on atlantis import subcommand and has introduced import_requirements.

For anything interested in contributing plan_requirements, please see the PR #2783. It might be an easy, straight forward change.

@hanpeter
Copy link

It looks like this is implemented in #2979 and scheduled to be released with v0.23.0.

Unfortunately, the documentation was updated at the same time. So, it falsely appears to be available already.

@nitrocode
Copy link
Member

@hanpeter feel free to contribute a pr to say that it will be available in the upcoming release.

You can also use the dev tagged image to test out the feature before the release. We encourage users to do this in order to find any bugs sooner.

@douglascayers
Copy link
Contributor

douglascayers commented Jan 29, 2023

It looks like this is implemented in #2979 and scheduled to be released with v0.23.0.

Unfortunately, the documentation was updated at the same time. So, it falsely appears to be available already.

@hanpeter I thought I was going crazy tonight 馃槅

This is my first venture into Atlantis and I'm using the ghcr.io/runatlantis/atlantis:v0.22.3 docker image (because at the time of writing it's tagged as the latest release), and per the docs I included the following config but on startup the server kept complaining that plan_requirements wasn't part of the schema. A real head scratcher until I found this comment thread. Thanks!

repos:
- id: /.*/
  plan_requirements: [undiverged]
  apply_requirements: [approved, mergeable, undiverged]
  import_requirements: [approved, mergeable, undiverged]

Per @nitrocode's comment, changing my dockerfile to pull from dev tag allowed the server to parse the config and start.

That's as far as I've gotten on this journey... getting it started. No idea if the rest of it works 馃槅

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

Successfully merging a pull request may close this issue.

6 participants