CI: Let a docs-only merge request skip the test jobs

Let a documentation-only merge request opt out of the test jobs, in the spirit of cppTango!1668 (merged).

Targets the mr-pipelines branch of !1042 (merged) and should be merged after it: the Only docs label is only visible to rules: in a merge request pipeline. GitLab retargets this MR to develop when !1042 (merged) is merged and its branch removed.

What

  • New reusable .only-docs rule: when: manual + allow_failure: true when the merge request carries the Only docs label, or its title or the tip commit message carries the case-sensitive marker [ONLY DOCS] (case-sensitive, so it is clear something magic is going on; the marker also covers a branch pipeline of a branch with no merge request). Tags, the default branch and the maintenance/* branches are excluded.
  • The rule is referenced by linux:test-source, which had no rules so far. This is the only heavy job that starts automatically: the wheels, the wheel tests and the pixi tests are manual already, and run-prek, linux:build-sdist and test-docs are exactly what a documentation change wants to see.
  • Skipped jobs are manual, not never, so any of them can still be started from the pipeline view.

The Only docs project label has been created.

Verified

  • With the label on the merge request and no marker anywhere, the five linux:test-source jobs are created as manual: pipeline 2805180382.
  • With [ONLY DOCS] in the commit message the same happens on a branch pipeline; without it the jobs run as before.

Follow-up

With merge request pipelines in place, rules:changes compares against the target branch, so this can become automatic (changes: [doc/**/*]) with the label kept as a manual override.

Edited by Yury Matveev

Merge request reports

Loading
Loading