-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Mergify & Branch Protection #312
Comments
@sileht will correct me if I'm wrong, but the only status check that Mergify reports is its summary (with more details available in the Checks tab). IIUC you want to update your branch protection to allow merging only if Mergify says "OK" on a rule? I don't think that's doable right now, but maybe it'd be doable if Mergify was reporting some rules as independent status checks. @sileht would have more insight on the doability of this. |
@jd I'm actually just looking for something simpler than that – looking for a single Mergify status check that is applied whenever Mergify determines that all conditions have passed. Something that Mergify always uses, whether it's going to automatically merge the PR, or whether there's a Mergify configuration update (and thus Mergify won't actually merge that PR). This single status check could then effectively become the one and only requirement to use in the GitHub branch protections, meaning that Mergify is the single source of truth for whether a PR is mergeable or not. I'm having trouble determining whether there exists such a status code now (or whether it would need to be added) because looking at past PR's it looks like none of the Mergify status checks show in the checks details. I feel like I may have seen such a status check come in while watching the progress of a PR, however, so maybe it already exists? |
Mergify always asks and trust behind about the mergeable state of a PR. If branch protections are in place, then the PR is reported as being Now, the problem is that often GitHub is out-of-sync. That means:
|
We have a similar use case. I have an auto merge rule for "regular" pull requests, needing 2 reviews. Then a second rule which matches a group of "trusted" contributors that need only 1 review to merge. Now, GitHub branch protection used to be set to 2, which makes mergify fail on the "1 review" rule. So I lower the branch protection to 1 review. Mergify works. However, now when a PR is submitted from a non-trusted user, a reviewer is able to approve and merge. (since a reviewer needs write access, he is able to do so). The V1 mergify engine was working on branch protection by setting If |
Also tried to set |
@muhlemmer, the @jd the issue you describe above, while frustrating, is a little bit different from what we're describing here. Just looking for a status check that represents Mergify's understanding of whether or not a PR is mergeable. What would it take to get a status check like that added? It seems like it wouldn't be too hard given that V1 had it? |
@edahlseng I think that's what @sileht's doing in #324 |
@jd interesting, that looks close, except for the note in the documentation that says:
Are there any status that can be used in the GitHub Branch Protection? |
For the legacy #324 or the legacy "mergify/pr" have never worked within the GitHub Branch Protection, it's not 100% reliable because of two things:
Anyways, I clearly get the use-case and the value behind putting Mergify within the Github Branch Protection. I will continue to think about it, I have some remaining ideas to test, to workaround the lake of predictability of the |
Thanks for the explanation @sileht, that helps a lot! Let us know if there's anything we can help with from our end! |
@sileht, wanted to pick this one up again. Is there something that we could try in order to make this happen? If you can point me towards a preferred approach, I can put up a PR. |
Is there a single status check that Mergify applies to a PR every time it determines that it's ready to merge? (Including both of PRs that it will merge, as well as ones that are blocked due to configuration changes?)
Right now our GitHub branch protections are preventing Mergify from making some automated merges when there are no reviewers. Nevertheless, we still want to prevent merging on other PRs until the proper number of reviewers has reviewed. This is something that Mergify tracks really well.... Therefore, we'd like to update our GitHub status checks to use a single Mergify status check in order to confirm when a PR is ready to merge or not, making Mergify the single source of truth.
The text was updated successfully, but these errors were encountered: