Target public upstream GitLab/GitHub repository from private GitLab merge request
Organizations that use GitLab for their internal projects often consume open source projects hosted on GitHub. If developers want to contribute features or bug fixes upstream, it is often important for the change to be reviewed and approved internally by the organization before being shared upstream. We should provide a workflow that allows teams in private GitLab instances to be able to privately improve open source projects and then contribute them upstream to public GitLab and GitHub instances.
In this scenario, there are essentially two merge requests in play:
- the private internal merge request on the private fork
- the public external merge request on the upstream project
Additionally there are three repositories in play:
- upstream project (e.g. on GitHub)
- public fork (on the same instance as upstream)
- private fork (on a private GitLab instance)
Proposal
- Create project on private GitLab instance (existing), probably with pull mirroring enabled
- Development happens locally and a merge request is created (existing)
- Option available in the merge request to make the target of the merge request an External repository
- this would require authentication via OAuth or Token to the upstream instance, and selecting a public fork
- The merge button is replaced by a Publish button which will publish the merge request upstream
- this button would only be available to Masters
- the first time the publish button is clicked the publisher will be able to provide a public merge request description
- the publish button will push the commits to the public upstream fork, and open the merge request on the upstream project
- Prior to the merge request being published, the merge request can be closed locally using normal permissions
- Once the merge request is published, the merge request status will be controlled by the upstream merge request
- if it is merged upstream, it will be marked as merged in GitLab
- it it is closed upstream, it will be marked as closed in GitLab