Refactor MergeTrains skip-merge workflow to avoid possible race condition
The Problem
During validation of #414505 (closed) / !132325 (merged) we uncovered an occasional (but relatively uncommon) race condition. We don't expect it to be an issue for any self-managed customers under normal circumstances, but we saw an unwanted refresh at least once on staging.
The Solution
To avoid this, we're going to create a MergeTrains::MergeService
that allows for creating a merge train car normally but merging it immediately, outside of the regular MergeTrains::RefreshService
workflow. Trying to hook into the ordered-refresh workflow is how we ended up with the occasional race condition, as we're counting on a relatively typical execution of asynchronous processes.
Edited by Allison Browne