Behavior of multiple merge requests containing same changes
Issue Presented
When a merge request has commits that are merged via another merge request (same destination branch but different source branches) both the first and 2nd merge request are closed out as "merged"
Steps to replicate
- Create repo with single file. Put content in that file.
- Create second branch and edit that file.
- Edit the file in master branch so that it conflicts with changes made in step 2 (I simply edited a single line on both step 2 and 3)
- Push and create MR for branch in step 2.
- Locally resolve conflicts between branches and push them to the branch.
- Do not merge the MR, instead, create a 3rd branch with the conflicts resolved and push that to repo.
- Create new MR with 3rd branch as source. Merge 3rd branch
The first merge request is not actually merged. Just the commits it has were merged. While it is somewhat valid to mark this as "merged" it can be misleading or confusing. This becomes more visible when approvals are needed. The 2nd merge request will get proper approvals and merged. But the first one will close without approvals as "merged".
Intended users
All Users
Further details
If someone is monitoring merge requests for tracking, audit, etc the first merge request will show as merged when it was in fact not actually merged.
Proposal
To resolve this, we could simply leave the 1st merge request open. Another, and more likely preferred, the option is to set the merge request closed, and somehow link back to the second merge request that actually merged the code. While you can currently trace back via the commit, it's not entirely clear.