Unexpected Behaviors with Pipeline Jobs
Summary
I have added a pipeline stage with two jobs:
- One to only run in
merge_requestsexcept hotfixes. - The other runs in all circumstances.
But when I open a merge request with test-branch, I expect both jobs to run. But the job that should always run does not run. Is this the expected behavior?
Steps to reproduce
Add this .gitlab-ci.yml to a project:
stages:
- analyze_test
# I expect this to be run always
analyze:
stage: analyze_test
script:
- echo "analyze"
# I expect this to be run in merge requests that are not hotfixes
test:
only:
- merge_requests
except:
- /^hotfix-.*$/
stage: analyze_test
script:
- echo "test"
When MR created and pipeline starts, I see only one job in MR page, that is test. analyze should be there too.
Also when MR created with hotfix-update-file, I should see only one job that is test and when I open pipelines tab, I see that both of the jobs actually did run. test should not run in hotfix- branches, only analyze should run here.
Example Project
This is the project: https://gitlab.com/ndakyildiz/pipeline-test And this is the MR: ndakyildiz/pipeline-test!3
I see only test in this MR with link ndakyildiz/pipeline-test!3. analyze should be there too.
I see only test in this MR with link ndakyildiz/pipeline-test!4. Only analyze should be there.
What is the current bug behavior?
- The job named
analyzedoes not show up in MR page along with the job namedtest. ndakyildiz/pipeline-test!3 - The job named
testalso runs inhotfix-branches when it shouldn't. ndakyildiz/pipeline-test!4
What is the expected correct behavior?
- The job named
analyzeshould show up in MR page along with the job namedtest. - The job named
testalso runs inhotfix-branches when it shouldn't.
Relevant logs and/or screenshots
Example project and MRs will help here.