Remove mimimum_version and requirements_met from MigrateSource attribute class

Created on 12 April 2025, 11 days ago

Problem/Motivation

The MigrateSource annotation class has several properties that are used only (?) in the migrate_drupal module:

  • minimum_version
  • requirements_met
  • source_module

In πŸ“Œ Convert MigrateSource plugin discovery to attributes Active , we deprecated the annotation class in favor of the new attribute class, and in πŸ“Œ Move source_module and destination_module from Migrate to Migrate Drupal Needs work we remove the source_module property from the attribute class. In that issue, we also decided to continue using the annotation class for all source plugins that extend DrupalSqlBase, which is part of the migrate_drupal module.

Proposed resolution

Remove minimum_version and requirements_met from the MigrateSource attribute class.

Remaining tasks

User interface changes

None

Introduced terminology

None

API changes

Remove two properties from the attribute class used to define migration source plugins.

That attribute class is not yet part of a release, so we do not have to worry about backwards compatibility (BC) if we do this before Drupal 11.2.0 is released.

Data model changes

None

Release notes snippet

N/A

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

migration system

Created by

πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

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

Comments & Activities

  • Issue created by @benjifisher
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    It is pretty clear that requirements_met is used only in the migrate_drupal module:

    $ grep -ril minimum_version core/modules/mig*
    core/modules/migrate/src/Attribute/MigrateSource.php
    core/modules/migrate/src/Annotation/MigrateSource.php
    core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
    core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php
    

    The situation is less clear for requirements_met:

    $ grep -ril requirements_met core/modules/mig*
    core/modules/migrate/tests/modules/migrate_events_test/src/Plugin/migrate/destination/DummyDestination.php
    core/modules/migrate/tests/modules/migrate_missing_database_test/src/Plugin/migrate/source/MigrateMissingDatabaseSource.php
    core/modules/migrate/tests/src/Kernel/SqlBaseTest.php
    core/modules/migrate/src/Plugin/Derivative/MigrateEntityRevision.php
    core/modules/migrate/src/Plugin/Derivative/MigrateEntityComplete.php
    core/modules/migrate/src/Plugin/Derivative/MigrateEntity.php
    core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php
    core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php
    core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
    core/modules/migrate/src/Attribute/MigrateDestination.php
    core/modules/migrate/src/Attribute/MigrateSource.php
    core/modules/migrate/src/Annotation/MigrateDestination.php
    core/modules/migrate/src/Annotation/MigrateSource.php
    core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
    core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php
    core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php
    core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php
    

    Many (most? all?) of those uses refer to requirements_met in the MigrateDestination annotation and attribute classes. The attribute class is already part of Drupal 11.1.0, so it is too late to remove properties from that class without first deprecating them. But I think we can remove requirements_met from the attribute class.

  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    I think the only place in the migrate module, outside of tests, where requirements_met refers to the source plugin (not the destination plugin) is SqlBase::checkRequirements().

Production build 0.71.5 2024