Skip to content

Fix "Resolve conflicts" button not appearing for some users

Stan Hu requested to merge sh-fix-resolve-button-not-available into master

Previously the frontend assumed that the user had to be able to merge to that project in order to resolve conflicts. However, this is overly restrictive, as the user only has to be able to push to the source branch. In fact, appending the text /conflicts to the merge request would bring up the conflict resolution page.

This confusion happens when a project contains a protected branch that only allows maintainers to push. Users with Developer access no longer have permission to merge, but they still can create branches in that project.

To fix this issue, we now loosen the permission check for showing the "Resolve conflicts" button and only check for access to push to the source branch. This is consistent with what the backend does in MergeRequests::Conflicts::ListService#can_be_resolved_by?.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/47954

Edited by Stan Hu

Merge request reports