Rename the existing migrations to use the migration naming convention where variations of the basic migrations are named in the form basicmigration_variation, e.g., d7_node_translation.yml . The same pattern should be used for the related files like migration plugins and tests.
The files that need renaming are;
./core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nUserConfigsTest.php
./core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nUserProfileFieldInstanceTest.php
./core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemMaintenanceTest.php
./core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemSiteTest.php
./core/modules/config_translation/tests/src/Kernel/Plugin/migrate/source/d6/I18nProfileFieldTest.php
./core/modules/config_translation/src/Plugin/migrate/source/d6/I18nProfileField.php
./core/modules/config_translation/migration_templates/d6_i18n_user_profile_field_instance.yml
./core/modules/config_translation/migration_templates/d6_i18n_user_mail.yml
./core/modules/config_translation/migration_templates/d6_i18n_system_site.yml
./core/modules/config_translation/migration_templates/d6_i18n_system_maintenance.yml
./core/modules/config_translation/migration_templates/d6_i18n_user_settings.yml
./core/modules/migrate_drupal/tests/src/Unit/source/d6/i18nVariableTest.php
./core/modules/migrate_drupal/src/Plugin/migrate/source/d6/i18nVariable.php
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | interdiff.txt | 819 bytes | quietone |
| #34 | 2861383-34.patch | 20.88 KB | quietone |
| #32 | interdiff.txt | 19.41 KB | quietone |
| #32 | 2861383-32.patch | 20.79 KB | quietone |
| #28 | interdiff.txt | 15.45 KB | quietone |
Comments
Comment #2
jofitzRenamed the 13 files listed and also came across:
Comment #3
quietone commentedAssigning to myself for review.
Comment #4
quietone commentedThanks Jo Fitzgerald. Looks great, just one small fix before RTBC.
s/variable_translation/variable translation/
The original text was i18n_variable, which is the name of the table. The underscore no longer makes sense.
Comment #5
jofitzCorrected the docs.
Comment #6
quietone commentedSweet as. Thanks.
Comment #8
jofitzComment #9
quietone commentedComment #11
heddnThere was a missed rename of VariableTranslation/VariableTranslationTest. Hopefully this fixes that up.
Comment #12
quietone commented@heddn, thanks.
Applied the patch and grepped for i18n,
grep -ri i18n core/modules/ | grep -v fixtureThe remaining occurrences of i18n are not what we are changing here. This is good to go.
Comment #13
gábor hojtsyDiscussed the rename with @catch and @alexpott, they pointed out that altough this is migration templates in stable modules and migrate_drupal and migrate_drupal_ui, it would still be best to provide a BC layer and deprecate the old classes instead of renaming.
Comment #14
pk188 commented@Gábor Hojtsy How to deprecate the .yml files? I found an ongoing related issue on this 'https://www.drupal.org/node/2627938'.
Comment #15
catchWe don't have any standard for deprecating .yml files yet. Since that service deprecation issue, Symfony has added a mechanism to deprecate services, but that doesn't help us here.
I'd suggest:
1. Deprecate the classes (they can inherit from the new ones)
2. Copy the yml files instead of rename, and don't explicitly mark them deprecated.
We'll then need a follow-up to figure out how to mark the YAML as deprecated. If it gets used then the classes will throw deprecation notices, so that bit is fine, so we're really just looking for a way to document in the file itself the deprecation so that people landing on the file will be able to figure it out, and so that they're easy to identify for removal when 9.x opens.
Comment #16
heddnI don't think we need to deprecate the yml files. Renames for them is fine. Remember that these are templates. And only used a single time during setup of migrate. Once this is committed, then the old templates will never be used. However, it is a good point that we need to think about copy/deprecate. I think that means we need to clone i18nVariable => VariableTranslation, I18nProfileField => ProfileFieldTranslation. Then mark i18nVariable & I18nProfileField as deprecated. And clone the tests for these too.
Even still, I've opened #2884407: [Policy, no patch]: Determine method to deprecate yml files for figuring out a way to mark something in yml as deprecated.
Comment #17
gábor hojtsyWould someone building migrations not expect the templates be there and therefore an ongoing migration process would fail with a core update => BC break?
Comment #18
heddnBuilding migrations, folks copy/paste from migrate_templates. Or they run
drush migrate-upgrade --configure-only(my personal favorite) or the use the migrate_drupal_ui module. For any of these, once the source code is updated, then folks *should* copy/paste from the non-deprecated template. Or the ui or drush would auto pick the non-deprecated template. The old templates should just go away for new migrations.For existing migrations already built by one of the above methods, as long as the source classes exist, then the existence of the templates is irrelevant.
Comment #19
gábor hojtsy@heddn: ok, I don't personally have experience building migrations. Would be nice to confirm that from another migrate team member and @catch or otherwise get @catch qualify his suggestion.
Comment #20
catchThis is a good answer on the templates, so let's remove those.
Copying the classes will mean that existing migrations using them will continue to work (with deprecation messages).
Comment #21
quietone commentedAdd tag.
Comment #22
quietone commentedAdding deprecations for the source plugins.
Comment #23
jofitzTidying up a few coding standards issues.
Comment #24
quietone commented@Jo Fitzgerald, thanks for cleaning up after me!
Comment #25
heddnFrom #16, I think we are missing test coverage of the legacy i18n classes. Those need to be cloned, not renamed. And we are missing an @see to the CR. See https://www.drupal.org/core/deprecation#how for steps to deprecate.
Tagging novice, because all we need to do is copy, not rename the test cases. We'll also need to write a CR, which is probably less novice. Meaning the writing, not the @see. The link to the CR is definitely novice.
Comment #26
quietone commentedDrafted a change record, added an @see to the deprecation notices and copied the tests.
Comment #27
heddnI did a quick review of the CR. It looks good. Just a couple small nits and this is good to go. Still leaving the Novice tag, in case someone wants to pick up the nits.
Let's put the trigger_error all on a single line, instead of multiples. That's what I see in the rest of core.
Nit: the {} can be on the same line.
On the old tests, let's add them to an @group of legacy.
@group legacySame as earlier. A single line please.
Comment #28
quietone commentedThis patch should address all the points in #27.
Comment #30
heddnLooks good now.
Comment #31
catchNeeds a re-roll.
Comment #32
quietone commentedReroll.
Comment #34
quietone commentedMissed a change from source_provider to source_module and updated a comment to start with a capitalized verb.
Comment #35
heddnAnd back to RTBC.
Comment #36
webchickSorry to be "that guy," but what's the justification for changing these machine names around so late in the game? It looks cosmetic to me? Won't this break existing sites?
Comment #37
quietone commented@webchick, yea this is OK.
The same thing was asked in #13, and after the discussion catch summarized #20:
Where 'them' means the migration templates.
Comment #38
catchYes it's a change we'd allow in a minor release even if migrate was fully stable since it's got a bc layer, although the issue title caught me out more than once when looking at this... It's handy that the bc layer for migrations is so simple by the way.
Re-reviewed the patch and it looks fine, so committed/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!
Comment #42
quietone commentedPublish the change record