Problem/Motivation

MigrationInterface has many left over comments from the D7 migrate module and none of it matches the coding standards.

Proposed resolution

Tidy up the comments and fix up the coding standards.

Remaining tasks

Review patch.

User interface changes

n/a

API changes

Consider removing the STATUS_* constants and maybe bringing them back in: #2289503: Track state of migrations

Comments

chx’s picture

StatusFileSize
new87.43 KB

I really only have one reaction to this sort of doxygen.

(The migration is currently importing for STATUS_IMPORTING, The destination plugin for getDestinationPlugin() etc)

chx’s picture

Status: Needs review » Reviewed & tested by the community

Oh well, at least phpcs is happy. I guess it's not the role of every @return to explain what's what.

alexpott’s picture

Component: migration system » documentation
Assigned: benjy » jhodgdon

Moving to jhodgdon's queue.

jhodgdon’s picture

Status: Reviewed & tested by the community » Needs work

This is pretty good... and thanks for making the patch! A few errors:

a)

+  /**
+   * The migration is currently been rolled back.
+   */
   const STATUS_ROLLING_BACK = 2;

...
+
+  /**
+   * The migration is been stopped.
+   */
   const STATUS_STOPPING = 3;

been => being

b) This section seems inconsistent:

+   * Migration error.
    */
   const MESSAGE_ERROR = 1;
+
+  /**
+   * Migration warning.
+   */
   const MESSAGE_WARNING = 2;
+
+  /**
+   * Migration notice.
+   */
   const MESSAGE_NOTICE = 3;
+
+  /**
+   * Represents a condition that did not prevent the operation from succeeding.
+   */
   const MESSAGE_INFORMATIONAL = 4;

If you're going to be all verbose on the last one, be verbose on the others... or make the last one more concise? I don't think the description on Informational really makes it different from Notice either?

c)

+  /**
+   * The process has interrupted itself (e.g., the memory limit is approaching)
+   */
+  const RESULT_INCOMPLETE = 2;

Really? interrupted itself?... OK, but needs to end in .

d)

+
+  /**
+   * The process was stopped externally (e.g., via drush migrate-stop)
+   */
+  const RESULT_STOPPED = 3;

Also needs to end in . and can this be more consistently worded with the previous one? The other one says the process "interrupted itself" (??) and this one says it "was stopped" (seems much better). But really, what's the difference?

e)

    * @return \Drupal\migrate\Plugin\MigrateIdMapInterface
+   *   The idMap.
    */
   public function getIdMap();

Can this say "The ID map"?

f)

    * @return int
+   *   A unix timestamp representing the highwater mark.
    */
   public function getHighwater();

What's a highwater mark, and shouldn't it be "high water" (two words) anyway?

jhodgdon’s picture

Assigned: jhodgdon » Unassigned
benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new1.47 KB
new3.73 KB

All fixed.

In relation to what is a high water mark.

   * The high water mark defines a timestamp stating the time the import was
   * last run. If the mark is set, only content with a higher timestamp will be
   * imported.

Also, yes i think it should be two words but it's riddled throughout the codebase as one word, mainly left over from D7. Shall we do that in a follow-up?

jhodgdon’s picture

Regarding "highwater" vs. "high water", the text you cited has it as two words. :) But I agree, the text above that in the documentation for this method has two words, so one word is fine, I guess...

The methods are also inconsistent. Some of them are CamelCased with HighWater and some with Highwater. This should all be fixed, but I agree it's a separate issue: #2320245: High water should consistently be two words -- so let's leave it as-is for now.

We should probably capitalize Unix, though? (in that same line about the high water mark). Everything else looks good; sorry for missing that last time through.

benjy’s picture

StatusFileSize
new234.04 KB
new525 bytes

Unix capitalised. Will handle the high water stuff in the follow up later today.

benjy’s picture

StatusFileSize
new3.73 KB

Ooops, branch was a bit behind. Ignore patch from #8

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good to me!

jhodgdon’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Patch doesn't apply. Looks like the interface moved?

jhodgdon’s picture

Status: Needs work » Fixed
Issue tags: -Needs reroll

wait, I was trying to apply to wrong branch. :)

Committed to 8.0.x.

  • jhodgdon committed c6ec2ad on 8.0.x
    Issue #2316413 by benjy, chx: Clean up MigrationInterface docs
    

Status: Fixed » Closed (fixed)

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