Mergifyio / mergify

Mergify Community Issue Tracker
https://mergify.com
Apache License 2.0
319 stars 92 forks source link

Grant Mergify access to protected branches on GitHub #361

Closed cipher1024 closed 5 years ago

cipher1024 commented 5 years ago

My master branch is only accessible by the a small group of maintainers. This seems to block mergify from accepting pull requests. How can I give mergify rights to my master branch?

jd commented 5 years ago

Do you have an error message from Mergify? Feel free to reach support@mergify.io with your PR number (if it's private) so we can investigate.

cipher1024 commented 5 years ago

This PR is the first that I was able to merge with mergify: https://github.com/leanprover-community/mathlib/pull/831. It happened right after I removed branch protection.

I just put back branch protection and this one should be failing soon: https://github.com/leanprover-community/mathlib/pull/873

jd commented 5 years ago

Right, I did not understand you were using branch protections to do that. As far as I know, you can't use that — that's a GitHub limitation.

cipher1024 commented 5 years ago

Sorry for the confusion

cipher1024 commented 5 years ago

Here is the error that I get. Is this informative enough?

Screen Shot 2019-04-04 at 4 40 09 PM

cipher1024 commented 5 years ago

I mean, I don't want to merge that PR if it's going to remove the information that you guys need to fix the issue

jd commented 5 years ago

I'll let @sileht comment but I don't think we can fix this. If there's no way to add an application in a team or to give it permission in the branch protection settings, there's nothing on our side we can do AFAICT.

cipher1024 commented 5 years ago

Possible work around: require a review from the file owners before merging and make the team of maintainers the owner of all files

sileht commented 5 years ago

The branch protection setting "Restrict who can push to matching branches" does not allow to put GithubApp. This is a Github Limitation. What ever you do, if this settings is ticked, Mergify can't work.

eli-jordan commented 5 years ago

What about using the api equivalent of clicking the “merge” button in the PR? This doesn’t require push permission

sileht commented 5 years ago

We use this API

eli-jordan commented 5 years ago

Ok. I assumed that wasn't used because I have used bulldozer in the past, and it works fine with protected branches.

sileht commented 5 years ago

Bulldozer needs to hardcore an usertoken : https://github.com/palantir/bulldozer/blob/develop/README.md#can-bulldozer-work-with-push-restrictions-on-branches

eli-jordan commented 5 years ago

Ah ok, that makes sense. I guess thats a bit easier with a self hosted bot :)

jd commented 5 years ago

This is now possible since GitHub implemented the feature: https://developer.github.com/changes/2019-09-05-apps-protected-branches-api/

Nothing to do on Mergify's side.