Editing an open Merge Request results in expected changes to code owners not being applied
Summary
If you edit an existing merge request from a source branch to a target branch (e.g. master to developer) and change it so it is merging from the same source branch but to a different target branch and then save. Then the changes are not reflected in the "code owners" and in the count within the "changes" tab.
Steps to reproduce
- Create a GitLab SaaS project and add three branches to the repo (e.g. master, developer, 6.0.0)
- Add two files (for the purpose of demonstration, e.g. ListLength.py and factornumber.py) to the repo.
- Add two different "code owners" for each file
- Ensure that the branches are all merged/synched from master
- Commit a single line change to file "factornumber.py" on branch 6.0.0 and commit the same change to the same file on the master branch so that they are the same.
- On the master branch commit a single file change to file "ListLength.py".
- Create an MR from branch master to developer, note there are two code owners one for each python file where changes have occurred, as shown below:
- Note that the changes being applied to both files
- Do not complete the merge, instead “Edit” the MR and change merge request from master to branch 6.0.0
- Now note that even though only one file will now be updated “ListLength.py” that the code owner of “factornumber.py” is still highlighted.
- Also, note that the “Changes” tab is showing 2 changes even though only one change is performed:
Example Project
https://gitlab.com/gitlab-gold/johnlyttle/code-owner-test
What is the current bug behavior?
When editing the Merge Request it should only display the "code owner" of the file "ListLength.py" as this is the only file being updated. The "changes" tab should display a count of 1 instead of 2 as only 1 change is being merged.
What is the expected correct behavior?
When the edited MR is updated, it should reflect the correct status of "code owners" and "changes"
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com --> GitLab Enterprise Edition 14.5.0-pre 1024c08f