Closed (fixed)
Project:
Commerce Migrate
Version:
8.x-2.x-dev
Component:
Drupal Commerce 1.x
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2017 at 08:12 UTC
Updated:
11 Aug 2017 at 15:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
quietone commentedHaven't run all the test locally but lets see what the testbot says.
Comment #3
quietone commentedThis should fix StoreTest.
Comment #4
quietone commentedOrderTest is failing in d6_ubercart_order at this process.
Comment #5
quietone commentedLet's move the destination plugin, entity:profile back to commerce_migrate and out of d7 subdir.
Comment #6
quietone commentedCoding standard and doc fixes.
Comment #7
mglamanThe tests should still be part of the root module, even though submodules. We can keep submodule specific tags.
Comment #8
quietone commentedWhy would tests that rely on a sub module being enabled be in the root? Not sure I know what you mean by submodule specific tags?
Comment #9
heddnI think it makes more sense to lump tests for commerce or ubercart, etc in the sub-module instead of the root commerce_migrate module.
One thing I just noted though... and this is different than how most other modules are doing things is that the destinations seem to be part of this module ecosystem. Rather than the commerce core modules themselves. I'd rather see them added to commerce core. This aligns with how drupal core does things. Honestly, I almost want to see that too for source and process too, but those are more d2d specific, so let's leave them in here. But destinations make more sense (to me) because technically you don't really *need* the process plugins or source plugins to import into commerce if you sucking in properly formatted data from a CSV. You just need all the correct destinations.
This is what I'm talking about.
Comment #10
quietone commentedThanks
This restores the destination plugin to Drupal\commerce_migrate\Plugin\migrate\destination\commerce\d7. Also removed 2 ubercart files that don't belong in this patch.
Comment #11
quietone commentedNow fix some typos and doc issues. Sorry, the patch is numbered #12 instead of #11.
Comment #12
heddnMe likes this. Adding them to the 'commerce' module, without cluttering up the commerce module itself. However, shouldn't these go into the specific sub_module of commerce. Like order, product, etc? And does this work in a sub-folder or does the migration_templates folder need to reside in the root of a module? I think it does, based on what I'm seeing in MigrationPluginManager. It looks for migration_templates in the root of enabled modules. So much for wanting to break things out. Any chance we can put the process plugins and destination plugins directly into commerce core? Seems like that would get messy. The question of "where does this belong" would be troublesome.
So, after thinking about this some more... I propose we put all the commerce core destinations into commerce_migrate. You'll need them for any and all commerce migrations. Any process plugins that are specific to a uc, commerce 7, woocommerce, etc. migration move into their respective modules. However, if there are any generally useful (globally useful) process plugins, move those up into the root commerce_migrate parent module. The goal here being that if someone wants to write a custom migration of content from a CSV/excel file, they would just need to enable commerce_migrate to get the destinations and reusable process plugins.
One note about the process plugins, I don't expect there will be many generally useful process plugins. Except for ones that are similar between uc and commerce. In that case, let's add a base abstract process plugin into commerce_migrate and extend them into the sub modules. That will keep things cleanest. Even if we have to *only* extend the process plugin base and add annotations, we can then namespace it appropriately. Naming is hard, let's make it easiest on ourselves. And with how we are building things, we're going to have a hard time figuring out what is generally/globally useful until after the fact. So to maintain BC, we're going to want to build these things in commerce or uc first, then after a while we'll see that there are similarities and we can refactor them back to a common abstract base class.
Enough random ponderings. Is this clear now? Is there general consensus?
Comment #13
heddnOh, and this is obvious, but all source plugins for uc, commerce 7 etc should reside in the submodules. But if there are any similarities between uc and commerce 7, add base abstract classes in the core commerce_migrate module and extend them into the sub modules.
Comment #14
quietone commentedHave you seen the approach discussed in #2871241: Offer submodules that enforce configuration to match specific sources? I've reference your comments there.
I had the same question and it was the first thing I tested. Yes, the migration_templates in a sub module are discovered.
Yes, there is consensus.
And that means the only thing to do here is move modules/commerce_migrate/src/Plugin/migrate/destination/commerce/d7/Profile.php to modules/commerce_migrate/src/Plugin/migrate/destination/Profile.php. Which this patch does.
Comment #15
heddnLooks good now.
Comment #17
heddn