The "pipeline too old" message in MR is happening too late
Problem
We regularly have broken master
due to people not starting a fresh pipeline when the latest one is too old (the most recent was this morning). There are several cases:
- A pipeline started more than 4 hours ago, and failed. The maintainer retry the failed jobs and set the MR to auto-merge =>
💥 - A pipeline started more than 4 hours ago, and passed, but there was an unmet check (e.g. an unresolved thread) that prevented the auto-merge. The maintainer fixes the check (e.g. resolves the thread) and the MR is immediately merged =>
💥
Solution
-
For the first case, we could introduce a new job that would run as the very last job in a pipeline. This job would fail if
pipeline.created_at > 4 hours
(no way to remediate it other than starting a new pipeline). -
For the second case, this is trickier as when the pipeline finishes, it's still fresh enough, so we'd need to run the job only when the MR is going to be merged, which is actually impossible. One way to address this case would be to use Merge Train pipeline to perform this check, as proposed by @leipert at gitlab-org/gitlab#462819 (comment 1916454002).
-
A solution in the product, as a new type of check would be ideal.
Recent examples
The following MRs were all merged on the same day: