Backend: git push option `merge_request.merge_when_pipeline_succeeds` does not use merge trains.

Summary

When a project is set with Enable merge trains git push option merge_request.merge_when_pipeline_succeeds does a Merge Immediately instead of adding to a merge train.

Steps to reproduce

Video of reproduction https://youtu.be/Ka0CNs3pISc (gitlab unfiltered private).

Example Project

https://gitlab.com/bdowney/merged-results

What is the current bug behavior?

Pipeline for merged results runs and when passes, the merge is immediate. A second pipeline running while a first is running produces the same result and master ends up red/broken.

What is the expected correct behavior?

If merge trains are enabled, the merge request should be added to the train with git push option merge_request.merge_when_pipeline_succeeds.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

/cc @francispotter @yhsueh

Edited by Mark Nuzzo