Problem/Motivation

During the migration process, conditions may arise that need communication, and potentially aborting a given row or the entire migration process. Right now it's confusing to developers how to communicate these conditions, and the available means for communication and exceptions differ according to where in the pipeline the condition is detected.

Communication

There are two means of communicating conditions during migration

  • The MigrateMessageInterface service, which is intended for messages to be communicated directly to the front-end (drush command/web UI), such as a migration as a whole being skipped or aborted.
  • The ID map class saveMessage() method, which is intended for logging conditions specific to a given source row (it logs to a message table keyed by the source ID).

One issue we need is to clearly document these two methods and provide examples of when/where to use each on d.o. Even with that, however, they are not consistently available - for example, process plugins have no clean access to the MigrateExecutable's message service for display to the front end.

Exceptions

Migrate has three exception classes for use during processing- MigrateException, MigrateSkipProcessException, and MigrateSkipRowException. When to use each exception is not clearly documented. More confusing, different exceptions are caught at different points in the pipeline - which exceptions are caught and how they are handled differ according to whether they're thrown from a source plugin (prepareRow), process plugin, or destination plugin). This is confusing, and some valid exception scenarios may not be supported at this time.

Related issues

Issues relating directly to these WTFs:

Other issues related to exceptions/messages:

Proposed resolution

TBD

Remaining tasks

  1. Thoroughly document and understand the whens/wheres of messaging and exceptions as they exist now in the issue summary.
  2. Discuss possible resolutions.
  3. Create appropriate child issues.
  4. Implement the child issues.

User interface changes

N/A

API changes

TBD

Comments

mikeryan created an issue. See original summary.

mikeryan’s picture

Issue summary: View changes
neclimdul’s picture

Additional things discussed in IRC but not found in the related issue list:
1) Exception in process plugins don't seem to be reporting anywhere and don't have a method for displaying messages.
2) neclimdul is confused.

Possible solutions might include some of the following tasks:
1) Making the message interface a display interface.
2) Displaying messages(saveMessage messages) using the display service.
3) Improving documentation on when to call saveMessage.
4) Explaining to me(and documenting) why queueMessage exists.
5) Exposing display functionality through the executable(this could probably replace #2546004: Add message service to migrate events and is inline with things like #2443617: Find a way for SourcePluginBase to get MigrateExecutable

mikeryan’s picture

Category: Task » Plan
Priority: Normal » Major
Issue tags: +Migrate critical

Marking as migrate-critical - I think it is critical to do the analysis and clearly identify specific issues and possible solutions, and it's quite likely we'll have at least one migrate-critical patch come out of this.

mikeryan’s picture

I'm working on the analysis at https://docs.google.com/document/d/17-nH0k8ZxfrUs4mf3pPDFHEHhjeDzyIS4G54....

As a starting point, the biggest WTF (and one I know is hanging up @neclimdul and @lostkangaroo) is #2559571: Handle MigrateException consistently during import. If not migrate-critical, I think it's close...

mikeryan’s picture

Created an issue discussing the message table architecture at #2561413: Consider reimplementing message tables using LoggerInterface.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mikeryan’s picture

Status: Active » Fixed
Issue tags: -Migrate critical

The remaining child/related issues are not Migrate-critical and can stand-alone, so removing the Migrate critical tag and closing this.

Status: Fixed » Closed (fixed)

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