BonnyCI / projman

A project management repository -- meta
0 stars 2 forks source link

Zuul Integration is unable to merge changes #222

Closed jesusaurus closed 7 years ago

jesusaurus commented 7 years ago

BonnyCI/hoist#348 is failing to merge after the gate jobs finish.

The zuul server log shows:

2017-04-18 17:54:21,599 ERROR zuul.DependentPipelineManager: Exception while reporting:
Traceback (most recent call last):
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/zuul/scheduler.py", line 1806, in _reportItem
    ret = self.sendReport(actions, self.pipeline.source, item)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/zuul/scheduler.py", line 1333, in sendReport
    ret = reporter.report(source, self.pipeline, item)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/zuul/reporter/github.py", line 60, in report
    self.mergePull(item)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/zuul/reporter/github.py", line 116, in mergePull
    sha)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/tenacity/__init__.py", line 86, in wrapped_f
    return r.call(f, *args, **kw)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/tenacity/__init__.py", line 234, in call
    do = self.iter(result=result, exc_info=exc_info)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/tenacity/__init__.py", line 205, in iter
    six.raise_from(RetryError(fut), fut.exception())
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/six.py", line 718, in raise_from
    raise value
RetryError: RetryError[<Future at 0x7f22ac0b9550 state=finished raised MergeFailure>]
2017-04-18 17:54:21,599 ERROR zuul.DependentPipelineManager: Exception while reporting:
Traceback (most recent call last):
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/zuul/scheduler.py", line 1806, in _reportItem
    ret = self.sendReport(actions, self.pipeline.source, item)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/zuul/scheduler.py", line 1333, in sendReport
    ret = reporter.report(source, self.pipeline, item)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/zuul/reporter/github.py", line 60, in report
    self.mergePull(item)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/zuul/reporter/github.py", line 116, in mergePull
    sha)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/tenacity/__init__.py", line 86, in wrapped_f
    return r.call(f, *args, **kw)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/tenacity/__init__.py", line 234, in call
    do = self.iter(result=result, exc_info=exc_info)
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/tenacity/__init__.py", line 205, in iter
    six.raise_from(RetryError(fut), fut.exception())
  File "/opt/venvs/zuul/local/lib/python2.7/site-packages/six.py", line 718, in raise_from
    raise value
RetryError: RetryError[<Future at 0x7f22ac0b9550 state=finished raised MergeFailure>]

And the related server-requests log leading up to that shows:

2017-04-18 17:54:19,987 DEBUG requests.packages.urllib3.connectionpool: https://api.github.com:443 "GET /rate_limit HTTP/1.1" 200 None
2017-04-18 17:54:20,180 DEBUG requests.packages.urllib3.connectionpool: https://api.github.com:443 "GET /repos/BonnyCI/hoist/pulls/348 HTTP/1.1" 200 None
2017-04-18 17:54:20,702 DEBUG requests.packages.urllib3.connectionpool: https://api.github.com:443 "PUT /repos/BonnyCI/hoist/pulls/348/merge HTTP/1.1" 405 226
2017-04-18 17:54:21,113 DEBUG requests.packages.urllib3.connectionpool: https://api.github.com:443 "PUT /repos/BonnyCI/hoist/pulls/348/merge HTTP/1.1" 405 226
2017-04-18 17:54:21,587 DEBUG requests.packages.urllib3.connectionpool: Resetting dropped connection: api.github.com
2017-04-18 17:54:21,598 DEBUG requests.packages.urllib3.connectionpool: https://api.github.com:443 "PUT /repos/BonnyCI/hoist/pulls/348/merge HTTP/1.1" 405 226
jesusaurus commented 7 years ago

According to the docs that 405 response means the merge could not be performed.

jesusaurus commented 7 years ago

The integration permissions page is somewhat cryptic, but it looks like pull request access gives read access to the merge endpoint, and repository contents permission give write access to the merge endpoint.

gandelman-a commented 7 years ago

Yep, looks like a permission issue on the repo. The actual response msg from github on the merge attempt is:

MergeFailure: Merge was not successful due to mergeability conflict, original error is 405 You're not authorized to push to this branch. Visit https://help.github.com/articles/about-protected-branches/ for more information.

jesusaurus commented 7 years ago

Unchecking Restrict who can push to this branch from the branch protections allowed the integration to merge the change.