Skip to content
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

Hard-to-interpret messages when discussions are unresolved #363

Open
perlun opened this issue Dec 7, 2022 · 0 comments
Open

Hard-to-interpret messages when discussions are unresolved #363

perlun opened this issue Dec 7, 2022 · 0 comments

Comments

@perlun
Copy link

perlun commented Dec 7, 2022

I currently got this in an MR:

I couldn't merge this branch: had some issue with GitLab, check my logs...

Here's what it logged:

2022-12-07 13:19:09,142 INFO Ensuring MR !8929 is mergeable
2022-12-07 13:19:09,782 ERROR Unanticipated ApiError from GitLab on merge attempt
Traceback (most recent call last):
  File "/nix/store/0ljil4j1g16cr8i3f2viha9rdjhcvyb7-python3.6-marge-0.10.0/lib/python3.6/site-packages/marge/single_merge_job.py", line 88, in upda
te_merge_request_and_accept
    merge_when_pipeline_succeeds=bool(target_project.only_allow_merge_if_pipeline_succeeds),
  File "/nix/store/0ljil4j1g16cr8i3f2viha9rdjhcvyb7-python3.6-marge-0.10.0/lib/python3.6/site-packages/marge/merge_request.py", line 205, in accept
    sha=sha or self.sha,  # if provided, ensures what is merged is what we want (or fails)
  File "/nix/store/0ljil4j1g16cr8i3f2viha9rdjhcvyb7-python3.6-marge-0.10.0/lib/python3.6/site-packages/marge/gitlab.py", line 65, in call
    raise error(response.status_code, err_message)
marge.gitlab.Unprocessable: (422, {'message': 'Branch cannot be merged'})
2022-12-07 13:19:09,789 WARNING I couldn't merge this branch: had some issue with GitLab, check my logs...
2022-12-07 13:19:09,790 INFO Unassigning from MR !8929

The root cause

The root cause in this case was that I had an unresolved discussion in the MR, and we have our GitLab configured to require discussions to be resolved before merging. It's a silly mistake but it actually took me some time to figure this out this time... Perhaps we could make Marge-bot smarter by checking if all discussions are resolved before it attempts to merge. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant