Hi everyone,
I’m trying to create a skippable pipeline in a merge request and can’t seem to get it to work. With your help I’d like to figure out if it’s a bug or something I can improve. Thanks!
Problem to solve
We have multiple test pipelines running in case of creation/ modification of a merge request. We’d like to able to optionally skip some of them and still be able to merge. In order to achieve this we activate Skipped pipelines are considered successful
in the project settings. When creating the merge request however, the merge remains blocked if one of the test pipelines has been skipped. So the skipped pipeline setting seems to be ineffective.
Steps to reproduce
- Change project settings:
Settings → Merge requests → Merge checks → Pipelines must succeed → Skipped pipelines are considered successful - Set up
.gitlab-ci.yml
with two pipelines in thetest
stage that are triggered by merge request creation - Create merge request and skip one or both of the tests
- Merge request will insist that all pipelines need to run successfully
Configuration
This is a sample extract of .gitlab-ci.yml
configuration that reproduces the behavior:
image: docker:latest
stages:
- test
- publish
- deploy
.unittest:
stage: test
script:
- ./run_some_tests
unittest:
extends: .unittest
unittest_full:
extends: .unittest
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
variables:
ACTIVATE_EXTRA_TEST_OPTIONS: 1
publish_docker:
stage: publish
only:
- master
Versions
- GitLab.com
- Self-hosted Runners (v16.6.1)