Skip to content

The core processor of merge trains

Shinya Maeda requested to merge process-merge-trains into master

What does this MR do?

This MR introduces the core processor of Merge Train feature. The basic ideas of this implementation are

  • Hook merge-train-related events and send a signal to the processor
  • The processor always works on the first queue in the train
  • The processor creates a pipeline after enqueued
  • The processor merges the first merge request in a queue when the corresponding pipeline finished.
  • The processor drops a merge request if it is not processable.

This approach is based on the feedback from the PoC MR https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/11354

Reference: https://gitlab.com/gitlab-org/gitlab-ee/issues/9186

When it's not processable?

  • push to merge request (seems to be already mentioned),
  • change of merge request between WIP and non-WIP,
  • close and re-open of MR,
  • removal/destroy of MR
  • user was removed
  • user was removed from the project (losing permission to merge)
  • user disabled merge train option when there are 100 of MRs in a merge train queue

Edge cases to catch in the future

  • change of target branch

This merge request has CE backport

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Shinya Maeda

Merge request reports