On #2148255: [meta] Make better D8 api.d.o landing page, linked to high-level overview topics, and put it in Core api.php files, we made a patch that included a stub Topic page for api.drupal.org (i.e., a @defgroup) titled:

Migration API

This can be found in file core/modules/system/core.api.php where it says

@defgroup migration

The documentation to go on this page needs to be written. The idea is:

a) Write a few paragraphs about the topic.

b) Link to more detailed documentation on
https://drupal.org/developing/api/8

c) If the more detailed documentation does not yet exist, create stub page(s), link to the stub pages, and add a note to this issue stating that the stub pages need to be filled out.

d) If the topic has related classes, interfaces, and functions -- appropriate for an overview -- add

@ingroup migration

to their documentation headers. That will make these classes etc. show up on the Topic page on api.drupal.org. Only include classes/functions that are appropriate for an overview page please!

For more info -- documentation standards for @defgroup/@ingroup:
https://drupal.org/coding-standards/docs#defgroup

Comments

jhodgdon’s picture

Component: documentation » migration system

I am at least temporarily moving this into the migration system issue queue. I am kind of clueless about migration, so it would really be better if one of the maintainers could take a first pass at writing an overview for developers of this topic.

Since this is going into an api.php file as a @defgroup, the idea is to give a basic overview and link to more information (on drupal.org, or other topics) rather than providing a comprehensive tutorial. Also, relevant classes and functions should be added to the topic with @ingroup (see issue summary above).

If you click through to the parent issue, and look at the "child issues" sidebar, you can find other issues that have been completed to give you an idea of what is needed. Or start at the api.drupal.org landing page for Drupal 8, and click into topics (nearly all of them are done now, except this one and a few others that are still open on the parent issue).

And if you prefer, you could give an outline of what needs to be written here, or a link to the relevant existing more comprehensive documentation, and I can give it a shot. Thanks!

chx’s picture

Assigned: Unassigned » chx

Give me a week. Sorry it wont happen this week, sorta busy here.

chx’s picture

Assigned: chx » Unassigned
StatusFileSize
new16.2 KB

Sorry :/ The ingroup were added by this sedfile:

/\* @Migrate/i\
 * @ingroup migrate\
 *

then sed -i -f sedfile **/Plugin/migrate/**/*.php . Really easy. Picking up the rest won't be this easy but this deals with 74 of them already.

webchick’s picture

Status: Active » Needs review
jhodgdon’s picture

StatusFileSize
new14.28 KB

OK... Thanks, I think I know what is going on in Migrate now, so that gave me enough information to go to work writing.

Here's a new patch:
- Moved the defgroup into migrate.api.php instead of core.api.php
- Expanded the docs there quite a bit
- Reduced the number of @ingroup so it only includes annotation classes, base classes, interfaces, plugin managers, and entity classes/interfaces.
- The @ingroup should have been @ingroup migration

So this is a completely new patch. An interdiff is not useful, I think?

jhodgdon’s picture

StatusFileSize
new13.76 KB
new4.33 KB

chx reviewed this in IRC. Here's a new patch:
- take out most of the mention of load plugins (not widely needed)
- I had not quite gotten the process plugin description right

New patch and interdiff...

The last submitted patch, 5: 2216555-5.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 6: 2216555-6.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Needs review

weird. Message #8 says the patch in #6 failed testing, but it actually passed (meaning in this case: the patch applied and didn't introduce PHP errors; it's all docs).

benjy’s picture

All looks good, just noticed one thing:

+++ b/core/modules/migrate/migrate.api.php
@@ -1,12 +1,104 @@
+ * \Drupal\migrate\Entity\MigrationEntity; the configuration schema can be found

Wrong interface name. Should be MigrationInterface

jhodgdon’s picture

StatusFileSize
new13.76 KB
new1.58 KB

Good catch! Fixed that. Had to rewrap the paragraph. Patch and interdiff attached.

benjy’s picture

Status: Needs review » Reviewed & tested by the community

That reminds me, MigrationInterface could do with some clean-up itself.

Patch looks like RTBC, not sure if everything in the issue summary is complete. Do we have all the stub pages as suggested etc?

jhodgdon’s picture

Yes, I think the pages that are linked to on d.o are at least a good start/skeleton.

One thing I noticed while making this patch is the inconsistency between the names and locations/namespaces of the interfaces, base classes, and annotation classes. Take a look at the 3 sections about the plugin types:

a) Source:

+ * \Drupal\migrate\Plugin\MigrateSourceInterface and usually extend
+ * \Drupal\migrate\Plugin\migrate\source\SourcePluginBase. They are annotated
+ * with \Drupal\migrate\Annotation\MigrateSource annotation, and must be in

b) Process:

+ * \Drupal\migrate\Plugin\MigrateProcessInterface and usually extend
+ * \Drupal\migrate\ProcessPluginBase. They are annotated
+ * with \Drupal\migrate\Annotation\MigrateProcessPlugin annotation, and must be

c) Destination:

+ * \Drupal\migrate\Plugin\MigrateDestinationInterface and usually extend
+ * \Drupal\migrate\Plugin\migrate\destination\DestinationBase. They are
+ * annotated with \Drupal\migrate\Annotation\MigrateDestination annotation, and

I guess the interfaces are consistently named.

Two base classes are in their full Plugin\migrate\* directories; one is in the base migrate src directory.

One annotation class ends in "Plugin" and the other two do not.

Anyway, I'll just point this out and leave it to you to (hopefully) fix. If you do, please change the links -- the ProcessPluginBase class was apparently moved recently and links in various class headers were not changed (fixed in this patch).

webchick’s picture

Status: Reviewed & tested by the community » Fixed

I know we're in critical/major lock-down but I consider the parent issue major and this is the LAST one! :D

Committed and pushed to 8.x. YEAH!!!! Awesome work, everyone! So happy to have these docs chunks in prior to beta!

  • webchick committed a98ed74 on 8.0.x
    Issue #2216555 by jhodgdon, chx: Fill in @defgroup/topic docs for...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.