Skip to content

Add MergeTrains::CreateRefService

Hordur Freyr Yngvason requested to merge make-create-ref-service-generic into master

What does this MR do and why?

The EE-only bit of MergeRequests::CreateRefService was actually specific to merge trains and needed to be extracted before we could re-use this service in other parts of the code. The idea is that MergeRequests::CreateRefService should supersede MergeRequests::MergeToRefService, in some (or all) cases. For example, for merged result pipelines when automatic rebases are enabled.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

We can verify that fast-forward merge trains still work after this change:

  1. Run bin/rake gitlab:seed:merge_trains:project. This will generate a project with a bunch of MRs.
  2. In the generated project, ensure fast-forward merges are enabled, along with merge trains.
  3. Rapidly merge several MRs in the projects, so they all end up on the same train.
  4. Observe that all of them still merge

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hordur Freyr Yngvason

Merge request reports