Problem/Motivation
The new include migration plugins are a great feature. However, in practice, the single MYMODULE.migrate_shared_configuration.yml gets big and unwieldy really quickly. It's hard to get an overview of what's there, it's hard to see where one include section ends and another begins, and with multiple developers working on migrations, everyone is working on the same file with resulting git conflicts.
Steps to reproduce
Proposed resolution
Change the include plugins to use one YAML file per include plugin, in a specific subfolder, the same way migration plugins work.
This can be done by changing the plugin manager to use YamlDirectoryDiscovery.
For BC, create a class which decorates the old discovery.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork migrate_tools-3397621
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3397621-migration-include-single-yaml-file
changes, plain diff MR !49
Comments
Comment #3
joachim commentedComment #4
amaisano commentedDoes this only break it up within the current module, or can it be made so that we can reference different module's shared migration file(s)? Would be nice to have cross-module migration shared yml files (like a family of sub modules where the parent module has a common set of shared migration data, and the sub modules that each deal with different parts of the migration have more specific shared migration data).
Comment #5
joachim commented> Does this only break it up within the current module, or can it be made so that we can reference different module's shared migration file
The migration includes are merely plugins -- you can reference any plugin of that type in any migration. That's already the case with the current code.
Comment #6
amaisano commentedSo cross-module use of the shared_configuration YAML data is possible w/o this patch? Like so:
?
Comment #7
joachim commentedAFAICT, yes. I had a quick look in the code of MigrateIncludeHandler and it's not doing any doctoring to the 'include' value.
Comment #8
amaisano commentedIt would be nice if you could still group multiple inside a single YML file, especially when you have multiple override "snippets" that are only a few lines -- creating a separate file for all of them is a bit overwhelming.
Comment #9
amaisano commentedAlso, sub-folders under migrate_shared_configuration/ would be nice:
Comment #10
heddnNice addition.
Comment #12
heddn