You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem, including code/CLI snippet
Hello,
We recently upgraded to GitLab v16.1.5-ee and since then when running the code (using the python-gitlab client) to merge a merge request, we have been getting some erratic behavior.
The merge() function has been failing with the following errors
422: Branch cannot be merged
405: Method not allowed.
Sometimes the function works and the merge request gets merged.
Every other functionality including creating merge requests, creating groups, projects, performing commits etc. are working.
Code Snippet
merge_request = project.mergerequests.create({
'source_branch': 'test',
'target_branch': 'main',
'title': 'Merge Test to Main',
'description': 'Merge request from test branch to main branch'
})
time.sleep(2)
merge_request.merge()
Expected Behavior
Merge request should get merged every time.
Actual Behavior
Getting 422 or 405 errors.
Rarely, the merge request gets merged too.
I doubt this is an issue with python-gitlab. python-gitlab is just a simple wrapper around the API. It doesn't do much but send the API to the GitLab instance.
Of course it could be an issue with python-gitlab but I doubt it.
You might try doing gl.enable_debug() to enable debug output and see the HTTP requests.
You should probably always refresh and check the merge_status of a merge request before the merge operation. At work I've seen this issue with multiple tools dealing with the merge request API, not just python-gitlab.
Description of the problem, including code/CLI snippet
Hello,
We recently upgraded to GitLab v16.1.5-ee and since then when running the code (using the python-gitlab client) to merge a merge request, we have been getting some erratic behavior.
The merge() function has been failing with the following errors
Sometimes the function works and the merge request gets merged.
Every other functionality including creating merge requests, creating groups, projects, performing commits etc. are working.
Code Snippet
Expected Behavior
Merge request should get merged every time.
Actual Behavior
Getting 422 or 405 errors.
Rarely, the merge request gets merged too.
Specifications
The text was updated successfully, but these errors were encountered: