Running pipelines on MRs from forks
Summary
We want to be able to manually run the CI to test and merge MRs that are created from a fork of the GROMACS repo.
Use cases
Several times we had an MR from an external contributor, we had to add them to the GROMACS project and ask them to create a new MR or do it ourselves:
- !2248 (closed)
- !1909 (closed)
- !125 (closed)
- !1532 (closed)
- !1119 (closed)
- !1034 (closed)
- !558 (closed)
- !376 (closed)
- !152 (closed)
Impact
It will make external contributions more straightforward.
It will also avoid us having to add external, often one-off, contributors to GROMACS project, thus slightly improving the security.
Detailed description
We occasionally have MRs from external contributors. Since they can not push a branch to the main GROMACS repo, they create an MR from their fork.
GitLab does not automatically run pipelines on forks, to avoid abuse of the CI infrastructure.
But we want to be able to manually trigger CI runs, and be able to merge such MRs.
Currently, we have to add the contributor to the GROMACS project and ask them to push their branch there and create a new MR.
Apparently, GitLab supports it: https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#run-pipelines-in-the-parent-project-for-merge-requests-from-a-forked-project
But for some reason, we don't have the "Pipelines" tab in the external MRs, so no way to do what the documentation suggests:
Parent project members with at least the Developer role can create pipelines in the parent project for merge requests from a forked project. In the merge request, go to the Pipelines tab and select Run pipeline.