Improve pipelines for community, fork, docs MRs
What does this MR do?
Too many jobs are running in community and fork MRs, which should only run in the main runner projects. For example, from this fork: https://gitlab.com/gitlab-com/localization/tech-docs-forked-projects/prod/gitlab-runner/-/pipelines/1817565713
We should make use of .rules:merge_request_pipelines:no_docs:no-community-mr
to prevent a wide range of jobs from running in forks. In essence, we should only run code tests in community/fork projects. We shouldn't be building images and packages, and we shouldn't be running jobs that use special runners like (tags:
) .instance-2xlarge: saas-linux-2xlarge-amd64
.
When contributors submit MRs to the main canonical repo (here), we can run the full suite of jobs for them. This saves resources for both us and them.
Additionally, the docs jobs are set to run in all MR pipelines, rather than when docs are changed, so we should make it explicit that those jobs run when docs are changed. We can then use the same pattern to do the same for the i18n
job, so it only runs with localized (translated) docs are changed too. All docs jobs can run immediately with needs: []
as well, they don't have any dependencies on earlier jobs.
Why was this MR needed?
Pipelines in forks often fail due to extra jobs that run that shouldn't be running, for example the Binaries
job that many other jobs depend on but should not run in forks: https://gitlab.com/gitlab-com/localization/tech-docs-forked-projects/prod/gitlab-runner/-/pipelines/1824101563
You can also see in the GitLab-managed community forks, that all code pipelines are failing across the board, due to the binaries
job: https://gitlab.com/gitlab-community/gitlab-org/gitlab-runner/-/pipelines
What's the best way to test this MR?
This pipeline is tested in this fork project MR: https://gitlab.com/gitlab-com/localization/tech-docs-forked-projects/prod/gitlab-runner/-/pipelines/1824370409