Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #2676222: Move MigrationInterface out of the migrate\Entity namspace now they are plugins and #2625696: Make migrations themselves plugins instead of config entities
Problem/Motivation
Migrations are plugins not configuration entities - let's update the .api.php for this.
Proposed resolution
Fix it
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#27 | interdiff.txt | 1.62 KB | mikeryan |
#27 | 2687003-27-migrate-api-docs.patch | 6.14 KB | mikeryan |
#25 | 2687003-25-migrate-api-docs.patch | 5.95 KB | eojthebrave |
#21 | 18-21-interdiff.txt | 1.66 KB | alexpott |
#21 | 2687003-21.patch | 5.65 KB | alexpott |
Comments
Comment #2
alexpottComment #3
alexpottFixed to use the latest proposal on #2676222: Move MigrationInterface out of the migrate\Entity namspace now they are plugins
Comment #4
benjy CreditAttribution: benjy at PreviousNext commentedLets do sec_migration so its singular like the rest. Also this line is > 80chars.
Rest looks good to me.
Comment #5
alexpottFound some more things to change - and opening a follow up to remove the
@section sec_manifest Migration manifests
as this only applies to drush based migrations.Comment #6
benjy CreditAttribution: benjy at PreviousNext commentedLooks good.
This reminds me, we should create an issue to rename migration_templates to migrations now that is our preference?
Comment #7
catchCan't figure out this sentence.
I think it means:
IDs and configuration for source, process and destination plugins, as well as information on dependencies.
But wondering if it should be a list, or needs a @code block as well.
Also it's a bit odd that it goes from plugins, to dependencies, back to the process plugin sections definition again.
Comment #8
xjmShouldn't this part of the paragraph be updated too?
Comment #9
alexpott@catch oh dear that is a confusing sentence.
@xjm yep indeed...
So I think the best thing here is to re-organise this documentation. Once you start looking at it there is quite a bit that is out of date or misleading. The patch attached reorganises the documentation so that it starts with the general overview which eventually makes the point that...
It then details what a migration plugin is, then source, then process and then destination. And finally finishes with a more information section. I think this organisation is more logical and will help people understand how it works.
It also cleans up what the documentation says about the Migrate and the Migrate Drupal modules as that was no longer accurate. In fact it does not mention the Migrate Drupal module because that feels out of place. It also does #2687567: Remove @section sec_manifest from migrate.api.php because that incorrect section is just getting in the way.
Comment #10
quietone CreditAttribution: quietone as a volunteer commentedHad a read of this, for comprehension as I don't know the doc standards well enough to comment on that, and it reads well. But, I did have two problems with it.
Every time I read this I think it means that the entire row is transformed to one property. Obviously, that is not the case. Even a small change like 'some row data' instead of 'the row data' would be clearer to me. But maybe that is just my interpretation.
I could not find information about the load plugins in that documentation. Did I miss it?
Comment #11
benjy CreditAttribution: benjy at PreviousNext commentedLoad plugins are long gone.
Comment #12
alexpottThanks for the reviews re #10.1 I've tried to rewrite this to solve your concerns.
Comment #13
quietone CreditAttribution: quietone as a volunteer commentedYes, that is more accurate in my mind. And reads better too. Thanks.
Comment #14
xjmWere manifests removed as a feature too? Though obviously the core docs should not refer to Drush.
This could use @link/@endlink.
Comment #15
xjmThis is a wall o' text and a bit of a runon; can we split it up into paragraphs or a list?
Comment #16
xjmAlso, this section is referring to plugins, before we get to a section about plugins.
(Sorry for the multiple comments.)
Comment #17
xjmComment #18
alexpott#14.1 Migration manifests have never been part of core as far as I know
#14.2 Fixed
#15 I've made a new paragraph.
#16 I think an overview of the migration API that translates ETL language into Drupal language has to talk about plugins. However I see what you mean. I think the whole lots needs further re-jigging. The source, process and destination sections only detail what plugin class they have and what plugin manager creates them - if the migration plugin only does that as well and then the overview provides the information about how they all work together.
Comment #19
xjmThanks @alexpott.
I applied the patch and read the whole docblock locally but I am still very confused: Are "migration plugins" a separate plugin type from source, process, and destination? If so, I think that we should explicitly state that Migrate uses four different types of plugins. Because on first read I thought "migration plugin" was a general header summarizing all three types, but the relationship between "migration plugins" and the source, process, and destination plugins is not clear.
I think this first paragraph is fine still:
I do not think it needs to be directly followed by this exact paragraph:
The information about plugins can easily be removed from that paragraph. What is important for the initial section is to define the terms "source", "process", "destination", "rows", and "properties". Whether they are plugins or not is implementation.
And if "migration plugins" are a separate category from the other three, then we need a much clearer definition of what they are, and I'd suggest a different name because it would seem to encompass all types of plugins involved in Migrate. If they are not a separate thing, then we should instead say that they are divided into three types.
I can try to help rewrite the docs too once I understand it.
Comment #20
alexpottI'm just going to try to write everything here.
A migration is the ability to extract something from the source, transform it to make it compatible with the destination and then load (save) it there. This whole thing in D8 is a MigrationPlugin. The different phases: extract, transform, and load are also plugins (which plug in to the Migration plugin - migrate is kinda like views in this respect). So there are four types of plugin:
I think that the Migration plugin is well named. If we ever have something that configures a set of migration plugins then you'll be plugging these in to set the whole thing up. I think it is shame that we didn't change the other plugins to match the ETL (extract, transform, load) language as that is the lingua franca of tools that perform similar tasks.
In a migration a row is extracted from source by the source plugin. The source can a Drupal 6 database, an XML file or whatever. The process plugins then transform properties of the row, or can mark it to be skipped (if deduping for example). Process plugins can also determine that a stub needs to be created - for example if a term has a parent of term that does not yet exist. Once the row has been transformed it is handed to the destination plugin that simply loads it into (saves) the Drupal 8 site. This whole ETL process is configured by the migration plugin.
Comment #21
alexpottSo one thing that is not helping is using
@ref sec_source
to stand for Source plugins - yes the link is nice on api.drupal.org but it makes the thing unreadable here.Comment #22
benjy CreditAttribution: benjy at PreviousNext commentedI think this was considered, keeping similarity with the D7 module was one reason not to, another key reason was Drupal already used the term "load" to mean the exact opposite of what L means in ETL.
Comment #23
alexpottDiscussed with @xjm, @effulgentsia and @cottser - we agreed that whilst this is rc eligible because it is just documentation it should also be an rc target as getting the API docs correct before the migrate UI is in an official release is a good plan.
Comment #24
xjmI think this is actually major given how out of date it is. :)
Comment #25
eojthebraveThis sentence is kind of confusing to me. Could we simplify it to something like: "Each row is handed off to one or more process plugins which transform the row's properties."
"destinations" should be singular here I think.
I've attached a patch with these two minor changes. But otherwise I think this does a good job of explaining the Migration ecosystem at a high level and providing enough direction for someone to get started without being overwhelming.
Comment #26
alexpott@eojthebrave those changes look good to me.
Comment #27
mikeryanPer benjy's https://www.drupal.org/node/2687003#comment-10991539 above, and my https://www.drupal.org/node/2513398#comment-11053513, I suggest some clarification on the word "load".
Comment #28
alexpott@mikeryan those changes look good and certainly worth it given the potential confusion.
Comment #29
eojthebraveI just ran into this again while trying to look up some information about writing a migration. I think the text here is good to go, and the sooner we can get the docs updated the better. Right now when you land on https://api.drupal.org/api/drupal/core%21modules%21migrate%21migrate.api... it just really confusing.
Moving this to 8.2.x-dev since I think it should be fixed there first. I also just tested, and FWIW, this same patch applies cleanly to both 8.2.x and 8.1.x.
Finally, marking as RTBC because in my opinion this is ready to roll. Thanks.
Comment #31
mikeryanOne last gasp for the random fail? Retest queued...
Comment #32
mikeryanRestoring RTBC, "needs work" was just our old random test fail...
Comment #33
willwh CreditAttribution: willwh at Drupalize.Me commentedI applied this patch just so I could read through everything easily, looking great. +1000 from me, the current state of the API doc has been stale since 8.0.x and we should get this in ASAP.
Comment #35
mikeryanRandom test fail - #2749955: Random fails in UpdatePathTestBase tests, apparently.
Comment #38
xjmSo I'm a bit frustrated that the work in #19 and #20 was totally ignored, because it represents a significant amount of work. I discussed this with @alexpott and he created #2755865: Describe Migration plugins and their relationship to source, process and destination plugins for that needed work. Thus, that we can at least remove stale information about manifests and such here. I've rescoped this issue to that only.
So, for this patch, I've reviewed whether the individual sections are clear on their own after being changed. Here are some small typos I fixed on commit:
Oxford comma.
Oxford comma.
Also too.
Diff on commit:
The documentation still needs to introduce the migration plugins and their relationships to other kinds of plugins in a more clear way, because the new order does introduce new confusion. We will address that in the followup issue. Additionally, this new paragraph is very difficult to understand:
It's unclear what the relationship between the sentences in this paragraph is. That will also be addressed in the followup issue.
Meanwhile, committed 0bbcdf4 and pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!