migrate-import by tag prints duplicate messages

Created on 25 November 2021, about 3 years ago
Updated 24 January 2023, almost 2 years ago

Problem/Motivation

When you group together migrations by tag, e.g. "media" or "node" or something like that and then try to import them like drush migrate-import --tag=node --execute-dependencies, it prints the summary information multiple times.

When you are migrating content from 50 sites, it pretty makes the output useless as it can be printing screens full of summary updates before the latest update.

Versions in use

Drush Launcher Version: 0.8.0
Drush Commandline Tool 10.5.0
Drupal 9.2.2
Migrate Tools 5.0 dev version, commit 60bc0c01f1468cd58f7dec1dee6f6170cd5244e8 (6th Dec 2021)

Steps to reproduce

For the first migration, it will print one line like this:
[notice] Processed 312 items (312 created, 0 updated, 0 failed, 0 ignored) - done with 'node_news'

For the second migration, it will print two lines:

[notice] Processed 312 items (312 created, 0 updated, 0 failed, 0 ignored) - done with 'node_news'
[notice] Processed 486 items (485 created, 0 updated, 0 failed, 1 ignored) - done with 'node_event'

For the third migration, it will print three lines:

[notice] Processed 312 items (312 created, 0 updated, 0 failed, 0 ignored) - done with 'node_news'
[notice] Processed 486 items (485 created, 0 updated, 0 failed, 1 ignored) - done with 'node_event'
[notice] Processed 677 items (677 created, 0 updated, 0 failed, 0 ignored) - done with 'node_page'

and so on.

This means when you view the full output, you see this:

[notice] Processed 312 items (312 created, 0 updated, 0 failed, 0 ignored) - done with 'node_news'
[notice] Processed 312 items (312 created, 0 updated, 0 failed, 0 ignored) - done with 'node_news'
[notice] Processed 486 items (485 created, 0 updated, 0 failed, 1 ignored) - done with 'node_event'
[notice] Processed 312 items (312 created, 0 updated, 0 failed, 0 ignored) - done with 'node_news'
[notice] Processed 486 items (485 created, 0 updated, 0 failed, 1 ignored) - done with 'node_event'
[notice] Processed 677 items (677 created, 0 updated, 0 failed, 0 ignored) - done with 'node_page'

Proposed resolution

Can we have it so that it only prints the most recent summary output when each individual migration completes? And not whatever else has gone before on every single update?

Feature request
Status

Fixed

Version

5.0

Component

Code

Created by

🇮🇪Ireland stella

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.

  • 🇺🇸United States RoloDMonkey

    Thanks to everyone for fixing this! I have been putting up with my terminal being flooded by duplicate messages while I tested and re-tested a pretty complex migration. I never had time to look into why it was happening.

    Today, it took me a moment to realize that I only saw one line/notice in my terminal for each migration. What a pleasant surprise!

Production build 0.71.5 2024