'migrate status MIGRATION' loads every migration

Created on 3 May 2018, over 6 years ago
Updated 6 September 2024, 3 months ago

The migrate list command calls $manager->createInstances() with an empty array, which instantiates all the migration plugins.

It would be better to filter on migration IDs, groups, and tags based on the plugin definitions, and then only instantiate the plugins actually needed.

Firstly, it would improve performance, and second, instantiating migrations causes their requirements to be checked, which might not be desirable. (Though a bug in core means that some migrations check requirements even without being instantiated: #3187480: D6NodeDeriver calls checkRequirements() when building migration plugin definitions β†’ .)

πŸ› Bug report
Status

Needs review

Version

6.0

Component

Drush commands

Created by

πŸ‡¬πŸ‡§United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom joachim

    Rebased the MR on the 6.0.x branch.

  • Pipeline finished with Failed
    about 1 year ago
    #42222
  • Pipeline finished with Failed
    about 1 year ago
    #42223
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update about 1 year ago
    22 pass, 2 fail
  • Pipeline finished with Failed
    about 1 year ago
    #42224
  • πŸ‡¬πŸ‡§United Kingdom joachim

    Rebased.

  • Pipeline finished with Failed
    7 months ago
    Total: 293s
    #161476
  • Pipeline finished with Failed
    7 months ago
    Total: 222s
    #161499
  • πŸ‡¬πŸ‡§United Kingdom joachim

    Drupal\Tests\migrate_tools\Kernel\MigrateImportTest::testImport passed for me locally.

  • Pipeline finished with Failed
    3 months ago
    Total: 315s
    #260235
  • πŸ‡ΊπŸ‡ΈUnited States ronchica

    FWIW, I needed this patch in order to be able to import or check the status of a migration group.

    Due to a dependency, I needed to enable the Migrate Drupal module, which appears to add some migrate plugins to the available list of plugins. I kept getting a '/SQLSTATE[HY000] [2002] Connection refused' error when trying to run the migration group (a single migration ran fine).

    After a bunch of time thinking the issue was with my DDEV setup, I debugged using xdebug, found all those plugins trying to connect to a non-existent db, which led me to this issue. Applying the patch enables the status and import commands to work on a migration group, and the import looks good. I still get the connection error once in a while though, so there might be something else that needs to be fixed in my case.

Production build 0.71.5 2024