doc/ci/pipelines/merged_results_pipelines.md
{{< details >}}
{{< /details >}}
Merged results pipelines test a temporary merged commit that combines code from the source and target branches. This commit doesn't exist in either branch, but you can view it in the pipeline details.
This approach helps verify changes work with the code in the latest target branch, catch integration issues before merging, and ensure changes in different files work together.
Merged results pipelines can't run when the target branch has changes that conflict with the changes in the source branch. In these cases, GitLab runs a standard merge request pipeline instead.
Prerequisites:
.gitlab-ci.yml file must be configured for merge request pipelines.To enable merged results pipelines in a project:
[!warning] If you enable this setting without configuring merge request pipelines in your
.gitlab-ci.ymlfile, your merge requests might become stuck in an unresolved state or your pipelines might be dropped.
When working with merged results pipelines, you might encounter the following issues.
rules:changes:compare_toYou might have jobs or pipelines that run unexpectedly when using
rules:changes:compare_to with merge request pipelines.
This issue occurs because merged results pipelines use the temporary merged commit as the base for comparison. This commit contains changes from both your merge request branch and the target branch, which can cause rules to trigger unexpectedly.
For example, if your merge request adds src/feature.js and the target branch
contains src/utils.js, the temporary merged commit includes both files.
A rule with rules:changes:compare_to: main detects both changes, not just
your feature file, and may trigger jobs that should only run for your changes.
To resolve this issue:
compare_to parameter to use the default comparison behavior.rules:changes without compare_to.You might encounter a situation where a failed branch pipeline is ignored when the Pipelines must succeed setting is activated.
This issue occurs due to the pipeline logic prioritization. Support for improvements is proposed in issue 385841.