Build cascading train refs for parallel execution of Pipelines for merge trains
What does this MR do?
As we supported arbitrary refs creation in the previous merge request https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14298, we can now create cascading merge refs in refs/train
to run Pipelines for merge trains in parallel.
In this iteration, we support up-to 4 concurrent pipeline runs. Here is the overview of the process flow:
- User adds MR1, MR2, MR3, MR4 and MR5 to a train.
- The system creates the train ref
refs/merge-requests/1/train
frommr1.diff_head_sha
andmr1.target_branch_ref
. - The system creates a pipeline run on
refs/merge-requests/1/train
. - The system creates the train ref
refs/merge-requests/2/train
frommr2.diff_head_sha
andmr1.train_ref_path
. - The system creates a pipeline run on
refs/merge-requests/2/train
. - The system creates the train ref
refs/merge-requests/3/train
frommr3.diff_head_sha
andmr2.train_ref_path
. - The system creates a pipeline run on
refs/merge-requests/3/train
. - The system creates the train ref
refs/merge-requests/4/train
frommr4.diff_head_sha
andmr3.train_ref_path
. - The system creates a pipeline run on
refs/merge-requests/4/train
. - The system does not create any train refs
refs/merge-requests/5/train
because it's out of concurrency factor. - The system does not create any pipelines on
refs/merge-requests/5/train
because it's out of concurrency factor.
Related https://gitlab.com/gitlab-org/gitlab-ee/issues/11222 gitaly!1210 (merged)
Feature Flag
This behavior can be reverted by Feature.disable(:merge_trains_parallel_pipelines)
. After it's reverted, pipeline runs one at a time.
Extra datapoint
Today the number of projects which enables merge trains is still very low.
gitlabhq_production=> select COUNT(*) from project_ci_cd_settings WHERE merge_trains_enabled = true;
count
-------
28
(1 row)
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
Merge request reports
Activity
changed milestone to %12.1
2 Warnings The title of this merge request is longer than 72 characters and would violate our commit message rules when using the Squash on Merge feature. Please consider adjusting the title, or rebase the commits manually and don’t use Squash on Merge. This merge request is quite big (more than 518 lines changed), please consider splitting it into multiple merge requests. Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category (e.g. frontend or backend), and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has randomly picked a candidate for each review slot. Feel free to override this selection if you think someone else would be better-suited, or the chosen person is unavailable.
Once you've decided who will review this merge request, mention them as you normally would! Danger does not (yet?) automatically notify them for you.
Category Reviewer Maintainer backend Markus Koller ( @toupeira
)Sean McGivern ( @smcgivern
)test for spec/features/*
No reviewer available No maintainer available Generated by
DangerEdited by 🤖 GitLab Bot 🤖mentioned in merge request !14305 (merged)
- Resolved by Shinya Maeda
We would need to set proper
commit_message
.
added 555 commits
-
6cdf60be...1f2ca87f - 554 commits from branch
create-merge-train-ref
- 3a048437 - Create refs/train and run a pipeline on it
-
6cdf60be...1f2ca87f - 554 commits from branch
@oswaldo This MR is on top of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14298. It uses the extended
MergeToRefService
for train ref creation.What do you think about this approach? Is there any concerns from your side?
assigned to @oswaldo and unassigned @dosuken123
mentioned in merge request !11203 (closed)
- Resolved by Shinya Maeda
- Resolved by Shinya Maeda
- Resolved by Shinya Maeda
- Resolved by Shinya Maeda
assigned to @dosuken123 and unassigned @oswaldo
added 199 commits
-
c876dc53...2ff33450 - 198 commits from branch
create-merge-train-ref
- 3f7c8656 - Create refs/train and run a pipeline on it
-
c876dc53...2ff33450 - 198 commits from branch
added 116 commits
-
dfb5ad8f...a89d1e75 - 115 commits from branch
create-merge-train-ref
- 7a838513 - Create refs/train and run a pipeline on it
-
dfb5ad8f...a89d1e75 - 115 commits from branch
mentioned in issue gitlab-org/release/tasks#840 (closed)
mentioned in merge request !14495 (merged)
mentioned in issue #12562 (closed)
mentioned in merge request gitaly!1210 (merged)
added 1132 commits
-
cc4cd0a1...16478230 - 1132 commits from branch
create-merge-train-ref
-
cc4cd0a1...16478230 - 1132 commits from branch
added 91 commits
-
d4f9754d...f81322f9 - 90 commits from branch
master
- b00cce01 - Create refs/train and run a pipeline on it
-
d4f9754d...f81322f9 - 90 commits from branch
added 19 commits
-
b00cce01...be20ff0e - 18 commits from branch
master
- 6aac3214 - Create refs/train and run a pipeline on it
-
b00cce01...be20ff0e - 18 commits from branch
marked the checklist item Changelog entry as completed
marked the checklist item Code review guidelines as completed
marked the checklist item Merge request performance guidelines as completed
marked the checklist item Style guides as completed
marked the checklist item Database guides as completed
marked the checklist item Separation of EE specific content as completed
- Resolved by Shinya Maeda
assigned to @ayufan and unassigned @dosuken123
assigned to @dosuken123 and unassigned @ayufan
assigned to @ayufan
added 281 commits
-
9283b9b0...a42c431c - 280 commits from branch
master
- 40444a34 - Create refs/train and run a pipeline on it
-
9283b9b0...a42c431c - 280 commits from branch
mentioned in issue #11222 (closed)
added 182 commits
-
bc8b10be...f42cf661 - 181 commits from branch
master
- 1a462017 - Create refs/train and run a pipeline on it
-
bc8b10be...f42cf661 - 181 commits from branch
@smcgivern Would you mind reviewing as a backend maintainer? Thanks.
assigned to @smcgivern and unassigned @ayufan and @dosuken123
Manual QA at
Thu Jul 11 12:28:37 UTC 2019
Based on the https://gitlab.com/gitlab-org/gitlab-ee/issues/11222#note_190356236's conditions, I performed manual QA to the following cases:
Case 1: MR1 was merged into master branch.
Expectation:
- MR2 does not re-create pipeline for merge train.
- MR2 is merged after the current pipeline succeeded.
Result: Pass
Case 2: MR1 was dropped from the merge train.
Expectation:
- MR2 re-creates a pipeline for merge train.
- MR2 is merged after the recreated pipeline succeeded.
Result: Pass
Case 3: An emergent patch has been merged into master.
Expectation:
- Both MR1 and MR2 re-create a pipeline for merge train.
- MR1 is merged after the recreated pipeline succeeded.
- MR2 is merged after MR1 has been merged and the recreated pipeline succeeded.
Result: Pass
added 107 commits
-
59e18c87...be8565f4 - 106 commits from branch
master
- 2c90cdba - Create refs/train and run a pipeline on it
-
59e18c87...be8565f4 - 106 commits from branch
- Resolved by Shinya Maeda
- Resolved by Shinya Maeda
- Resolved by Shinya Maeda
- Resolved by Shinya Maeda
- Resolved by Shinya Maeda
assigned to @dosuken123 and unassigned @smcgivern
added 98 commits
-
166c4ed3...db30be12 - 97 commits from branch
master
- a39abdbe - Create refs/train and run a pipeline on it
-
166c4ed3...db30be12 - 97 commits from branch
@smcgivern Thanks. Back to you!
assigned to @smcgivern and unassigned @dosuken123
- Resolved by Shinya Maeda
mentioned in commit aecb4072
mentioned in issue gitlab-org/release/tasks#866 (closed)
mentioned in issue gitlab-org/release/tasks#867 (closed)
mentioned in issue gitlab-org/release/tasks#869 (closed)
mentioned in issue gitlab-org/release/tasks#870 (closed)
added Enterprise Edition label