Allow users to merge from a forked repository
Release notes
Since 15.7, GitLab shows how far behind your fork's branch is from the upstream project's main branch. And in 15.8, we introduced a feature that lets you sync your fork's branch with the upstream project's main branch using the UI. In this release, we introduce a feature that lets you contribute back to the upstream project by creating an MR in the UI, when your branch in the fork is ahead of the upstream project.
Proposal
When the forked repository is has commits ahead of the upstream repository then show a button to create a merge request.
This action from the fork widget is targeting the upstream repository.
- Button takes the user to the page
/-/merge_requests/new#
- Source branch: current branch of the fork
- Target branch: default branch in upstream repository
- The dropdown allows the user to select an alternative branch
Flow
1. Create merge request | 2. Select repo and branch | 3. New merge request to upstream |
---|---|---|
![]() |
![]() |
![]() |
What about the existing banner for creating a merge request?
From #330243 (comment 1165780436)
I agree this might be obsolete. FWIW this is already present. If we would implement the UI as proposed, I suggest we also take away the notification/suggested action in the UI.
This banner appears when the user commits a new change to a branch. However if they merged this commit on the fork then the banner is not displayed. Also if the user closes the banner there is not clear way to create a new merge request that would help the user get the 2 commits ahead
into the upstream. The button on the fork widget brings that action closer to the user.
Availability and Testing
New E2E to merge from a forked repository to upstream via "Create merge request button" (gitlab-org/quality/quality-engineering/team-tasks#1669). Please assign a SET to review any MRs.