How to prevent broken master with merge trains & pipelines
Sep 11, 2019Shinya Maeda

Summary
This post introduces and explains two key GitLab CI/CD features: Pipelines for Merged Results and Merge Trains. Pipelines for Merged Results allow CI pipelines to run on a merge commit generated from the latest commits of the target and source branches *before* the actual merge, providing an untrusted pipeline result. Merge Trains build upon this by creating a queueing system for merge requests, where each subsequent merge request's pipeline is run against the merge commit of the previous one in the train, effectively preventing race conditions and ensuring that only fully tested code reaches the master branch.