-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add new "mergeable" apply requirement #43
Comments
This will be especially useful for scenarios where we want to allow direct applies for lower environments but still want strict approvals for production environments. |
As an alternative to explicitly supporting (and tracking) all the possible permutations of settings, could the condition simply be "branch can be merged"? That way GitHub will do the hard work and the status will be obvious from the PR itself. |
@matthiasr thank you! That's a great idea. I just tested it out and the field The only tricky thing is that some people were asking me to have Atlantis set a status on the pull request to "not passing" until any pending apply's are applied. This would prevent the PR from being merged until the apply is complete. This would need to be configurable of course. If people wanted both, we'd have to do something like checking if all the statuses were passing except for our special "pending apply's" status and then enable the apply. |
From a security perspective I don't that proposed shortcut makes sense. An attacker gaining access to a Github account with admin capabilities could simply turn off all the branch protection features and the PR state will become passing. IMO Atlantis should verify that all the branch protection features are enabled before running |
How does Atlantis know which features are desired/required to be enabled? |
(My reading of the issue was that this is about checking which branch protections are set in GitHub and honoring them, not about enforcing that certain protections are set) |
In order to be able to enforce that e.g. a change gets approval from a second person before being applied, these two things can't be separated. Atlantis would need to be configured (via flags or protected |
@grobie true it does pose a risk and I agree we could make it harder for an attacker but at the end of the day if someone is an admin in github they probably also have access to the other repo that would generate the server side |
Github has support for requiring multiple approvals now (but doesn't change what most of this discussion is about). |
We we prefer to implement this by adding a new flag or by modifying the existing logic of --require-approval |
I can see it both ways, technically I think they should be two separate options as there are other branch protections in play such as repo not being up to date, signed commits, etc. Only downside I can see of this is if someone specified say |
Another question arrises as this implementation is github specific if someone specified |
From what I recall gitlab also has it, I could be wrong though. |
If anyone wants to test #385 and provide any feedback, that would be great :) |
Introduce new `mergeable` requirement, in similar vein to the `approved` requirement. Ran `make go-generate` to update mocks accordingly. This addresses issue runatlantis#43.
Thursday Nov 30, 2017 at 06:54 GMT
Migrated from hootsuite/atlantis#210
Why was it migrated?
GitHub has lots of branch protections that we could support in Atlantis by requiring them to "pass" before we allow apply's. Right now you can specify
--require-approval
but this only looks for an approval, not necessarily the type of approval specified in the branch protections.apply
The text was updated successfully, but these errors were encountered: