Acquia Migrate patch breaks migrations when Acquia Migrate not installed

Created on 8 October 2023, about 1 year ago
Updated 5 January 2024, 11 months ago

Problem/Motivation

I'm working on a multisite project in which some sites are not using Acquia Migrate for their migrations while others plan to use it. Downloading, but not installing, Acquia Migrate breaks migrations.

(Tangentially related issue: would like the ability to download migrate_tools while Acquia Migrate is in the same codebase: https://www.drupal.org/project/drupal/issues/3391733 ✨ Support downloading conflicting modules within multisite codebases Active )

Steps to reproduce

1. Download Acquia Migrate but do not install it
2. Clear cache & run a migration
The following error is thrown:

Error: Class "Drupal\acquia_migrate\Batch\MigrationBatchManager" not found in /var/www/html/docroot/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php on line 430 #0 /var/www/html/docroot/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php(282): Drupal\migrate\Plugin\migrate\source\SqlBase->mapJoinable()

Proposed resolution

Update the following patch to account for the module not-being installed: https://gist.githubusercontent.com/wimleers/47b888f3abbddbeae66a915fd690...

Remaining tasks

I plan to submit a PR shortly.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Fixed

Version

1.8

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ashrafabed

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

Merge Requests

Comments & Activities

  • Issue created by @ashrafabed
  • πŸ‡ΊπŸ‡ΈUnited States ashrafabed
  • πŸ‡ΊπŸ‡ΈUnited States ashrafabed

    The module includes a patch by URL. I'm attaching a new version of the patch so the same approach can be used.

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States ashrafabed

    Please review and merge, if possible. Thank you for your time.

  • Status changed to RTBC about 1 year ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Hiya, @ashrafabed! 😊 Thanks for taking the time to report this and providing a solution! πŸ™

    Downloading, but not installing, Acquia Migrate breaks migrations.

    What does this mean? Composer-installing it, but not Drupal-installing it?

    I'd like to understand why you'd install the AM:A module (and indeed have its core patches applied) using Composer, only to then not actually use it? πŸ€”πŸ˜…

    Still, I'll never oppose pragmatism and supporting more use cases, especially for anything migration-related! πŸ˜„

    I'll help shepherd this MR to pass tests. It looks like the d.o GitLab template does not play nice with contrib modules 😬

  • πŸ‡ΊπŸ‡ΈUnited States ashrafabed

    "What does this mean? Composer-installing it, but not Drupal-installing it?"
    Exactly :)

    The use case is a multisite codebase. All sites use the migrate module, but only some sites use Acquia Migrate. The error is thrown on the sites which don't use Acquia Migrate.

    Thanks for the help!

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    That makes sense. Drupal's migration system is unfortunately not designed to migrate a multisite at once β€” you have to do it site-per-site, which clearly you're very aware of. πŸ‘πŸ˜…

    Next week I'll be at DrupalCon. The week after DrupalCon, I'll be working on lots of GitLab CI-related things. I'll tackle this then, because that's the only blocker here: getting it to pass on GitLab CI! Feel free to apply this patch for now, I promise that the 1.8.1 patch release will include this change 😊

    Thanks again! πŸ™

  • Assigned to wim leers
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Later than planned, but will get to this next week β€” I've followed up on all issues by now :)

  • Status changed to Needs review 11 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Last week was … the most hectic one of 2023. So, delayed by a week, but here I am!

  • Issue was unassigned.
  • Status changed to RTBC 11 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    After a whole saga with GitLab CI infrastructure/reliability/load, turns out we need zero changes to the CI setup.

    Let's get this in at last!

  • Status changed to Fixed 11 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Back when AM:A was closed source, there were some complications to the release process. But now … it's just a simple git checkout 1.8.x && git pull && git tag 1.8.1 && git push --tags πŸ‘

    https://www.drupal.org/project/acquia_migrate/releases/1.8.1 β†’

  • πŸ‡ΊπŸ‡ΈUnited States ashrafabed

    Very nice - thank you for working on this!

  • Status changed to Fixed 11 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024