MigrateBatchExecutable doesn't need additional progress messages

Created on 4 May 2022, over 2 years ago
Updated 17 January 2023, almost 2 years ago

Problem/Motivation

When running a migration through the UI (we are using the excellent migrate_source_ui by the way) there is currently:

  • For each batch run, a "progress" message being displayed
    (Coming from \Drupal\migrate_tools\MigrateExecutable::progressMessage())
  • Once all batches are complete, a message summarizing all the results
    (Coming from \Drupal\migrate_tools\MigrateBatchExecutable::batchFinishedImport())

My apologies if I'm missing something obvious, but it seems like we shouldn't need to output progress messages when running the migration via batch UI. The batch UI has its own progress display, and we have the batchFinishedImport() already to summarize all the batches.

Note: I'm not totally sure if this is separate from #3253741: MigrateBatchExecutable cleans message after each batch iterration. or not, some of the wording there made it sound like a separate issue (since this is about Drupal messenger messages, not migrate messages which are stored in a table) so I'm starting this one.

"Before" screenshot showing the duplication (note that this is actually the first message being output 8 times, but the Drupal message de-duplication is hiding the 7 other instances of that same message, one for each batch):

Steps to reproduce

Sorry, not sure the exact steps to reproduce this with migrate_tools alone - but it can be seen fairly easily with migrate_source_ui. If it is in fact an issue specific to that project I'm happy for this issue to be moved there. The steps to reproduce from #3253741: MigrateBatchExecutable cleans message after each batch iterration. may be helpful.

I'm happy to spend more time on reproducing this from a clean install, but it may make more sense to work on automated test coverage.

Proposed resolution

Don't output messages during the batch processing at all. Only output the message at the end summarizing all batches (here is an "After" screenshot):

Remaining tasks

  • Patch
  • Tests

User interface changes

When running migrations via batch UI (using MigrateBatchExecutable), there will only be one message displayed at the end of all batches, rather than a message after each batch plus the message at the end of all batches.

API changes

If anyone is overriding the progressMessage() method and extending from MigrateBatchExecutable we might break their code. But it doesn't really seem like API to me.

Data model changes

n/a

🐛 Bug report
Status

Fixed

Version

5.0

Component

Code

Created by

🇨🇦Canada star-szr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024