Finishing up "Object Model Realignments for Merge Trains"
What does this MR do and why?
This MR is a continuation of the work in MR_LINK to introduce a MergeTrains::Train object to hold logic that applies to whole trains, instead of operating on sets of Car records all the time.
This isn't meant to be the entirety of the refactors; there are already several follow-up MRs with other refactors that depend on this one:
- Remove MergeTrains::Car.total_count_in_train (!124680 - merged) • drew stachon • 16.2
- Remove obsolete method definitions (!125776 - merged) • drew stachon • 16.2
- Replace a finder class method with a scope (!124661 - merged) • drew stachon • 16.2
- Move MergeTrain enablement check into Project (!125045 - merged) • drew stachon • 16.2
but here we'll introduce the Train class itself, so it can be iterated on and used by smaller changes in the follow-up MRs.
How to set up and validate locally
The work happening here is entirely under the hood, and we shouldn't be making any behavioral changes. So fire up some local merge trains if you like, but primarily we're relying on tests here to prove our features work the same way.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #298541 (closed)