Updating curated recommendations
Curated recommendations, unlike generated recommendations, must be updated manually. This page outlines the steps to do this. This page covers the most complex example possible, to ensure it contains all relevant information to be able to update any package's recommendation.
Step 1: update recommendation's version constraint
- This runbook assumes you have a
git cloneof https://git.drupalcode.org/project/acquia_migrate/-/tree/recommendations at~/Work/acquia-migrate-recommendations. (If not, create it:git clone git@git.drupal.org:project/acquia_migrate.git -b recommendations acquia-migrate-recommendations.)cdinto it. -
On October 7 2020, Drupal
9.0.7was released. AM:A's recommendations were still recommendingdrupal/core, version9.0.6.drupal/corehappens to be one of the packages incurated.json. -
The first step is to create a branch and update the recommended version:
$ git checkout -b core-9.0.7 M curated.json Switched to a new branch 'core-9.0.7' $ git diff diff --git a/curated.json b/curated.json index 5b4ccc1..a3f2b38 100644 --- a/curated.json +++ b/curated.json @@ -334,7 +334,7 @@ { "universal": true, "package": "drupal/core", - "constraint": "9.0.6", + "constraint": "9.0.7", "patches": { "Issue #3115073: Convert RDF mapping migration to derived migrations": "https://www.drupal.org/files/issues/2020-02-24/core-derived_rdf_mapping_migration-3115073-7.patch", "Issue #3096951: d7_node migration should have dependency on d7_node_title_label migration": "https://www.drupal.org/files/issues/2020-03-31/3096951-16.patch", - If the updated recommendation does not have a
patcheskey, this is where we can stop and create a MR.
Step 2: (if recommendation has patches) verify patch stack still applies
-
Ensure you have a local
git cloneof the package the recommendation applies to — in this example that isdrupal/core. Check it out at the currently recommended version.cdinto it.To get the currently recommended version for a package, do:
jq '.data | map(select(.package == "PACKAGENAME"))[0].constraint' curated.json
so in this example, that is:
$ jq '.data | map(select(.package == "drupal/core"))[0].constraint' curated.json "9.0.6"
-
Next, fetch the new tags, to find the one we're wanting to update to, and then check out that tag:
$ git fetch --tags warning: redirecting to https://git.drupalcode.org/project/drupal.git/ remote: Enumerating objects: 5, done. remote: Counting objects: 100% (5/5), done. remote: Total 12 (delta 5), reused 5 (delta 5), pack-reused 7 Unpacking objects: 100% (12/12), done. From http://git.drupal.org/project/drupal * [new tag] 8.9.7 -> 8.9.7 * [new tag] 9.0.4 -> 9.0.4 * [new tag] 9.0.7 -> 9.0.7 $ git checkout 9.0.7 Previous HEAD position was b6ca29bfc4 Drupal 9.0.6 HEAD is now at 3ab4109dd6 Drupal 9.0.7
-
Now let's find out whether the patches (or stack of patches, since they're applied one on top of the other) still apply. Note that this is the full output and hence it's been collapsed, since this particular recommendation has lots of recommendations.
$ sh modules/acquia_migrate/scripts/dev/apply-patches.sh drupal/core ~/Work/acquia-migrate-recommendations/curated.json jq: error (at <stdin>:13430): null (null) has no keys Applying https://www.drupal.org/files/issues/2020-02-24/core-derived_rdf_mapping_migration-3115073-7.patch … patching file core/modules/rdf/migrations/d7_rdf_mapping.yml patching file core/modules/rdf/src/Plugin/migrate/RdfMappingDeriver.php patching file core/modules/rdf/src/Plugin/migrate/source/d7/RdfMapping.php Applying https://www.drupal.org/files/issues/2020-03-31/3096951-16.patch … patching file core/modules/book/tests/src/Kernel/Migrate/d7/MigrateBookTest.php patching file core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php patching file core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php patching file core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php patching file core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7TestBase.php patching file core/modules/node/migrations/d7_node.yml patching file core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php patching file core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php patching file core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php patching file core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php patching file core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php patching file core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php patching file core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerNodeTest.php patching file core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerUserTest.php Applying https://www.drupal.org/files/issues/2019-11-25/3096676-2.patch … patching file core/modules/system/migrations/system_maintenance.yml Applying https://www.drupal.org/files/issues/2019-11-28/3097314-2.patch … patching file core/modules/block_content/migrations/d7_custom_block.yml patching file core/modules/comment/migrations/d7_comment.yml Hunk #1 succeeded at 68 (offset 7 lines). Applying https://www.drupal.org/files/issues/2020-08-05/core-derive_path_alias_migrations-3122649-34.patch … patching file core/modules/path/migrations/d7_url_alias.yml patching file core/modules/path/path.module patching file core/modules/path/src/Plugin/migrate/D7PathAliasDeriver.php patching file core/modules/path/src/Plugin/migrate/D7PathAliasDeriverTrait.php patching file core/modules/path/src/Plugin/migrate/source/d7/UrlAlias.php patching file core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasNoTranslationTest.php patching file core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php Hunk #1 succeeded at 43 with fuzz 2 (offset 1 line). Applying https://www.drupal.org/files/issues/2020-05-18/core-theme_settings_migrate_requirement-3096972-36_0.patch … patching file core/modules/block/migrations/d6_block.yml patching file core/modules/block/migrations/d7_block.yml patching file core/modules/block/src/Plugin/migrate/process/BlockTheme.php patching file core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php patching file core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php patching file core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php patching file core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php patching file core/modules/migrate_drupal/tests/fixtures/drupal7.php Hunk #2 succeeded at 33205 (offset 76 lines). Hunk #3 succeeded at 33280 (offset 76 lines). Hunk #4 succeeded at 38580 (offset 76 lines). Hunk #5 succeeded at 38630 (offset 76 lines). Hunk #6 succeeded at 38680 (offset 76 lines). Hunk #7 succeeded at 38780 (offset 76 lines). Hunk #8 succeeded at 56087 (offset 155 lines). Hunk #9 succeeded at 56109 (offset 155 lines). Hunk #10 succeeded at 58323 (offset 159 lines). patching file core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php Hunk #1 succeeded at 71 (offset -1 lines). patching file core/modules/system/migrations/d7_theme_settings.yml patching file core/modules/system/src/Plugin/migrate/D7ThemeDeriver.php patching file core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php patching file core/modules/system/src/Plugin/migrate/source/d7/ThemeSettings.php patching file core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php patching file core/modules/system/tests/src/Kernel/Plugin/migrate/source/d7/ThemeSettingsTest.php Applying https://www.drupal.org/files/issues/2020-02-10/core-migrate_formatter_widget_fallback-3108302-26---fix-only.patch … patching file core/modules/field/migrations/d6_field_formatter_settings.yml patching file core/modules/field/migrations/d6_field_instance_widget_settings.yml patching file core/modules/field/migrations/d7_field_formatter_settings.yml patching file core/modules/field/migrations/d7_field_instance.yml patching file core/modules/field/migrations/d7_field_instance_widget_settings.yml patching file core/modules/field/src/Plugin/migrate/process/FieldFormatterFallback.php patching file core/modules/field/src/Plugin/migrate/process/FieldWidgetFallback.php patching file core/modules/migrate/src/Plugin/migrate/process/NullIfNotEqual.php patching file core/modules/migrate_drupal/src/Plugin/migrate/field/FieldPluginBase.php Hunk #1 succeeded at 40 (offset -42 lines). Hunk #2 succeeded at 105 (offset -56 lines). patching file core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php patching file core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php Hunk #1 succeeded at 163 (offset 5 lines). Hunk #2 succeeded at 191 (offset 5 lines). Hunk #3 succeeded at 244 (offset 7 lines). Hunk #4 succeeded at 279 (offset 7 lines). patching file core/modules/migrate_drupal/tests/src/Traits/FieldDiscoveryTestTrait.php Applying https://www.drupal.org/files/issues/2020-09-25/core-derived_field_and_field_display_migrations-3097336-62--chained--do-not-test.patch … patching file core/modules/block_content/migrations/d7_custom_block.yml patching file core/modules/comment/migrations/d7_comment.yml patching file core/modules/comment/migrations/d7_comment_entity_display.yml patching file core/modules/comment/migrations/d7_comment_entity_form_display.yml patching file core/modules/comment/migrations/d7_comment_entity_form_display_subject.yml patching file core/modules/comment/migrations/d7_comment_field.yml patching file core/modules/comment/migrations/d7_comment_field_instance.yml patching file core/modules/comment/migrations/d7_comment_type.yml patching file core/modules/comment/src/Plugin/migrate/D7CommentDeriver.php patching file core/modules/comment/src/Plugin/migrate/source/d7/Comment.php patching file core/modules/field/migrations/d7_field.yml patching file core/modules/field/migrations/d7_field_formatter_settings.yml patching file core/modules/field/migrations/d7_field_instance.yml patching file core/modules/field/migrations/d7_field_instance_widget_settings.yml patching file core/modules/field/migrations/d7_view_modes.yml patching file core/modules/field/src/Plugin/migrate/D7FieldConfigurationMigrationDeriver.php patching file core/modules/field/src/Plugin/migrate/D7FieldInstanceMigrationDeriver.php patching file core/modules/field/src/Plugin/migrate/D7FieldSettingsMigrationDeriver.php patching file core/modules/field/src/Plugin/migrate/D7ViewModeMigrationDeriver.php patching file core/modules/field/src/Plugin/migrate/source/d7/Field.php patching file core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php patching file core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php patching file core/modules/migrate/src/Plugin/Migration.php patching file core/modules/migrate_drupal/src/Plugin/migrate/FieldMigration.php patching file core/modules/node/migrations/d7_node.yml patching file core/modules/node/migrations/d7_node_complete.yml patching file core/modules/node/migrations/d7_node_title_label.yml patching file core/modules/node/migrations/d7_node_type.yml patching file core/modules/node/src/Plugin/migrate/D7NodeDeriver.php patching file core/modules/node/src/Plugin/migrate/D7NodeTitleDeriver.php patching file core/modules/node/src/Plugin/migrate/source/d7/NodeType.php patching file core/modules/taxonomy/migrations/d7_taxonomy_term.yml patching file core/modules/taxonomy/migrations/d7_taxonomy_vocabulary.yml patching file core/modules/taxonomy/src/Plugin/migrate/D7TaxonomyTermDeriver.php patching file core/modules/taxonomy/src/Plugin/migrate/D7VocabularyDeriver.php patching file core/modules/taxonomy/src/Plugin/migrate/source/d7/Vocabulary.php patching file core/modules/user/migrations/d7_user.yml patching file core/modules/user/migrations/user_picture_entity_display.yml patching file core/modules/user/migrations/user_profile_entity_display.yml Applying https://www.drupal.org/files/issues/2020-02-25/core-references_upgrade_path-2814953-25--fix-only--do-not-test.patch … patching file core/modules/field/src/Plugin/migrate/field/d7/NodeReference.php patching file core/modules/field/src/Plugin/migrate/field/d7/UserReference.php patching file core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceSettings.php patching file core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php Applying https://www.drupal.org/files/issues/2020-03-09/core-derived_block_config_migrations-3115938-12.patch … patching file core/modules/block/migrations/d6_block.yml patching file core/modules/block/migrations/d7_block.yml Hunk #2 succeeded at 60 (offset 10 lines). Hunk #3 succeeded at 114 (offset 4 lines). patching file core/modules/block/src/Plugin/migrate/BlockDeriver.php patching file core/modules/block/src/Plugin/migrate/source/Block.php Applying https://www.drupal.org/files/issues/2020-03-24/3122056-2.patch … patching file core/modules/history/history.module Hunk #1 succeeded at 135 (offset -1 lines). Applying https://www.drupal.org/files/issues/2020-03-31/core-add_file_migration_dependencies-3123775-4--fix-only--do-not-test.patch … patching file core/modules/file/file.module Hunk #2 succeeded at 1762 (offset -50 lines). patching file core/modules/file/file.services.yml patching file core/modules/file/src/FileMigrationDependencyManager.php patching file core/modules/file/src/FileMigrationDependencyManagerInterface.php Applying https://www.drupal.org/files/issues/2020-05-18/core-file_validate_extension_bug-2834958-18--complete.patch … patching file core/modules/file/file.module patching file core/modules/file/tests/src/Kernel/ValidatorTest.php Applying https://www.drupal.org/files/issues/2020-06-16/2845340-16.patch … patching file core/modules/migrate/src/Plugin/migrate/id_map/Sql.php Applying https://www.drupal.org/files/issues/2020-06-18/core-migration_source_variable_required_variables-3152789-2.patch … patching file core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php patching file core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/VariableTest.php Applying https://www.drupal.org/files/issues/2020-06-18/core-migrate_system_file_settings-3151979-10.patch … patching file core/modules/system/migrations/d7_system_file.yml Applying https://www.drupal.org/files/issues/2020-06-18/core-migrate_system_mail_settings-3151980-11.patch … patching file core/modules/system/migrations/d7_system_mail.yml Applying https://www.drupal.org/files/issues/2020-06-18/core-search_settings_migration-3151993-3.patch … patching file core/modules/search/migrations/d7_search_settings.yml Applying https://www.drupal.org/files/issues/2020-07-01/core-route_migrate_process_plugin_options-3156083-2--complete.patch … patching file core/modules/migrate/src/Plugin/migrate/process/Route.php patching file core/modules/migrate/tests/src/Kernel/process/RouteTest.php Applying https://www.drupal.org/files/issues/2020-07-01/core-derive_menu_link_migrations_per_entity_type-3051251-14.patch … patching file core/modules/menu_link_content/menu_link_content.module Hunk #2 succeeded at 128 (offset 5 lines). patching file core/modules/menu_link_content/migrations/d7_menu_links.yml patching file core/modules/menu_link_content/src/MenuLinkContentMigrationPluginsAlterer.php patching file core/modules/menu_link_content/src/Plugin/migrate/source/D7MenuLinkDeriver.php patching file core/modules/menu_link_content/src/Plugin/migrate/source/D7MenuLinkDeriverTrait.php patching file core/modules/menu_link_content/src/Plugin/migrate/source/MenuLink.php patching file core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php Applying https://www.drupal.org/files/issues/2020-06-23/3154156-2.patch … patching file core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php Applying https://www.drupal.org/files/issues/2020-10-22/core-create_stub_only_when_matching_source_row_exists--9.0.x--3156730-31.patch … patching file core/modules/migrate/src/MigrateStub.php patching file core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php patching file core/modules/migrate/tests/src/Unit/MigrateStubTest.php patching file core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php patching file core/modules/taxonomy/tests/modules/taxonomy_term_stub_test/migrations/taxonomy_term_stub_test.yml patching file core/modules/taxonomy/tests/modules/taxonomy_term_stub_test/migrations/taxonomy_term_stub_test_valid.yml patching file core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php Applying https://www.drupal.org/files/issues/2020-07-03/3156733-2.patch … patching file core/modules/file/migrations/d7_file.yml Applying https://www.drupal.org/files/issues/2020-08-11/2925899-67-9.0.x.patch … patching file core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php patching file core/modules/migrate_drupal_ui/src/Form/CredentialForm.php Hunk #1 succeeded at 189 (offset -4 lines). patching file core/modules/migrate_drupal_ui/src/Form/ReviewForm.php patching file core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php patching file core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php patching file core/modules/migrate_drupal_ui/tests/src/Functional/d7/FilePathTest.php Applying https://www.drupal.org/files/issues/2020-08-18/3165813-2.patch … patching file core/modules/text/src/Plugin/migrate/field/d7/TextField.php Applying https://www.drupal.org/files/issues/2020-08-18/3165944-2.patch … patching file core/modules/shortcut/migrations/d7_shortcut.yml Applying https://www.drupal.org/files/issues/2020-08-24/3166930-4.patch … patching file core/modules/filter/src/Plugin/migrate/process/FilterSettings.php patching file core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php Applying https://www.drupal.org/files/issues/2020-08-25/3167267-7.patch … patching file core/modules/migrate/src/MigrateExecutable.php Hunk #1 FAILED at 187. Hunk #2 succeeded at 221 (offset 4 lines). Hunk #3 succeeded at 253 (offset 4 lines). Hunk #4 FAILED at 272. Hunk #5 succeeded at 448 (offset 7 lines). 2 out of 5 hunks FAILED -- saving rejects to file core/modules/migrate/src/MigrateExecutable.php.rej patching file core/modules/migrate/src/MigrateMessage.php patching file core/modules/migrate/src/Plugin/MigrationInterface.php
-
Okay, we got pretty far. The
3167267-7.patchpatch failed. -
After looking at the corresponding
drupal.orgissue and noticing a Drupal core contributor rerolled the patch, let's update thecurated.jsonfile and see if that works!$ git diff diff --git a/curated.json b/curated.json index 9b2f740..9a9047f 100644 --- a/recommendations.json +++ b/recommendations.json @@ -363,7 +363,7 @@ "Issue #3165813: Undefined index: text_processing in Drupal\\text\\Plugin\\migrate\\field\\d7\\TextField": "https://www.drupal.org/files/issues/2020-08-18/3165813-2.patch", "Issue #3165944: d7_shortcut should not have a required dependency on d7_menu_links": "https://www.drupal.org/files/issues/2020-08-18/3165944-2.patch", "Issue #3166930: Migrated filters may have invalid/incomplete settings applied": "https://www.drupal.org/files/issues/2020-08-24/3166930-4.patch", - "Issue #3167267: MigrateExecutable should catch not only exceptions, but also fatal errors": "https://www.drupal.org/files/issues/2020-08-25/3167267-7.patch", + "Issue #3167267: MigrateExecutable should catch not only exceptions, but also fatal errors": "https://www.drupal.org/files/issues/2020-08-31/3167267-14.patch", "Issue #3176394: Do not migrate comment related configurations if 'comment' wasn't enabled on the source site": "https://www.drupal.org/files/issues/2020-10-13/core-do_not_migrate_comment_configurations_if_comment_wasnt_enabled_on_source-3176394-4--complete.patch", "Issue #3178966: Fatal error in CommentEntityTranslation @MigrationSource when source site does not have comment module installed": "https://www.drupal.org/files/issues/2020-10-26/3178966-3.patch", "Remove certain default content entity types (node, block_content, taxonomy_term, comment) from Drupal's Standard install profile": "https://gist.githubusercontent.com/zolhorvath/28aac78f480e8dcfaf7aaf7426d00f0c/raw/399da3f94b044700fc5e375b1f3fedb40737d4e5/standard-remove_default_content_entity_types.patch"
- Step 3 caused us to detach from the tag we checked out in step 2. This means the
git checkoutcommand yields much more output than usual, but that's harmless:
$ git checkout 9.0.7 && git reset --hard HEAD M core/modules/migrate/src/MigrateExecutable.php M core/modules/migrate/src/MigrateMessage.php M core/modules/migrate/src/Plugin/MigrationInterface.php M core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php Warning: you are leaving 27 commits behind, not connected to any of your branches: 4f080d5a2e AMA PATCH https://www.drupal.org/files/issues/2020-08-24/3166930-4.patch 2a33b01e15 AMA PATCH https://www.drupal.org/files/issues/2020-08-18/3165944-2.patch c94d3b24c6 AMA PATCH https://www.drupal.org/files/issues/2020-08-18/3165813-2.patch 30b17b33d5 AMA PATCH https://www.drupal.org/files/issues/2020-08-11/2925899-67-9.0.x.patch ... and 23 more. If you want to keep them by creating a new branch, this may be a good time to do so with: git branch <new-branch-name> 4f080d5a2e HEAD is now at 3ab4109dd6 Drupal 9.0.7
-
Now try again:
$ sh modules/acquia_migrate/scripts/dev/apply-patches.sh drupal/core ~/Work/acquia-migrate-recommendations/curated.json <snip> Applying https://www.drupal.org/files/issues/2020-08-31/3167267-14.patch … patching file core/modules/migrate/src/MigrateExecutable.php Hunk #1 FAILED at 187. Hunk #2 succeeded at 221 (offset 4 lines). Hunk #3 succeeded at 253 (offset 4 lines). Hunk #4 FAILED at 272. Hunk #5 succeeded at 448 (offset 7 lines). 2 out of 5 hunks FAILED -- saving rejects to file core/modules/migrate/src/MigrateExecutable.php.rej patching file core/modules/migrate/src/MigrateMessage.php patching file core/modules/migrate/src/Plugin/MigrationInterface.php patching file core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php
- Alas! Despite updating the patch, we still see a similar problem. Which means we'll have to reroll this patch.
- Work on rerolling the patch! Did that for this example at https://www.drupal.org/project/drupal/issues/3167267#comment-13888053.
- And now again do the
git checkout 9.0.7+sh modules/acquia_migrate/scripts/dev/apply-patches.sh drupal/core ~/Work/acquia-migrate-recommendations/curated.jsondance of steps 6 and 7. - Success! All patches applied successfully!
- So now that we've been able to verify that we can apply this stack of patches to the new recommended version of the package, it's time to run
make(to incorporate the changes we made tocurated.jsonintorecommendations.json) and create a PR.
Step 3: create a MR
-
Commit your changes to
curated.json:$ git commit -am 'Update recommended version of drupal/core to 9.0.7, update patches.' [core-9.0.7 c79ccff] Update recommended version of drupal/core to 9.0.7, update patches. 1 file changed, 1 insertion(+), 1 deletion(-)
-
Create a drupal.org issue and create a merge request (MR).
-
Follow the instructions on drupal.org to get the merge request's branch locally. Then
git cherry-pickthe commit you just made. We'll continue in this branch. -
Next, update
recommendations.jsonbased on our changes tocurated.json:$ make scripts/create-fallback-json.sh curated.json generated.json > fallback.json jq -s '{data: ([.[].data] | flatten)}' curated.json fallback.json | ./scripts/normalize-json.sh > recommendations.json scripts/create-statistics.sh curated.json generated.json recommendations.json > statistics.txt make normalize for file in recommendations.json curated.json generated.json; do \ ./scripts/normalize-json.sh < $file > tmp.json ; \ mv tmp.json $file ; done rm fallback.json -
Commit the generated
recommendations.json:$ git commit -am 'make' [core-9.0.7 9a5a5c2] make 1 file changed, 1 insertion(+), 1 deletion(-)
-
And finally, push this branch as a merge request, per the instructions on the drupal.org issue, and mark the issue as "Needs review"!
Step 4: special case: the drupal/core package
Now, there is one special extra step when updating the drupal/core recommendation, because the AM:A Drupal module needs some core patches to be applied to be able to function!
Let's find out if those still work:
- Let's redo step 8 of CONTRIBUTING.md:
$ jq -r '.extra.patches["drupal/core"] | to_entries | .[].value' modules/acquia_migrate/composer.json | while read p; do echo "Applying AMA-required core patch $p ..."; curl -Ls $p | patch -p1; git commit -a -nm "AMA-required patch $p"; echo ""; done Applying AMA-required core patch https://gist.githubusercontent.com/wimleers/4c8742d5efb74ea5dad1475b4478bd40/raw/99e35617a292b730fdbb36be4f3ce48d5c9863a1/migration-metadata.patch ... patching file core/modules/migrate/src/Plugin/Migration.php Hunk #1 succeeded at 714 (offset 9 lines). patching file core/modules/migrate/src/Plugin/MigrationInterface.php Hunk #1 succeeded at 334 (offset 5 lines). [detached HEAD 0fbd100bf0] AMA-required patch https://gist.githubusercontent.com/wimleers/4c8742d5efb74ea5dad1475b4478bd40/raw/99e35617a292b730fdbb36be4f3ce48d5c9863a1/migration-metadata.patch 2 files changed, 20 insertions(+) Applying AMA-required core patch https://gist.githubusercontent.com/wimleers/47b888f3abbddbeae66a915fd690691e/raw/c96e2265aae3d496b8a47f1898a5c5b5bde210dd/track_changes_should_not_prevent_efficient_imports.patch ... patching file core/modules/migrate/src/Plugin/migrate/source/SqlBase.php [detached HEAD d06e2c9a9f] AMA-required patch https://gist.githubusercontent.com/wimleers/47b888f3abbddbeae66a915fd690691e/raw/c96e2265aae3d496b8a47f1898a5c5b5bde210dd/track_changes_should_not_prevent_efficient_imports.patch 1 file changed, 7 insertions(+), 2 deletions(-) Applying AMA-required core patch https://gist.github.com/wimleers/33b25a664c31350bb04120a1a9c463e6/raw/2037ba993fb8fb1081378e0a8561c59849f097c6/sql_base_source_plugin_cache_counts_support.patch ... patching file core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php patching file core/modules/migrate/src/Plugin/migrate/source/SqlBase.php [detached HEAD f748f5eab1] AMA-required patch https://gist.github.com/wimleers/33b25a664c31350bb04120a1a9c463e6/raw/2037ba993fb8fb1081378e0a8561c59849f097c6/sql_base_source_plugin_cache_counts_support.patch 2 files changed, 6 insertions(+), 2 deletions(-)
- They do still apply — yay! Our job is almost done.
-
If we'd have to update the patches, then we'd also have to update:
acquia_migrate.info.yml— bumpcore_version_requirementto9.0.7, to ensure Drupal won't allow the AM:A Drupal module to be installed unless Drupal core 9.0.7 is installed.composer.json— bumprequire.drupal/corefrom^9.0.6to^9.0.7, to ensurecomposerwon't allow this AM:A package to be installed unlessdrupal/core9.0.7is installed.- But in this example, that was unnecessary!
But what we do need to do is bump the version in https://git.drupalcode.org/project/acquia_migrate/-/blob/1.8.x/.gitlab-ci.yml, since the "next recommendations" CI jobs would otherwise still end up installing Drupal the previous Drupal version, which obviously will not apply if we've just changed the patch stack!
Since AM:A specifically requires core patches, which are highly version-dependent, we need to update AM:A's test suite to run against that specific core version. So we'll need to update theAMA__DRUPAL_CORE_VERSIONvariable in there to9.0.7.
We'll also need to bump theAMA__RECOMMENDATIONS__VERSIONvariable.
To check whether the core update actually causes failures in our tests, you can setAMA__RECOMMENDATIONS__VERSIONto the branch name of the PR we just pushed to the MR branch, something like:core-9.0.7.That looks like this:
-
$ git show commit b65f591bf2e14e001c0a4bd84e2296f0f045f1f0 (HEAD -> OCTO-3752/core-9.0.7, origin/OCTO-3752/core-9.0.7) Author: Wim Leers <wim.leers@acquia.com> Date: Fri Oct 30 16:18:27 2020 +0100 Bump the core version to use to 9.0.7, and update to use the matching acquia-migrate-recommendations PR. diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2894ff2..4dcb55b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,8 +29,8 @@ include: # Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml ################ variables: - AMA__DRUPAL_CORE_VERSION: 9.5.8 - AMA__RECOMMENDATIONS__VERSION: '2023-09-27' + AMA__DRUPAL_CORE_VERSION: 9.5.11 + AMA__RECOMMENDATIONS__VERSION: core-9.5.11 D7_VERSION: '7.82' D7_DIR: www.standard-profile-$D7_VERSION.com # Test using $AMA__DRUPAL_CORE_VERSION instead of $CORE_SUPPORTED.
- This particular merge request (a pull request on GitHub originally, prior to open sourcing) triggered a number of test failures, because Drupal
9.0.7changed the Drupal 7 source DB fixture since9.0.6. So we had to update our test expectations accordingly. They all made sense.
Note: the "next recommendations" test jobs are allowed to fail, and when updating the core version they will fail, because they'll continue to install the previous core version — because the "next recommendations" test job always installs therecommendations's branch latest commit (HEAD).
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion