Problem/Motivation
To help with creating schemas for migrations over in #2183957: Provide configuration schema for Migration module we need to break migration_dependencies out into separate keys.
Proposed resolution
Previously dependencies look like this where the ": false" indicated it was an optional dependency.
migration_dependencies:
- d6_filter_format
- d6_user_role
- d6_user_picture_entity_display
- d6_user_picture_entity_form_display
- d6_user_picture_file: false
And afterwards they will look like this, as suggested by vijaycs85
migration_dependencies:
required:
- d6_filter_format
- d6_user_role
- d6_user_picture_entity_display
- d6_user_picture_entity_form_display
optional:
- d6_user_picture_file
Remaining tasks
Review patch.
User interface changes
n/a
API changes
The way migrations declare their dependencies has changed. This probably isn't that much of an issue since it is unlikely that many people have written D8 migrations at this point.
Generating the Patch
Attached is a script that can convert our existing yml files into the new format. Simply copy the script into the config/install directory and run it.
Comment | File | Size | Author |
---|---|---|---|
#17 | 2263453-17.patch | 25.28 KB | benjy |
#14 | 2263453_13.patch | 25.19 KB | chx |
#14 | interdiff.txt | 2.05 KB | chx |
#10 | 2263453-10.patch | 23.98 KB | benjy |
#7 | interdiff.txt | 1.9 KB | benjy |
Comments
Comment #1
chx CreditAttribution: chx commentedGreat! This structure is vijaycs85's idea and it's a good idea.
Comment #2
benjy CreditAttribution: benjy commentedI removed an un-needed isset statement and updated the comment above to reflect the changes.
Comment #4
benjy CreditAttribution: benjy commentedLooks like I mixed up the dependency_graph and the requirement_graph on one part.
Comment #7
benjy CreditAttribution: benjy commentedThe yaml update script had a bug which didn't catch migrations with optional dependencies only.
Comment #8
benjy CreditAttribution: benjy commentedComment #9
chx CreditAttribution: chx commentedIn MigrationStorage.php please remove the mention of "hard" and "soft" dependencies. Having two terminology is confusing.
In d6_field.yml, "However it also has no requirements so it will always run so a dependency is enough." -- this is now called an optional dependency.
In d6_user_picture_file we need a very important comment on d6_file. Let me try to explain: in d6_upload we depend on d6_file because we use what d6_file saved into the file_managed table. But d6_user_picture_file does not use those so why the dependency? Because d6_file stored records in {files} and with as with every other entity type, we want to keep IDs and the only way to do that is to ensure that out of every migration that saves into {file_managed} it's d6_files that runs first. Every contrib migration that sources from an arbitrary table and uses the destination
entity:file
will need to add this optional dependency. Perhaps even add this comment into d6_file too.Comment #10
benjy CreditAttribution: benjy commentedUpdated the comments as requested.
Comment #11
benjy CreditAttribution: benjy commentedI reworded the comment in d6_user_picture_file and added the comment to d6_file and the entity:file destination as well just for good measure.
Comment #12
chx CreditAttribution: chx commentedWonderful!
Comment #13
vijaycs85looks good. +1 to RTBC.
Comment #14
chx CreditAttribution: chx commentedObsessing a little over this because I am obsessed over the comments in migrate cos I want it to be very sucessful. On the d6_file comment: it's not d6_files but d6_file and the dependency is optional. (I will put this back to RTBC; only CNR for the bot)
Comment #15
chx CreditAttribution: chx commentedComment #17
benjy CreditAttribution: benjy commentedRe-rolled after conflicts with #2250429: d6_block migration not migrating all blocks
Comment #18
benjy CreditAttribution: benjy commentedBack to RTBC.
Comment #19
webchickCommitted and pushed to 8.x. Thanks!