Skip merge request pipelines when the title has a skip CI directive

What does this MR do and why?

This makes [ci skip] and [skip ci] in a merge request title skip merge request pipelines consistently. With the default merge commit message, the title already skips merged results and merge train pipelines because the virtual commit message includes the title. Checking the title directly also covers basic pipelines, merge requests with conflicts, and custom merge_commit_template values that omit the title.

Adding the directive takes effect on the next pipeline for all merge request pipeline types. With merged results pipelines, pipelines can remain skipped after the directive is removed until the next push regenerates the merge ref commit. This pre-existing behavior is unchanged by this MR.

A follow-up could make the commit-message check ignore a directive inherited from the merged results virtual commit, as discussed in !232622 (comment 3280729075).

Agent context

The pipeline skip chain checks the merge request title with the existing commit-message pattern. The existing ignore_skip_ci option and pipeline execution policy override still gate all skip sources.

Merge train pipelines remain included because they receive the merge request in the pipeline command. A skipped merge train pipeline is not successful and removes the merge request from the train, so the title directive cannot bypass the train's pipeline requirement.

References

Screenshots or screen recordings

Before After
Not applicable Not applicable

How to set up and validate locally

Run:

bin/rspec spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb ee/spec/lib/ee/gitlab/ci/pipeline/chain/skip_spec.rb
bundle exec rubocop lib/gitlab/ci/pipeline/chain/skip.rb spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb ee/spec/lib/ee/gitlab/ci/pipeline/chain/skip_spec.rb

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Dmitry Gruzd

Merge request reports

Loading
Loading