palantir / bulldozer

GitHub Pull Request Auto-Merge Bot
Apache License 2.0
745 stars 100 forks source link

Unable to merge due to branch protection rules #420

Closed Thakurvaibhav closed 10 months ago

Thakurvaibhav commented 1 year ago

Hi, I have a private github repo where branch protection rule is added but not enforced because of the Github Account type. As a result I see the following in bulldozer logs:

{"level":"error","rid":"chqdvmet7i7ekld2qv80","github_event_type":"status","github_delivery_id":"b1a2cca6-fe45-11ed-8818-4c1ef5247935","github_installation_id":37770602,"github_repository_owner":"my-org","github_repository_name":"my-repo","github_pr_num":856,"error":"unable to determine merge status: failed to determine required Github status checks for merge: cannot get branch protection for my-org/my-repo#856: GET https://api.github.com/repos/my-org/my-repo/branches/master/protection: 403 Upgrade to GitHub Pro or make this repository public to enable this feature. []\ngithub.com/palantir/bulldozer/pull.(*GithubContext).loadBranchProtection\n\t/home/runner/work/bulldozer/bulldozer/pull/github_context.go:197\ngithub.com/palantir/bulldozer/pull.(*GithubContext).RequiredStatuses\n\t/home/runner/work/bulldozer/bulldozer/pull/github_context.go:168\ngithub.com/palantir/bulldozer/bulldozer.ShouldMergePR\n\t/home/runner/work/bulldozer/bulldozer/bulldozer/evaluate.go:130\ngithub.com/palantir/bulldozer/server/handler.(*Base).ProcessPullRequest\n\t/home/runner/work/bulldozer/bulldozer/server/handler/base.go:80\ngithub.com/palantir/bulldozer/server/handler.(*Status).Handle\n\t/home/runner/work/bulldozer/bulldozer/server/handler/status.go:92\ngithub.com/palantir/go-githubapp/githubapp.Dispatch.Execute\n\t/home/runner/work/bulldozer/bulldozer/vendor/github.com/palantir/go-githubapp/githubapp/scheduler.go:55\ngithub.com/palantir/go-githubapp/githubapp.(*scheduler).safeExecute\n\t/home/runner/work/bulldozer/bulldozer/vendor/github.com/palantir/go-githubapp/githubapp/scheduler.go:183\ngithub.com/palantir/go-githubapp/githubapp.QueueAsyncScheduler.func1\n\t/home/runner/work/bulldozer/bulldozer/vendor/github.com/palantir/go-githubapp/githubapp/scheduler.go:257\nruntime.goexit\n\t/opt/hostedtoolcache/go/1.19.3/x64/src/runtime/asm_amd64.s:1594","time":"2023-05-29T17:24:42.145195837Z","message":"Error processing pull request"}

Are there any workarounds to this?

Bulldozer Version: 1.17.0

asvoboda commented 10 months ago

Sorry for not answering this earlier. That error message looks like a problem with your subscription settings rather than something with bulldozer.

"error":"unable to determine merge status: failed to determine required Github status checks for merge: cannot get branch protection for my-org/my-repo#856: GET https://api.github.com/repos/my-org/my-repo/branches/master/protection: 403 Upgrade to GitHub Pro or make this repository public to enable this feature.