How do GitLab merge trains work?
AdvancedConceptGitLab CI
Answer
A merge train queues MRs; for each MR GitLab creates a temporary merge result that includes the target branch plus all MRs ahead in the train, and runs the pipeline on it. If it passes the MR merges; if an earlier MR fails, later ones are rebuilt without it. Pipelines must be configured for merge request events (rules with merge_request_event), and "merged results pipelines" must be enabled. The effect is a main that is always green without developers constantly rebasing.
More on GitLab CI
How does GitLab CI/CD work at a high level?BeginnerWhat is a GitLab Runner and what executors exist?IntermediateWhat are the types of runners (shared, group, project) and tags?IntermediateHow do `rules:` work and how do they replace `only/except`?IntermediateWhat are workflow rules and how do they prevent duplicate pipelines?AdvancedHow do artifacts and cache differ in GitLab CI?Intermediate