Trying to run a D7 to D10 migration, the process stops

LogicException: The currently known shared structure migrations do not have any dependencies. This assumption does not hold for focal_point_crop. It depends on: d7_file, d7_user, d7_user_role, d7_filter_format, d7_field_instance:field_collection_item:field_education, d7_field:field_collection_item, d7_node_type:article, [...], user_picture_field_instance, user_picture_field, user_picture_entity_display, user_picture_entity_form_display, focal_point_crop_type, focal_point_settings. in Drupal\acquia_migrate\Clusterer\Heuristics\SharedEntityStructure->matches() (line 181 of /var/www/docroot/modules/contrib/acquia_migrate/src/Clusterer/Heuristics/SharedEntityStructure.php).

I can solve this error by replacing in composer.json

"drupal/focal_point": {
  "[AMA_MIGRATE_FIX] Issue #3267350: Migrate Focal Point module from D7 to D9.": "https://www.drupal.org/files/issues/2022-05-06/focal_point-migrate-3267350-28.patch"
            },

by

"drupal/focal_point": {
  "Migrate Focal Point module from D7 to D9.": "https://www.drupal.org/files/issues/2023-08-18/focal_point-migrate-3267350-31.patch"

},

CommentFileSizeAuthor
#11 Screenshot 2023-12-08 at 2.17.55 PM.png130.33 KBwim leers
Command icon 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:

Comments

vistree created an issue. See original summary.

wim leers’s picture

Title: PHP error - Focus point patch needs update » [PP-1] PHP error - Focus point patch needs update
Component: Code » Recommendations
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)
Related issues: +#3267350: Migrate Focal Point module from D7 to D9.

Thanks for the report!

This actually might mean that we'll need to refine #3267350: Migrate Focal Point module from D7 to D9..

It depends on: d7_file, d7_user, d7_user_role, d7_filter_format, d7_field_instance:field_collection_item:field_education, d7_field:field_collection_item, d7_node_type:article, [...], user_picture_field_instance, user_picture_field, user_picture_entity_display, user_picture_entity_form_display, focal_point_crop_type, focal_point_settings.

But https://www.drupal.org/files/issues/2023-08-18/focal_point-migrate-32673... shows:

diff --git a/migrations/focal_point_crop.yml b/migrations/focal_point_crop.yml
new file mode 100644
index 0000000..332f9d3
--- /dev/null
+++ b/migrations/focal_point_crop.yml
@@ -0,0 +1,37 @@
+id: focal_point_crop
…
+migration_dependencies:
+  required:
+    - d7_file
+    - d7_file_private
+    - focal_point_crop_type
+    - focal_point_settings

So where did all those other migration dependencies come from? Something must be setting them. It is impossible to reproduce without both your full Drupal 7 DB + your D9 composer.json.

Please put a breakpoint in the logic that collects all migration definitions, and observe which alter hook is for example adding d7_node_type:article as a a migration dependency — because it definitely makes no sense that the focal point migration depends on that!

vistree’s picture

Hi Wim,
I don't really understand what you want me to do. It seems enough to make sure to use the latest patch from https://www.drupal.org/project/focal_point/issues/3267350
Acquia Migrate adds patch from #28
I replaced it with patch from #31 - and everything works fine ;-)

The other requirements seem to be related to my special D7 source. No real need to debug that one.

wim leers’s picture

Title: [PP-1] PHP error - Focus point patch needs update » Apply a newer focal_point migration patch to prevent error in some scenarios
Category: Bug report » Task
Status: Postponed (maintainer needs more info) » Active

Ahhh! 😄

I totally misunderstood your original report!

Can you please create a merge request against the recommendations branch? 🙏😊 The 28-to-31 patch seems like a very reasonable, minor change 👍

Looking forward to merging this!

wim leers’s picture

Ah yes, you _must_ create a merge request using the GitLab CI UI, because you need to target the recommendations branch, not the 1.8.x branch. That's a bit confusing with the transition to GitLab CI… 😬

vistree’s picture

Sorry, I accidently pressed the "create MR" in this ticket - without even downloading the branch ;-(
What do I exactly need to do? In the branch I can't find any of the patches shown in my project. I guess, they are created by the alma script when installing the local Drupal 9 site and starting the initial migration.
Can I add the patch as normal to the composer.json within the root folder of the branch?

wim leers’s picture

Assigned: Unassigned » wim leers

I'll take this on — this will serve as a sample MR for one of the most common patterns of changes then 👍

wim leers’s picture

Title: Apply a newer focal_point migration patch to prevent error in some scenarios » Update: focal_point migration patch in #3267350 (to prevent error in some scenarios)
Status: Active » Needs review
StatusFileSize
new130.33 KB

I followed the official handbook page for this process

  1. Step 1: no issues.
  2. Step 2: … because this is a single patch, I won't verify this manually locally, I'll just let CI do this for me 😄

Then after following the instructions here on the d.o issue to push my locally created branch to this issue's fork:

wim.leers at MacBookPro-WimLeers in ~/Work/acquia-migrate-recommendations on recommendations*
$ git checkout -b focal_point-3267350-31
Switched to a new branch 'focal_point-3267350-31'
…
# PERFORM STEPS 1 AND 2 ABOVE
…
wim.leers at MacBookPro-WimLeers in ~/Work/acquia-migrate-recommendations on focal_point-3267350-31*
$ git push --set-upstream acquia_migrate-3393712 HEAD
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 10 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (15/15), 4.95 KiB | 4.95 MiB/s, done.
Total 15 (delta 11), reused 2 (delta 1), pack-reused 0
remote: 
remote: To create a merge request for focal_point-3267350-31, visit:
remote:   https://git.drupalcode.org/issue/acquia_migrate-3393712/-/merge_requests/new?merge_request%5Bsource_branch%5D=focal_point-3267350-31
remote: 
To git.drupal.org:issue/acquia_migrate-3393712.git
 * [new branch]      HEAD -> focal_point-3267350-31
branch 'focal_point-3267350-31' set up to track 'acquia_migrate-3393712/focal_point-3267350-31'.
wim.leers at MacBookPro-WimLeers in ~/Work/acquia-migrate-recommendations on focal_point-3267350-31*

… followed by generating a merge request from this branch:

Now the CI pipeline is running to test it: https://git.drupalcode.org/project/acquia_migrate/-/pipelines/61079! 👍

wim leers’s picture

Issue tags: +example

Now we wait and see if the CI job passes! 👀

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community

Yay, that's green! 🟢

Once we merge this, then if the module's test suite runs again (currently the 1.8.x branch), then if all is well, the "pinned recommendations" CI jobs should continue to apply the old patch, and the "next recommendations" CI jobs should apply the new patch 👍

Our job here is done — the only reason I'm not yet merging this is to not disrupt #3406774: Update: drupal/core:9.5.11, which is more complicated. I'll land this after that 👍

wim leers’s picture

Rebased on top of #3406774: Update: drupal/core:9.5.11, and still passes, so 🚢!

  • Wim Leers committed 89646b01 on recommendations
    Issue #3393712 by Wim Leers, vistree: Update: focal_point migration...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed
wim leers’s picture

vistree’s picture

Thanx @Wim Leers !!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rajeshreeputra’s picture