Problem/Motivation
Polish the API documentation at https://api.drupal.org/api/drupal/core%21modules%21migrate%21migrate.api...
Proposed resolution
Add@ingroup migration
to all migration classes so that the classes will appear on Migration API documentation topic- Let's NOT add the
@ingroup migration
to the source / process / destination plugins. - Instead, let's add a link to the process plugin list as quietone suggested in #7. This can be done using
@link
- According to the API doc standards, we should be using single quotes instead of double quotes.
- Let's harmonize the usage of our terminology. The name of our API is 'Migrate API', not 'Migration API'. Individual migration is still migration but without capital 'm'.
- Let's add a
@see
to the Upgrading to Drupal 8 handbook. - Remove the link to Update API. Upgrade and Update are related topics but this API doc is not about upgrading, it is about migrating.
Remaining tasks
Patch
Review
Commit
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Original issue report
We have a Migration API documentation topic at api.drupal.org. Currently we are listing the most essential migration classes and interfaces on this Topic page but for example the source, process and destination plugin classes are not listed here.
The documentation of source / process / destination plugins will be moved from the Migrate API Handbook to API documentation per #2831626: Redirect handbook process plugin documentation to API docs. If and when we do this, I'm suggesting that all source / process / destination plugin classes will be added to the Migration API documentation topic. This can be done using the @ingroup migration
syntax in the class docblock.
Comment | File | Size | Author |
---|---|---|---|
#47 | interdiff-2933620-38-47.txt | 2.63 KB | masipila |
#47 | 2933620-47.patch | 8.02 KB | masipila |
#38 | interdiff-2933620-34-38.txt | 2.83 KB | masipila |
#38 | 2933620-38.patch | 7.91 KB | masipila |
#34 | interdiff-2933620-28-34.txt | 2.93 KB | masipila |
Comments
Comment #2
masipila CreditAttribution: masipila as a volunteer commentedComment #3
masipila CreditAttribution: masipila as a volunteer commentedComment #4
heddn+1
Comment #5
quietone CreditAttribution: quietone as a volunteer commentedI am not sure about this. I am concerned that there would be too much detail, so much so that it wouldn't be helpful. Looking at the documentation for the other APIs, none of them are very long. At least not as long as migration would be with the addition of all the source, process and destination classes, which grep tells me is 213 classes.
Maybe it needs to be as proposed but is there an alternative?
Comment #6
masipila CreditAttribution: masipila as a volunteer commentedThanks quietone for the valuable comment!
I see two possible approaches at quick thinking. Look at https://api.drupal.org/api/drupal/8.4.x for reference:
1) We could break this into several 'topics' such as 'Migrate API general' which would be what we have today, then a separate topic 'Migrate API source plugins', separate topic 'Migrate API process plugins' and 'Migrate API destination plugins'.
2) Another approach is that we use the current single topic but include only those source / process / destination plugins that Migrate module provides. We would NOT include those provided by other core modules such as user or node. This is actually what we were discussing briefly with heddn on IRC a couple of days ago.
Any thought on this?
Cheers,
Markus
Comment #7
quietone CreditAttribution: quietone as a volunteer commentedAh, that makes more sense! Option 2 seems reasonable. Although, I like the idea of sub topics for the source, process, and destination plugins, which seems to me that it would make it easier to find the plugin you need. I mean if I am trying to figure out how to process something I want to just look at the process plugins and not be distracted by other information. I keep this list bookmarked for just that reason. But maybe it is the right thing to do, that is, to do option 2 as is. I've had my say and will be content to go with what others think is best.
BTW, should we have a similar thing for the migrate drupal plugins?
Comment #8
masipila CreditAttribution: masipila as a volunteer commentedThat namespace list for process plugins is even better than what I was thinking to achieve with the
@ingroup migration
approach. I think that the best way forward is simply to have a simple@see
link to this namespace page and *not* include all process plugins to@ingroup migration
.I'll have a closer look later this week and think this further.
Markus
Comment #9
masipila CreditAttribution: masipila as a volunteer commentedI was thinking this a bit as promised and propose the following approach:
@ingroup migration
to the source / process / destination plugins.@link
I also reviewed the whole migrate.api.php. Now that we are touching this anyway, I would suggest the following improvements to migrate.api.php:
@see
to the Upgrading to Drupal 8 handbook.Issue summary updated accordingly.
I'll write a patch later today.
Comment #10
masipila CreditAttribution: masipila as a volunteer commentedPatch attached, welcoming all feedback!
Questions: I did mention that there are contributed modules for providing more source plugins compared to what the core Migrate module offers. Should we add @see links to Migrate Source CSV + Migrate Plus modules?
Markus
Comment #11
masipila CreditAttribution: masipila as a volunteer commentedComment #12
maxocub CreditAttribution: maxocub commentedThank you for improving this file! Just a few minor improvements:
I would add a comma after API.
I would add a comma after processing.
I would add 'the' before the @link.
I'm not sure about the commas before those 'and'.
Those links don't seem to work without a specific version at the end, like /8.5.x.
I'm not sure this last sentence is true, and the 'by their and their' part is confusing.
Comment #13
masipila CreditAttribution: masipila as a volunteer commented1-3: Done
4: I think you're right. I removed the commas.
5. Bummer, that's not nice... :( Links to classes and methods work without specifying version in the URL. If the version is omitted, the currently latest stable release is defaulted. Unfortunately it doesn't work for the namespace links that we have here. I propose that we include the 8.5.x version in here. If / when we need to touch this API documentation, we then need to remember to update the version numbers in these links. If we don't do any changes to this API doc, it doesn't matter that new Drupal versions are released because the same API doc is still up to date.
6. I removed the sentence in this latest patch. If others feel that it is needed, could you please elaborate what we are trying to say with this sentence?
Cheers,
Markus
Comment #14
quietone CreditAttribution: quietone as a volunteer commentedI can't do a review right now but ...
5. Only concern is how will we remember to keep it up to date? Do it like the dumps, where we have an issue to keep them up to date?
6. Possibly related to this and then it will be needed. http://cgit.drupalcode.org/drupal/tree/core/modules/migrate/src/Plugin/M...
Comment #16
masipila CreditAttribution: masipila as a volunteer commentedFor #12-#14.5: I opened #2937926: Namespace URLs don't work without branch.
Comment #17
phenaproximaI propose that we commit the patch with the 8.5.x version argument, but before we do, we open a follow-up to remove them, postponed on #2937926: Namespace URLs don't work without branch.
I think it's handled appropriately in the current patch. Source providers are a tricky concept, and if we want to document them in migrate.api.php, I propose we open a follow-up for that.
Comment #18
masipila CreditAttribution: masipila as a volunteer commentedThanks for the comments @phenaproxima!
I have created the two follow-ups as suggested in #17:
#2939272: Remove hard coded version argument from the links in migrate.api.php documentation
#2939275: Document Migrate source provider concept
Cheers,
Markus
Comment #19
masipila CreditAttribution: masipila as a volunteer commentedThe attached patch contains two minor changes suggested by a spellchecker.
Comment #20
kay_v CreditAttribution: kay_v as a volunteer commentedI'm bringing an outside set of eyes (unfamiliar with most items mentioned in this doc). I'm reading for clarity and to confirm that the changes listed in the proposed resolution are in fact applied in all instances. Also confirmed links, that the patch applied cleanly and similar basics.
Outcome: looks good to me. I'm marking RTBC, as I see no additional work required for a commit.
kudos for fixing the comma splice! (ok, frivolous comment but it deserves appreciation)
Comment #21
kay_v CreditAttribution: kay_v as a volunteer commentedComment #22
cilefen CreditAttribution: cilefen at Institute for Advanced Study commentedHi everyone. I perused prior to commit and noticed a few things in the places words have been changed:
The definite article in front of storage seems to indicate a particular storage.
"The data source is typically a database." 'Source' is a phase, right?
Is "CSV, JSON or XML" comprehensive, or "for example"?
Would it make sense to put "stub" in quotes as a newly-introduced term? I'm not sure on this one. I'm really just asking.
"Use" or "are defined as"? If it's the same definition as the prior sentence, use the same words.
Assuming I understand this right, what about "The overall ETL process and the three phases (source, process and destination) are defined as migration plugins" and that's all?
Thanks, all!
Comment #23
mpdonadioShould take care of #22.
Comment #24
mpdonadioComment #25
cilefen CreditAttribution: cilefen at Institute for Advanced Study commentedThank you!
I just remembered #2640718: Replace i.e. and e.g. with English words in core/modules A-L, so I suggest instead of this:
this:
"The data source is typically a database, but it can also be, for example, files (CSV, JSON or XML) ..." and so on.
Comment #26
mpdonadioHere we go.
Comment #27
phenaproximaI spoke to @jhodgdon at Pacific Northwest Drupal Summit and I think we can probably go ahead with this patch without the 8.5.x namespace links -- she expects to get #2937926: Namespace URLs don't work without branch in within a couple of days. So let's re-roll without the mentions of 8.5.x and postpone on that.
Comment #28
mpdonadioThis should work with the patch on #2937926: Namespace URLs don't work without branch.
Comment #29
masipila CreditAttribution: masipila as a volunteer commented#2937926: Namespace URLs don't work without branch has landed and has been deployed to api.drupal.org so we can continue with this one.
Comment #30
masipila CreditAttribution: masipila as a volunteer commentedQuickly read through the latest patches since I last touched this in #19. I'm writing this from my mobile so could not add a patch. I'll do that this evening unless someone else has done it already.
1.
Should be "loading data from a storage" if I'm not mistaken.
2.
This phrasing has now so many commas so let's try to simplify this a bit. We can also link to the handbook page which has examples. How about this:
--clips--
The source data can be migrated from databases, different file formats (for example CSV, JSON or XML) but it can also be fetched from a web service (RSS or REST). @link https://www.drupal.org/docs/8/api/migrate-api/migrate-source-plugins See documentation handbook for examples. @endlink
--clips--
3.
How about this:
--clips--
The overall ETL process is defined as a migration plugin. The three phases (source, process and destination) also have their own plugin types.
--clips--
Cheers,
Markus
Comment #31
kay_v CreditAttribution: kay_v as a volunteer commentedfwiw:
I glanced through additional proposed revisions. Nothing seems substantial enough to justify a delay to committing. No writing is ever perfect. I would respectfully submit that further changes don't quite justify additional delay.
May I propose this ship, with a note that people can then fix 'nits' here and there after the current patch is committed, applying polish over time?
Setting back to rtbc, with thanks to the group for the efforts and the commitment to high quality api documentation.
(If it helps people at all to know, my history as an editor, writer and translator in English spans a few decades. I'm the first to click the 'edit' button when wording or punctuation feels a little 'off', so I truly do write the above recommendation will all respect for the sensibilities of the people continuing to propose improvements).
Comment #32
masipila CreditAttribution: masipila as a volunteer commentedHi,
This issue is an important part of the documentation polishing that we've been working really hard both in api docs and handbooks. So let's do this properly and not half-way.
Cheers,
Markus
Migrate subsystem maintainer
Comment #33
heddncross posted with #32:
Let's get all the doc nits addressed in a single patch. We're pretty good at not letting docs patches flounder and the committers are pretty good at committing things once they get to RTBC, so let's do this in a single patch, rather than a follow-up.
Comment #34
masipila CreditAttribution: masipila as a volunteer commentedAddressing the nits from my comments in #30. Also clarified the stubbing a bit.
Comment #35
maxocub CreditAttribution: maxocub commentedI prefered "from storage", but it's just a matter of taste, I don't think "from a storage" is a mistake, so let's leave this like this, unless you think otherwise.
Should the @link be on a new line?
Comment #36
masipila CreditAttribution: masipila as a volunteer commentedThanks for giving this yet another pair of eyeballs @maxocub!
Re #35.1: Could some native English speaker comment on this?
Re #35.2: It does not have to be on new line, see the api doc standards for @link. However, all other links we have in this docblock are so that the whole sentence is the link so we should be consistent also with this link. I'll update this during the weekend unless somebody can do it earlier (feel free if somebody wants to help!)
Markus
Comment #37
phenaproximaRegarding #35.1, I think either "from storage" or "from a storage" is fine, although I personally prefer "from storage". In English, "a storage" is descriptive and usually followed by something else, like "a storage unit", or "a storage handler". But it's not a big deal.
Comment #38
masipila CreditAttribution: masipila as a volunteer commented#35.1: Fixed
#35.2: The whole sentence is now a link.
I also harmonized the way how the handbook links are here. They are now all using URL aliases instead of node/nid format. I also changed the target link for the migration examples.
This should now be ready for (hopefully) final review.
Cheers,
Markus
Comment #39
maxocub CreditAttribution: maxocub commentedThanks @masipila!
This is ready, as far as I can tell.
Comment #40
masipila CreditAttribution: masipila as a volunteer commentedProposing this to be cherry-picked to 8.5.x
Comment #41
alexpottI would be great to get a +1 from all the sub-system maintainers just so it's easy to know that you are all +1.
I've read through and the changes look fine to me.
Comment #42
alexpottSo a +1 from phenaproxima, heddn and quietone would be great.
I think we have one from masipila (wrote the patch) and maxocub (pressed the rtbc).
Comment #43
phenaproximaOops! There is a typo here -- "Mirate" should be "Migrate" :)
Otherwise, I have read it through and it looks good. Consider this my official +1.
Comment #44
heddnSome more nits since I'm looking at this as well. Otherwise, I like the wording here and am +1 on committing.
I think this is really an example of what /could/ happen in a process plugin. Here's a suggested re-wording.
... can do lots of things, like determine if a 'stub'...
And if we re-word things, perhaps it would follow that wording like the following would be better.
In this example, if a term has a parent term...
Do we need to mention that these aren't the only plugin types possible in a migration? I don't want to discuss field plugins here, but I also don't want to give the impression this is all inclusive either.
Nit: For example RSS or REST. This isn't an all-inclusive list of web services.
Comment #45
maxocub CreditAttribution: maxocub commentedRe #44.4:
I would also add an 'or' between JSON and XML: (for example CSV, JSON or XML)
+1 for me too.
Comment #46
heddnFor point #3 above, we mention that the 3 phases of the ETL process are mapped by plugins. I am mildly wondering if we should allude to the fact that other plugins may also be provided so don't just think that these are the only pugins you'll encounter... For example, migrate_drupal provides field plugins. Migrate Plus provides data fetcher plugins.
Maybe something like:
The three phases (source, process and destination) also are directly mapped to their own plugin types.
vs. previously:
The three phases (source, process and destination) also have their own plugin types.
This makes it crystal clear that each ETL phase is a plugin and the entire migration is a plugin. Which I think is what we are trying to convey. It is cutting hairs, I know.
Comment #47
masipila CreditAttribution: masipila as a volunteer commented#43: Fixed the typo. Good catch!
#44.1: I don't like about the 'processing can do lots of things' suggestion, it just raises more questions than gives answers. The previous sentence says that the process phase transforms the data as needed so this counts as 'can do lots of things' to me. :)
#44.2: I like the "for example" better than the proposed "in this example" because we don't have a code example that we are referring here.
#44.3 and #46: These are good points. Addressed in this latest patch.
#44.4: Fixed
#45: Fixed
@phenaproxima and @maxocub were already OK with patch in #38 (except the typo which is now fixed) so I guess it's enough that @heddn confirmes that he's OK with that and sets the status to RTBC if he's ok with this. And @quietone can of course still read this through if you have anything else to add.
Cheers,
Markus
Comment #48
heddnGood point about raising more questions. What if we remove that section entirely? Only a single, special process plugin (migration_lookup) does the stubbing. Why do we call it out here and not any others? Can we just remove it?
Comment #49
masipila CreditAttribution: masipila as a volunteer commentedI personally think that stubbing is a very fundamental concept in our migrate system. It addresses the chicken and egg dilemma which is always there when talking about migrations and therefore it deserves to be mentioned here (I also have another documentation issue open on adding more information about the stubbing concept to the handbook but that's irrelevant from the scope of this issue).
Comment #50
phenaproximaI agree with @masipila on this. Stubbing is a critically important concept and any good overview of the Migrate API should at least mention it.
Comment #51
heddnHowever, perhaps we can avoid disagreement here and discuss it as its own concept. Outside of the process pipeline. In a new section of the API doc. And mention that stubbing happens during the process pipeline while touching on the topic. I don't think I disagree that it isn't an important topic. I just don't think of it as tightly connected to the process pipeline explanation.
Or, I can step aside from my bikeshedding. We get this in and open a follow-up to hammer out potentially different language.
Comment #52
heddnDiscussed this is in IRC. We'll open a follow-up to flesh out my concerns about singling out stubbing as the only process pipeline example. So once that is opened, I'm good with RTBC.
Comment #53
masipila CreditAttribution: masipila as a volunteer commentedGood morning!
I read through the IRC discussion @heddn and @phenaproxima had yesterday after I had gone to bed which @heddn summarized above. I'd rather polish this whole thing under this single issue than open a follow-up.
I believe that we have consensus that stubbing concept needs to be mentioned in this overview (like it is already today). However, @heddn has a valid point that stubs can be created also elsewhere than in a process pipeline (current text implies thst it would be only a process pipeline thingy). So we can simply separate the text describing stubbing to its own paragraph and elaborate with an additional sentence or something like that.
If / when we do this, are there other any other fundamental concepts that we should mention in this overview in addition to the stubbing? From my point of view we're covering the topics that belong to this overview. Further information can be found from the linked handbooks + linked API docs.
Cheers,
Markus
Comment #54
masipila CreditAttribution: masipila as a volunteer commentedOk, thinking this further with an additional sip of morning coffee. When we're discussing the fundamental concepts, maybe it would be worth mentioning that the Migrate API supports rollbacks and incremental migrations for newly created / updated data.
I'm proposing to have a subheading called 'Other key concepts of the Migrate API' or something similar and describe these under that heading.
Markus
Comment #55
quietone CreditAttribution: quietone as a volunteer commentedI've caught up, having read the issue and the IRC discussion as well and I support RTBC here.
A new section 'Other key concepts of the Migrate API' for stubbing, incremental and rollback as nicely resolve where/how to add this information and it is reasonable to do that in a followup. Yet, I do realize the masipila would like to complete it here. I see the merit in that too.
However, I too found a nit but that should not hold up RTBC, it is too minor.
Can the 'into' and 'from' be emphasized? I only ask because I had to read it twice but leave it if you think it isn't the right thing to do.
Comment #56
masipila CreditAttribution: masipila as a volunteer commented#52: Follow-up opened, see #2944846: Improve description of key concepts in migrate.api.php documentation
#56: I don't think we can use em or strong markup in the docs. We could only SHOUT or _underline_ the words. I don't think that we should use *asterisk* for emphasizing as it might confuse the documentation parsing. However, I haven't seen that kind of emphasizing in any docblocks so I'll leave this for the committers to judge.
Back to NR.
Cheers,
Markus
Comment #57
quietone CreditAttribution: quietone as a volunteer commentedThe last work here, making two followups and answering my question in #55 have been done. Regarding my question about emphasizing two words SHOUTING would be awful in my opinion and since it seems there are no other options let's just leave it is as. There is nothing incorrect about the sentence in question. Although, masipila does leave that open for a committer to decide.
No changes to the patch since my last read and everyone is in agreement so this is good to go.
Comment #58
heddn+1 on RTBC.
Comment #59
alexpottCommitted and pushed ecfdf60433 to 8.6.x and 2d0151b8f1 to 8.5.x. Thanks!
Backported to 8.5.x since this is a docs only change.