Convert MigrateSource plugin discovery to attributes

Created on 13 February 2024, 9 months ago
Updated 27 February 2024, 9 months ago

Problem/Motivation

In 📌 Use PHP attributes instead of doctrine annotations Fixed we added support for attribute based plugin discovery.
As part of that issue we converted block and action plugins.

This issue is to convert \Drupal\migrate\Annotation\MigrateSourceplugins to use Attributes.

Proposed resolution

  1. Add a class to represent the new Attribute - Example
  2. Update the plugin manager constructor to include both the attribute and annotation class names - example
  3. Convert all plugins that use the annotation to use the new attribute - example

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
Migration 

Last updated 1 day ago

Created by

🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

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

Merge Requests

Comments & Activities

  • Issue created by @larowlan
  • First commit to issue fork.
  • Pipeline finished with Failed
    9 months ago
    Total: 190s
    #104637
  • Status changed to Needs review 9 months ago
  • Pipeline finished with Failed
    9 months ago
    Total: 183s
    #104641
  • Pipeline finished with Failed
    9 months ago
    Total: 319s
    #104645
  • Pipeline finished with Failed
    9 months ago
    Total: 557s
    #104647
  • Status changed to Needs work 9 months ago
  • 🇺🇸United States smustgrave

    Seems to have test failures.

  • 🇮🇳India mohit_aghera Rajkot

    Note: BC approach to handle annotations and attributes in MigratePluginManager class is being evaluated in https://www.drupal.org/project/drupal/issues/3424509 📌 Update MigratePluginManager to include both attribute and annotation class Fixed

    We should revisit and rebase this PR after this is resolved.

  • Status changed to Postponed 9 months ago
  • Status changed to Needs work 8 months ago
  • 🇬🇧United Kingdom catch
  • First commit to issue fork.
  • Pipeline finished with Failed
    8 months ago
    #136975
  • There are currently 5 source plugins that do not have source_module in their annotations, all in test modules. One plugin, with ID no_source_module<code> is meant to throw an exception for missing source module in <code>Drupal\Tests\migrate_drupal_ui\Functional\SourceProviderTest. Otherwise the source_module in source plugins were optional, except if migrate_drupal is enabled and the migrations are tagged. See Drupal\migrate_drupal\MigrationPluginManager::processDefinition() and ::getEnforcedSourceModuleTags()<code>. Now that <code>source_module is a required property in the MigrateSource attribute from 📌 Update MigratePluginManager to include both attribute and annotation class Fixed , this functionality becomes redundant. Is requiring source_module also a BC break? It's somewhat mitigated, since contrib or custom source plugins missing that property in the annotation can have that property added when they are converted to attributes. But maybe a CR is needed to document the new requirement?

  • 🇳🇿New Zealand quietone

    source_module has been required since 8.5, see https://www.drupal.org/node/2911881 and https://www.drupal.org/node/2914530 . However, it should just been when migrate_drupal is installed.

  • Status changed to Postponed 8 months ago
  • Status changed to Active 7 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍
  • Pipeline finished with Failed
    7 months ago
    Total: 188s
    #138863
  • Status changed to Needs work 7 months ago
  • Added the part of the reverted commit for 📌 Update MigratePluginManager to include both attribute and annotation class Fixed that handled migrate source plugins and automated/multiple providers.

    As for what to do about the source_module property in the migrate source attribute? I think there are two options:

    IMO, we can make source_module an optional property now. There is code in the migrate_drupal module (See Drupal\migrate_drupal\MigrationPluginManager::processDefinition() and ::getEnforcedSourceModuleTags()) that already requires that property on migrate_drupal sources.

    Deprecating the property from the attribute can be handled in 📌 Move source_module and destination_module from Migrate to Migrate Drupal Needs work if needed there. There may also be BC concerns if contrib/custom modules have implemented source plugins that use source_module somehow in a custom way that has nothing to do with migrate_drupal.

  • Pipeline finished with Failed
    7 months ago
    Total: 600s
    #138902
  • Pipeline finished with Failed
    7 months ago
    Total: 691s
    #139003
  • Pipeline finished with Failed
    7 months ago
    Total: 628s
    #139022
  • Pipeline finished with Failed
    7 months ago
    Total: 630s
    #139102
  • Made changes to the migrate source attribute:

    • source_module is optional
    • minimum_version defaults to NULL instead of '' (this is need to pass tests because there is an isset check)
    • fixed some tests to match attribute/definition property order
    • Properly filter out plugins based on the providers property (as well as provider, singular)

    I believe all the remaining tests failures are occurring because there are source plugins using the Drupal\content_translation\Plugin\migrate\source\I18nQueryTrait from the content_translation module that is not enabled. These are the plugins:

    • Drupal\menu_link_content\Plugin\migrate\source\d6\MenuLinkTranslation
    • Drupal\menu_link_content\Plugin\migrate\source\d7\MenuLinkTranslation
    • Drupal\block_content\Plugin\migrate\source\d7\BlockCustomTranslation
    • Drupal\taxonomy\Plugin\migrate\source\d7\TermLocalizedTranslation

    An fatal error occurs when Drupal\Component\Plugin\Discovery\AttributeClassDiscovery::parseClass() tries to instantiate a ReflectionClass on these plugin classes using that trait. This is similar to 📌 Hidden dependency on block_content in layout_builder Needs work . Likely there will be need to be an overall solution for plugin classes.

  • 🇳🇿New Zealand quietone

    I think we could make a MigrateSourceDrupal attribute that has the source_module. I have make a test of that at https://git.drupalcode.org/project/drupal/-/merge_requests/5316. Unfortunately that has failing functional tests and those tests pass locally. I don't know why yet.

  • Pipeline finished with Failed
    7 months ago
    Total: 616s
    #139665
  • Pipeline finished with Failed
    7 months ago
    Total: 604s
    #139671
  • Pipeline finished with Failed
    7 months ago
    #139684
  • Pipeline finished with Failed
    7 months ago
    Total: 636s
    #139706
  • Made an effort to see if I could at least get tests to pass:

    • Restored annotations to the plugins that use I18nQueryTrait
    • Add exception handling to AttributeClassDiscovery::parseClass when the ReflectionClass is instantiated. This safely handles classes that extend unknown classes, of which there was at least one: Drupal\field\Plugin\migrate\source\d6\FieldInstancePerViewMode extending Drupal\node\Plugin\migrate\source\d6\ViewModeBase

    I'm not sure why some tests are still failing in CI. I've run a couple of them locally and they pass.

    In any case, there does need to be a solution for any plugin class that either:

    • Uses a Trait from another module that may not be installed
    • Implements an Interface from another module that may not be installed
    • Extends a class from another module that may not be installed

    Handling extends is straightforward, since an exception is thrown in that case, but unknown interfaces and traits lead to fatal errors. Does it make sense to create a separate issue for that?

  • 🇨🇭Switzerland berdir Switzerland

    Left some comments on hopefully pragmatic solutions for these cases.

    If that doesn't work out somehow then +1 to skip problematic ones in this first pass and deal with them in a separate and smaller issue, so that we can unblock the deprecation of plugin managers that don't support attributes.

  • Pipeline finished with Failed
    7 months ago
    Total: 170s
    #139780
  • Pipeline finished with Failed
    7 months ago
    Total: 701s
    #139790
  • Pipeline finished with Failed
    7 months ago
    Total: 630s
    #139804
  • Made the change to move the trait to the migrate module, and removed all the annotations from the plugin classes in question. I've also added a CR for the trait move.

    I'm not sure what's going on, because the functional tests failing in CI are passing on my local.

    The functional javascript failures I can reproduce on local, but I'm failing to see how they're related. They're also failing in the same way on my local against 11.x, so I'm not sure what's going on there.

    Remaining todo:

    • Getting tests passing on CI
    • Add deprecation test for the trait?
  • 🇨🇭Switzerland berdir Switzerland

    There are some HEAD test fails that have been fixed and also some known random fails ( 📌 [random test failures] Use key/value directly instead of state in test modules Active but I also can't reproduce the migrate fails locally.

    You can download the artifact of e.g. https://git.drupalcode.org/issue/drupal-3421014/-/jobs/1261546 and look at the browser output, but I'm not seeing anything obvious from that from a quick look.

  • I did take a look at the browser output yesterday, and what's happening is that on CI, when posting to the ID Conflict form, somehow it's being redirected back to first step. Locally, this redirect isn't happening. I assume the code responsible is this, but I have no idea why: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/migra...

        // Get all the data needed for this form.
        $migrations = $this->store->get('migrations');
    
        // If data is missing or this is the wrong step, start over.
        if (!$migrations || ($this->store->get('step') != 'idconflict')) {
          return $this->restartUpgradeForm();
        }
    
    
  • Pipeline finished with Failed
    7 months ago
    Total: 219s
    #141017
  • Pipeline finished with Failed
    7 months ago
    Total: 750s
    #141022
  • Pipeline finished with Failed
    7 months ago
    Total: 727s
    #141062
  • Pipeline finished with Failed
    7 months ago
    Total: 172s
    #141079
  • Pipeline finished with Failed
    7 months ago
    Total: 627s
    #141084
  • Pipeline finished with Failed
    7 months ago
    Total: 170s
    #141124
  • Pipeline finished with Failed
    7 months ago
    Total: 723s
    #141130
  • I was wrong about which code is leading to the redirect. It's actually a bit further down in the same method: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/migra...

        if ($content_conflicts || $translated_content_conflicts) {
    ...
        }
        else {
          $this->store->set('step', 'review');
          return $this->redirect('migrate_drupal_ui.upgrade_review');
        }
    
    

    What is expected is that $translated_content_conflicts should not be empty, but it looks like migration discovery from the previous form (CredentialForm.php) is not finding the same migration plugins on CI as on my local (ddev).

    I've pushed some debug code to try to see what's going on, but no conclusions yet.

  • Pipeline finished with Failed
    7 months ago
    Total: 958s
    #142010
  • Pipeline finished with Failed
    7 months ago
    Total: 174s
    #142040
  • Pipeline finished with Failed
    7 months ago
    Total: 174s
    #142045
  • Pipeline finished with Failed
    7 months ago
    #142055
  • Pipeline finished with Failed
    7 months ago
    Total: 995s
    #142121
  • Pipeline finished with Failed
    7 months ago
    Total: 174s
    #142167
  • Pipeline finished with Failed
    7 months ago
    Total: 988s
    #142170
  • Pipeline finished with Failed
    7 months ago
    Total: 164s
    #142424
  • Pipeline finished with Failed
    7 months ago
    Total: 1137s
    #142427
  • Pipeline finished with Canceled
    7 months ago
    Total: 828s
    #142439
  • Pipeline finished with Failed
    7 months ago
    Total: 958s
    #142448
  • It's been a couple days since I last took a crack at it, but an update for others who might work on this:

    I still haven't found the root cause for the test failures. I have found that certain migration plugins, such as d6_action are found by YamlDirectoryDiscovery in MigrationPluginManager::getDiscovery(), but those plugins are then filtered out by the NoSourcePluginDecorator. This means that the source plugins those migrations are using are not being found.

    I've also found that the list of source plugins returned from $definitions = $this->getDiscovery()->getDefinitions(); in MigrateSourcePluginManager::findDefinitions() is unchanged after being filtered by the ProviderFilterDecorator, so it seems that setting multiple providers on the attribute recursively by namespace seems to be working correctly. But I'm not sure why discovery is not picking up the source plugins before that, and I still haven't been able to reproduce the failures locally. Since I run the local tests individually, but CI runs them serially, I had a guess that perhaps there was an issue with the file cache persisting incorrectly between tests, , but that does not seem to be the case.

  • Pipeline finished with Failed
    7 months ago
    #144603
  • Pipeline finished with Failed
    7 months ago
    #144608
  • Pipeline finished with Success
    7 months ago
    Total: 1168s
    #145414
  • Pipeline finished with Success
    7 months ago
    Total: 1110s
    #145431
  • Status changed to Needs review 7 months ago
  • Tests are finally all green. It was the file cache after all. For any plugin extending a class from an uninstalled module, catching the exception and returning NULL values was resulting in the file cache storing NULL as the value for the plugin definition. Since the cache persists as long as the file is not changed, this meant that even installing the relevant modules did not make the plugin definition discoverable. So instead of catching the exception in parseClass, the exception is caught by the calling function and the plugin is skipped from being stored in file cache.

    I think this should be ready for review. Unless the deprecation of the I18nQueryTrait needs a test?

  • Status changed to Needs work 7 months ago
  • 🇳🇿New Zealand quietone

    @godotislate, thanks for working on this. I skimmed through the MR and I appreciate the clear comments throughout. There are two comments on the MR that need attention.

    Because of the extra changes needed to make source plugin work as attributes I think it would help other reviewers if the Issue Summary was updated with the key findings and changes.

  • Pipeline finished with Success
    7 months ago
    Total: 1080s
    #147190
  • I believe latest review comments have been addressed. Updated IS and putting back for review.

  • Status changed to Needs review 7 months ago
  • Pipeline finished with Success
    7 months ago
    Total: 1777s
    #149166
  • Pipeline finished with Failed
    7 months ago
    #150510
  • Status changed to Needs work 7 months ago
  • The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Pipeline finished with Failed
    7 months ago
    Total: 188s
    #150513
  • Pipeline finished with Success
    7 months ago
    #150518
  • Status changed to RTBC 7 months ago
  • Rebased, added deprecation test for I18nQueryTrait.

  • Status changed to Needs review 7 months ago
  • Whoops, meant to put back in Needs Review.

  • 🇺🇸United States smustgrave

    Should the changes to Discovery files be done in separate issue? Since it'll apply to everything.

  • Pipeline finished with Failed
    7 months ago
    Total: 502s
    #153442
  • Pipeline finished with Failed
    7 months ago
    Total: 188s
    #153472
  • Pipeline finished with Failed
    7 months ago
    Total: 187s
    #153505
  • Pipeline finished with Success
    7 months ago
    Total: 988s
    #153515
  • Status changed to Needs work 7 months ago
  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Pipeline finished with Success
    7 months ago
    Total: 501s
    #156408
  • Status changed to Needs review 7 months ago
  • Should the changes to Discovery files be done in separate issue? Since it'll apply to everything.

    That can be done if needed or preferred, but MigrateSource plugins currently are the only type with multiple providers, so the discovery changes really affects those and is a blocker.

  • Pipeline finished with Success
    7 months ago
    Total: 537s
    #159791
  • Status changed to RTBC 7 months ago
  • 🇺🇸United States smustgrave

    Guess no need to break out and delay this ticket as probably important to include in 11.x and 10.3.x

    Rebased just to make sure none of the recent change broke anything, didn't obviously.

    This has gone through a few reviews it seems so believe this is good

  • Status changed to Needs review 7 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    We've had this issue with plugins and implicit dependencies before. The way in which static reflection allows you to load code that depends on non-existing things is extremely problematic. I think we need to come up with a better way to support this via discovery than eating exceptions. Or if we're going to eat exceptions then only do this in the migrate source case for now and open a follow-up issue to fix this in a better way.

  • Pipeline finished with Success
    7 months ago
    Total: 515s
    #160522
  • Or if we're going to eat exceptions then only do this in the migrate source case for now and open a follow-up issue to fix this in a better way.

    Made a change so that the exception is eaten only for migrate source in the attribute automated providers discovery classes. Made an effort to do that while minimizing code duplication, but it's still pretty ugly. I also tried to limit the exception being eaten based on the error message matching "Interface X not found" or "Class X not found."

    I can open a follow up for a better general solution if this approach for migrate source looks fine for now. Or maybe that can be part of #2786355: Move multiple provider plugin work from migrate into core's plugin system ?

  • Pipeline finished with Failed
    7 months ago
    Total: 265s
    #160866
  • Pipeline finished with Success
    7 months ago
    Total: 616s
    #160883
  • Status changed to Needs work 7 months ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Left a review on the MR - nice work - this looks like a gnarly one

  • Pipeline finished with Failed
    7 months ago
    Total: 576s
    #163081
  • Pipeline finished with Success
    7 months ago
    Total: 534s
    #163096
  • Status changed to Postponed 7 months ago
  • Blocked on deprecating I18nQueryTrait and the plugin classes that use it, and moving them to migrate_drupal in 🐛 Move I18nQueryTrait from content_translation to migrate_drupal Needs review .

    Updated IS with remaining tasks

  • Pipeline finished with Failed
    6 months ago
    Total: 184s
    #172793
  • Pipeline finished with Failed
    6 months ago
    Total: 606s
    #172801
  • godotislate changed the visibility of the branch 3421014-alternate-attribute-parsing to hidden.

  • I tried a POC on an alternate approach for attribute discovery in MR 8070.

    The idea is that since only the attributes are needed, parsing can be done like this:

    1. Use PhpToken::tokenize() on the plugin class file
    2. Loop through the tokens to find the class declaration token
    3. Copy all the class file contents before the class declaration to a string
    4. Append a random suffix to the class name for uniqueness, and add a class declaration statement and {} to the string
    5. Copy the string to a temporary file and include that file
    6. Instantiate ReflectionClass on the new temporary class
    7. Extract attribute data from reflection

    So basically, core/modules/block_content/src/Plugin/migrate/source/d6/BoxTranslation.php:

    <?php
    
    namespace Drupal\block_content\Plugin\migrate\source\d6;
    
    use Drupal\block_content\Plugin\migrate\source\d7\BlockCustomTranslation as D7BlockCustomTranslation;
    use Drupal\migrate\Attribute\MigrateSource;
    
    /**
     * Drupal 6 i18n content block translations source from database.
     *
     * For available configuration keys, refer to the parent classes.
     *
     * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
     * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
     */
    #[MigrateSource(
      id: 'd6_box_translation',
      source_module: 'i18nblocks',
    )]
    class BoxTranslation extends D7BlockCustomTranslation {
    
      /**
       * Drupal 6 table names.
       */
      const CUSTOM_BLOCK_TABLE = 'boxes';
      const I18N_STRING_TABLE = 'i18n_strings';
    
    }
    

    gets copied to /tmp/BoxTranslationadfrghq.php with these contents:

    <?php
    
    namespace Drupal\block_content\Plugin\migrate\source\d6;
    
    use Drupal\block_content\Plugin\migrate\source\d7\BlockCustomTranslation as D7BlockCustomTranslation;
    use Drupal\migrate\Attribute\MigrateSource;
    
    /**
     * Drupal 6 i18n content block translations source from database.
     *
     * For available configuration keys, refer to the parent classes.
     *
     * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
     * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
     */
    #[MigrateSource(
      id: 'd6_box_translation',
      source_module: 'i18nblocks',
    )]
    class BoxTranslationhhgsagp {}
    

    and reflection is instantiated on Drupal\block_content\Plugin\migrate\source\d6\BoxTranslationhhgsagp, so the attributes can be read, without concern of inheriting from any unknown class, interface, or trait.

    This seemed to work OK with some limited local testing, but CI caught a significant error (among some other failures I haven't investigated). For a class like core/modules/system/tests/modules/cron_queue_test/src/Plugin/QueueWorker/CronQueueTestSuspendQueue.php:

    <?php
    
    namespace Drupal\cron_queue_test\Plugin\QueueWorker;
    
    use Drupal\Core\Queue\Attribute\QueueWorker;
    use Drupal\Core\Queue\QueueWorkerBase;
    use Drupal\Core\Queue\SuspendQueueException;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    
    /**
     * A queue worker for testing suspending queue run.
     */
    #[QueueWorker(
      id: self::PLUGIN_ID,
      title: new TranslatableMarkup('Suspend queue test'),
      cron: ['time' => 60]
    )]
    class CronQueueTestSuspendQueue extends QueueWorkerBase {
    
      /**
       * The plugin ID.
       */
      public const PLUGIN_ID = 'cron_queue_test_suspend';
    
      /**
       * {@inheritdoc}
       */
      public function processItem($data) {
        if ($data === 'suspend') {
          throw new SuspendQueueException('The queue is broken.');
        }
        // Do nothing otherwise.
      }
    
    }
    

    When the class contents are removed, the constant PLUGIN_ID is undefined, so self::PLUGIN_ID in the attribute causes an error. I'm not sure how to get around this, so I think this approach might need to be abandoned. I thought I'd document it here regardless.

  • Pipeline finished with Failed
    6 months ago
    Total: 577s
    #172849
  • Pipeline finished with Failed
    6 months ago
    Total: 668s
    #173660
  • Pipeline finished with Success
    6 months ago
    Total: 650s
    #173685
  • Pipeline finished with Failed
    6 months ago
    Total: 576s
    #173706
  • Pipeline finished with Success
    6 months ago
    Total: 816s
    #173749
  • Status changed to Needs review 6 months ago
  • Got my POC work in MR 8070 to go green. So along with the steps taken in #44 📌 Convert MigrateSource plugin discovery to attributes Needs work , the next thing I did was eliminate the idea of multiple and automated providers altogether in plugin attribute-based discovery and introduce the idea of manually defined dependencies instead. Complete summary looks something like this:

    1. Use PhpToken::tokenize() on the plugin class file
    2. Loop through the tokens to find the class declaration token
    3. Copy all the class file contents before the class declaration to a string
    4. Replace usage of "self" or "static" with the original class name in the string
    5. Append a random suffix to the class name for uniqueness, and add a class declaration statement and {} to the string
    6. Copy the string to a temporary file and include that file
    7. Instantiate ReflectionClass on the new temporary class
    8. Extract attribute data from reflection
    9. Add a "Dependencies" attribute class that has a "modules" array property which is used to defined other modules the plugin class depends on
    10. When parsing the class, look for the dependencies attribute first. If it exists, check to make sure all dependencies are installed, and if any dependencies are missing, prevent the plugin info from being saved to file cache
    11. Update the default plugin manager to check that all dependencies are installed in findDefinitions()
    12. Add the Dependencies attribute to all migrate source plugin classes that have an implicit dependency on migrate_drupal (or other modules)

    This does require developers who write plugin classes to manually account for any implicit dependencies by listing them with the attribute, instead of having discovery determine the providers automatically. While this can be bit of a hassle, I don't think this is a major obstacle, because usually you can determine what dependencies need to be declared by checking the use statements.

    This is still POC-ish, but putting back into Needs Review to get feedback on whether this is a good approach. If approach looks good, it might make sense to split out the core discovery part of the work to either #2786355: Move multiple provider plugin work from migrate into core's plugin system or 📌 Investigate possibilities to parse attributes without reflection Active first before continuing here. But it was useful to test first with all the converted Migrate Source plugins here. Beyond that, there are probably some tests that need to be written for the revised discovery as well.

  • Updated IS with summary of alternate suggested approach.

  • Status changed to Needs work 6 months ago
  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Pipeline finished with Success
    6 months ago
    Total: 1021s
    #190226
  • Pipeline finished with Failed
    6 months ago
    Total: 661s
    #190252
  • Pipeline finished with Success
    6 months ago
    Total: 516s
    #190261
  • Rebased MR 6780. There's also a question from 🐛 Move I18nQueryTrait from content_translation to migrate_drupal Needs review about how/whether to deprecate I18nQueryTrait (and the classes that use it), given that migrate_drupal will be moved out of core before D12.

    Note that I have a proposed alternative approach in MR 8070 that doesn't require the files be moved at all, and I'd appreciate any feedback on whether it's worth going that route.

  • Status changed to Needs review 6 months ago
  • Status changed to Needs work 5 months ago
  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Pipeline finished with Success
    5 months ago
    Total: 578s
    #203856
  • Pipeline finished with Success
    5 months ago
    Total: 475s
    #203878
  • Status changed to Needs review 5 months ago
  • Status changed to Needs work 5 months ago
  • 🇺🇸United States smustgrave

    Appears most feedback has been addressed but not 100% I can mark this one. But am moving to NW for the deprecations to be updated, unfortunately missed 10.3

  • 🇺🇸United States mikelutz Michigan, USA

    cross posting from 📌 Move source_module and destination_module from Migrate to Migrate Drupal Needs work

    I think we need to rethink this, and 📌 Move source_module and destination_module from Migrate to Migrate Drupal Needs work in light of 📌 [Policy] Migrate Drupal and Migrate Drupal UI after Drupal 7 EOL Fixed

    source_module is a migrate_drupal thing, as this issue points out, but despite the work here, the source_module key is still a thing defined in migrate as part of the source plugin annotations, and 3421014 is moving it over to the attributes defined in migrate. I'm working out the order of operations here, but I think the concept of source_module as a source plugin attribute/annotation key needs to be deprecated in Drupal 11 along with everything else migrate_drupal.

    I have not followed the raw details on the annotation to attribute conversion for plugins, and I'm not sure what would break if we did this, but my gut says that here, we should NOT support source_module as a source plugin attribute, nor should we convert the d7 source plugins that we are deprecating in D11 over to attributes. I'm sure there's some core test somewhere that ensures core plugins which support attributes use them, and we may have to find a way around that for the sources we are deprecating, but I feel like it's worth it, and it saves us from having to deprecate source_module as it can just go away with annotations.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 200s
    #290026
  • Pipeline finished with Failed
    about 2 months ago
    #290037
  • Based on #53 📌 Convert MigrateSource plugin discovery to attributes Needs work , I created MR 9571 that differs from previous in the following ways:

    • No D6/D7 source plugins are converted to attributes
    • Remaining core source plugins in Migrate module are converted to attributes
    • The source_module property was removed from the MigrateSource attribute
    • Since so many source plugins are still using annotations, removed the backwards compatibility examples and test that was added
    • Since none of the plugins converted to attributes depend on anything other than the core migrate module, automated/multiple provider attribute-based discovery was dropped. There is still a class to handle attributes + automated providers via annotations, but no automated providers via attributes. 🐛 Changing plugins from annotations to attributes in contrib leads to error if plugin extends from a missing dependency Needs review in a way handles "multiple providers" for all plugin types (except for those using other modules' Traits), so it might not be need to be dealt with for Migrate source plugins specifically

    Unfortunately, removing the source_module property from the converted plugins embedded_data and content_entity is causing test failures.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 716s
    #290558
  • Pipeline finished with Failed
    about 2 months ago
    Total: 700s
    #290611
  • Pipeline finished with Success
    about 2 months ago
    Total: 657s
    #290630
  • Added a commit to MR 9571 that populates the "source_module" property to the definition via the attribute ::get() method. It is kind of ugly, but it does make it easier to remove with the removal of migrate_drupal. Tests are passing again.

    I can also update the IS if this route of not converting d6/d7 plugins to attributes is preferred. Putting back in Needs Review for now for feedback.

  • 🇺🇸United States benjifisher Boston area

    For now, the canonical MR is 6780.

    That MR is marked as a draft, and I also see MR 9571. I am adding the tag for an issue summary update to clarify the situation.

  • Per conversation with @benjifisher on Slack, setting this back to Needs work for IS update. Will solicit for feedback on best approach again after IS is updated.

  • godotislate changed the visibility of the branch 3421014-migrate-source-no-migrate-drupal to hidden.

  • Pipeline finished with Success
    about 2 months ago
    Total: 1526s
    #294826
  • Pipeline finished with Failed
    about 2 months ago
    Total: 171s
    #294895
  • Pipeline finished with Failed
    about 2 months ago
    Total: 594s
    #294901
  • Pipeline finished with Failed
    about 2 months ago
    #294970
  • Pipeline finished with Failed
    about 2 months ago
    Total: 774s
    #294972
  • Pipeline finished with Failed
    about 2 months ago
    Total: 4243s
    #294998
  • Pipeline finished with Failed
    about 2 months ago
    Total: 906s
    #295034
  • Pipeline finished with Success
    about 2 months ago
    Total: 917s
    #295075
Production build 0.71.5 2024