Skip to content

Fork relationship is not respected for certain projects

Patched Versions

This was fixed in GitLab Versions 14.10 and 15.0

Summary

Community contributors have reported that they are unable to submit merge requests to https://gitlab.com/gitlab-org/ci-cd/custom-executor-drivers/fargate. Creating a new merge request will target master on the forked project instead of the upstream project, even if the upstream project is explicitly selected as the target.

Reproducing: Screen_Recording_2022-04-10_at_11.12.19_AM

Project settings: Screen_Shot_2022-04-10_at_11.11.55_AM

Interestingly, I cannot reproduce this when logged in as bwill. However, I can reproduce it if I create a new account on GitLab.com. I suspect that this is only reproducible by users who are not members of gitlab-org.

Steps to reproduce

  1. Login as a user who is not a member of gitlab-org.
  2. Go to https://gitlab.com/gitlab-org/ci-cd/custom-executor-drivers/fargate and click the fork button
  3. Make a change in your project and commit it to a new branch
  4. Go to https://gitlab.com/<your_project_path>/-/merge_requests/new?merge_request%5Bsource_branch%5D=<your_branch_name>, or create a merge request from your branch using and of the Create merge request buttons
  5. Observe that your merge requests targets master of the current project instead of the upstream project
  6. Attempting to use Change branches does not allow you to target the upstream project

Example Project

https://gitlab.com/bwill-test/fargate

What is the current bug behavior?

/-/merge_requests/new ignores the merge_request[target_project_id] parameter and still targets the current project

What is the expected correct behavior?

/-/merge_requests/new should respect the fork relationship and target the upstream project

Output of checks

This bug happens on gitlab.com

Possible fixes

Issue most likely lies in Projects::MergeRequests::CreationsController

Edited by Kai Armstrong