Docs - product feedback: Merge request pipelines change rules not working as expected
Hey !
I just encountered a strange situation, I'm trying to apply a changes rules for merge requests pipelines. Following this guide: https://docs.gitlab.com/14.10/ee/ci/jobs/job_control.html#use-onlychanges-with-merge-request-pipelines
I have a main project with this ci file content:
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
include:
- '/module/.gitlab-ci.yml'
- '/othermodule/.gitlab-ci.yml'
And two folders with ci files.
first folder is named 'module' with this content:
default:
interruptible: true
tags:
- docker
stages:
- build
build-module:
only:
refs:
- merge_requests
changes:
- module/**/*
stage: build
script:
- echo "Compiling the code..."
- echo "Compile complete."
second folder is name 'othermodule' and has a ci file with the content:
default:
interruptible: true
tags:
- docker
stages:
- build
build-anothermodule:
only:
refs:
- merge_requests
changes:
- othermodule/**/*
stage: build
script:
- echo "Compiling the code..."
- echo "Compile complete."
I am expecting, in a pipeline MR, that only a change in a folder will create a job for this folder, for example:
$> touch module/myfileinmodule.txt $> git push
By now, if I do the following, all jobs will be created, is this the expected behavior for changes rule in MR pipelines ? Thanks !
Edited by JBonifay