Pushing CI vars using git push -o doesn't work together when enabling merge request pipelines

Summary

When activating merge request pipelines by including the MergeRequest-Pipelines template, pushing CI variables using git push -o doesn't work anymore.

Steps to reproduce

  • Create a new project
  • Push an initial commit to the main branch
  • Create a new branch
  • Commit a gitlab-ci.yml with following content:

debug:
  variables:
    CI_DEBUG_TRACE: "true"
  image: busybox
  script:
    - echo "Testing pushing CI vars via git push -o with merge pipelines"
  • Push the branch using git push -o ci.variable="PUSHING_CI_VARS=works" --set-upstream origin test
  • Create a MR from the corresponding branch
  • Check if the CI variable PUSHING_CI_VARS is exported in the corresponding job output, it is.
  • Add this to the gitlab-ci.yml and commit it:
include:
  - template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
  • Push the second commit using git push -o ci.variable="PUSHING_CI_VARS=works"
  • Check if the CI variable PUSHING_CI_VARS is exported in the corresponding job output, it's not there.

Example Project

See this example merge request

What is the current bug behavior?

CI variables pushed with git push -o are not exported on a merge request when including the MergeRequest-Pipelines.gitlab-ci.yml template.

What is the expected correct behavior?

CI variables pushed with git push -o should get exported on a merge request when including the MergeRequest-Pipelines.gitlab-ci.yml template.

Relevant logs and/or screenshots

See the links job outputs in the example merge request

Output of checks

This bug happens on GitLab.com.