Problem/Motivation
Migration classes are too tightly coupled. In particular, the source, destination, and id map plugins used by the Migration class all contain references to the containing migration, preventing them from being usable apart from the migration. The source coupling is particularly problematic - the builder patch (#2530030: Create the migrate builder plugin type) needs to use the source plugin alone but is forced to construct a dummy migration to do so. Also, in contrib we'd like to implement the migrate-analyze command for analyzing source data from a source plugin - that will also be forced to construct an unnecessary migration to do so.
We recognize that we probably can't accomplish all of this for 8.0 and at least some of it may need to be postponed to 9.0, but having already had some IRC discussions around it we should capture the thinking (not least as a place to point people new to the migration system and asking the same "why-the-hell" questions about this coupling).
Proposed resolution
Tackle the coupling class-by-class.
Remaining tasks
User interface changes
N/A
API changes
Removal of migration injection into the classes it uses. Potential addition of specific bits of information from the migration into those classes.
Data model changes
None anticipated.
Comments
Comment #1
mikeryanBegan adding a child issue for decoupling the id map plugin from migrations, but when I came to describe it - "manages the map and message tables for a migration" - maybe it should be tightly coupled?
Comment #3
mikeryanApart from the destination child issue, nothing here we plan on pursuing before 9.x.
Comment #4
chx commented> Migration classes are too tightly coupled.
That's theory and practically meaningless in this case since some classes will require other Migration specific bits like Row to work.
> In particular, the source, destination, and id map plugins used by the Migration class all contain references to the containing migration, preventing them from being usable apart from the migration.
Good. Aside from source they are unusable anyways on their own and even for source the usage is limited.
So... what's the point and motivation behind this issue?
Comment #5
catchIf 9.x only removes backwards compatibility with 8.x and nothing else, then this would need to be done with a backwards compatibility layer. So moving back for now. If it doesn't get done, we can move it back to 9.x when the time comes (but it will probably still need a bc layer then too).
Comment #11
heddnRealistically speaking, this won't really happen until 9.x (or later).
Comment #13
xjmThis would be a minor-only change since there's additions/deprecations/etc. Since 8.9.x and 9.0.x are now in beta, I'm moving this to 9.1.x. Thanks!