Closing a merge request can close a different merged request if it contains the same (or a subset of) commits.

Summary

One of our customers (internal) reported that one merge request can close others merged request without any actions.

Based on their description, this happens if two merge request contains the exact same commit. For example, we have two merge requests, "A" and "B". If the merge request "B" contains the exact same commits of merge request "A", then closing merge request "A" will result in GitLab also closing the merge request "B".

This also happens even if merge request "B" requires an approval.

As per my discussion with @phikai, this is a known behavior. However, pushing new commits in merge request "B" doesn't automatically re-open the merge request.

Steps to reproduce

  1. Create a new project.
  2. Create a new branch called branch-a.
  3. Push new commits to branch-a.
  4. Create a new branch called branch-b from branch-a.
  5. Create MRs for both branch.
  6. Merge the MR for branch-a.
  7. GitLab will automatically mark branch-b as Merged.
  8. Push new commits to branch-b.
  9. The MR for branch-b is not automatically re-opened.

Example Project

https://gitlab.com/jdasmarinas/merge-request-test/

What is the current bug behavior?

GitLab automatically closes other merge requests that contains the same commit. Pushing new commits will not automatically re-open the closed merge request.

What is the expected correct behavior?

GitLab should not automatically close merge requests even if it contains the same commit. It's possible that the user will push other changes for the MR.

If it's normal to automatically close the merge request, we have to make sure to automitcally re-open the merge request if new commits are pushed.

Output of checks

This bug happens on GitLab.com

Possible fixes