Default MR target project is not consistent
Summary
Follow-up from "Add setting to change default MR target project": !58093 (comment 547516480)).
For forks, their current default target project when creating an MR varies depending on the project visibility difference between the fork and the upstream projects:
When creating a merge request, if the forked project’s visibility is more restrictive than the parent project (for example the fork is private, the parent is public), the target branch defaults to the forked project’s default branch. This prevents potentially exposing the private code of the forked project. — https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html#merging-upstream
Furthermore, in !58093 (merged) we're adding a setting to change the default MR target project for fork projects.
The problem is that the default target project is not the same for all possible paths of creating an MR. For example, when the “Upstream project” is the expected value, there are different behaviors:
- Via the “You pushed to…” banner, the target project is the upstream project.
- Via the merge request list, the target project is the upstream project.
- Via the Web IDE, the target project is the upstream project.
-
🐛 Via the single-file editor, the target project is this project. -
🐛 Via the branches page, the target project is this project. -
🐛 Via the branch "history" page, the target project is this project. -
🐛 Via the Compare page, the target project is this project. -
🐛 Via the URL outputted in the CLI when you push from a local machine, the target project is this project.
Steps to reproduce
- Fork a project.
- Attempt to create merge requests from the fork through the paths described above.
- Notice the different default target project varies.
What is the current bug behavior?
Different paths to create an MR return a different default target project. Some of them do not respect the project setting or the visibility smart default.
What is the expected correct behavior?
All paths to create an MR should return the same default target project. All of them should respect the project setting and the visibility smart default.
Output of checks
This bug happens on GitLab.com