Skip to content

gitlab-ci: fix merge request pipelines

Linus Lüssing requested to merge tux/site-ffhl:pr-fix-merge-pipeline into master
By default merge requests are not added to pipelines:

  https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html
  -> "Merge request pipelines: **Do not run by default.**

Adding a "rules" attribute to a job does add it to a merge request
pipeline:

  https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#use-rules-to-add-jobs
  -> "Use the rules keyword to configure jobs to run in merge request pipelines."

However this does **not** automatically also add any dependency jobs
listed in "needs" to the merge request pipeline...

One way to fix this would be to add a "rules" attribute to all jobs.
Another option is to redefine the "workflow".

Let's use the example specified here:

  https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines

Which is supposed to have less duplicate pipeline executions, compared
to always running pipelines (if I understand correctly).

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Edited by Linus Lüssing

Merge request reports