conditional job causes an unwanted and broken merge request pipeline
Summary
When a job contains rules, it will cause an merge pipeline to be spawned.
Steps to reproduce
-
Create a repository with a
.gitlab-ci.ymlfile:# build job creates artifact build: script: - echo "Jussomething" > artifact.txt artifacts: paths: - artifact.txt # deploy job uses artifact deploy:onmyserver: stage: deploy script: - cat artifact.txt rules: # Would normally be some TOKEN for authentification - if: $CI_COMMIT_REF_SLUG -
Push this to the default branch
-
Make any simple change, push a new merge request:
git push -o merge_request.create local HEAD:newbranch
Example Project
Reproduce Bug Unwanted Merge Pipeline.
What is the current bug behavior?
There will be 2 pipelines created for the merge request:
- One for the branch/push (which is okay)
- One detached merge request pipeline,
which only runs the jobs that have a matched
rule
What is the expected correct behavior?
From the documentation, as far as I understand it, only 1 pipeline should run.
Relevant logs and/or screenshots
see the live variant here.
Output of checks
This bug happens on GitLab.com
Edited by Norbert Lange
