The core processor of merge trains
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
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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