Provide relevant tokens to migrate events

Created on 21 July 2023, over 1 year ago
Updated 5 June 2024, 6 months ago

Problem/Motivation

The `migrate` ECA sub-module provides useful migration related events, but it doesn't appear that the relevant migration data is exposed as tokens. Things like information about the running migration, the migration row being processed, and the migrate message being saved, are some examples.

Proposed resolution

Exposed relative migration data as tokens for migration events.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pcate

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

Comments & Activities

  • Issue created by @pcate
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Can we get a list of tokens for each event? That's required to move forward with this one.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    @PCate I'd be happy to address this for the forthcoming ECA 2 release. However, I'd need your help as I don't have an overview of which data would be required for which of the migration events. Could you please provide me with some input on this?

  • πŸ‡ΊπŸ‡ΈUnited States pcate

    @jurgenhaas happy to help if I can. Would something like the following be helpful?

    Name: migrate.pre_import
    Description: Fired when beginning a migration import operation.
    Tokens:
    migration: The migration entity being run.

    Name: migrate.idmap_message
    Description: Fired when saving a message to the ID map.
    Tokens:
    migration: The migration entity being run.
    source_id_values: The source ID values.
    message: The message to be logged.
    level: The severity level of the message.

    If this is the information you are looking for, I should be able to provide a list of these.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    @PCate yes, that looks like what's needed. I guess, most of the "tokens" are read-only and a few (e.g. "row") might be modifiable, right?

  • πŸ‡ΊπŸ‡ΈUnited States pcate

    @jurgenhaas below is the list of relevent tokens/events.

    Name: migrate.pre_import
    Description: Fired when beginning a migration import
    operation.
    Tokens:
    • migration: The migration entity being run.

    Name: migrate.post_import
    Description: Fired when finishing a migration import
    operation.
    Tokens:
    • migration: The migration entity being run.

    Name: migrate.map_save
    Description: Fired when saving to a migration's map.
    Tokens:
    • map: The map plugin that caused the event to fire.
    • fields: Array of map fields, keyed by field name.

    Name: migrate.map_delete
    Description: Fired when removing an entry from a
    migration's map.
    Tokens:
    • map: The map plugin that caused the event to fire.
    • source_id: The source ID values.

    Name: migrate.pre_row_save
    Description: Fired when about to import a single item.
    Tokens:
    • migration: The migration entity being run.
    • row: The row about to be imported.

    Name: migrate.post_row_save
    Description: Fired just after a single item has been
    imported.
    Tokens:
    • migration: The migration entity being run.
    • row: The row just saved.
    • destination_id_values: The row's destination ID.

    Name: migrate.pre_rollback
    Description: Fired when beginning a migration rollback
    operation.
    Tokens:
    • migration: The migration entity that will be rolled back.

    Name: migrate.post_rollback
    Description: Fired when finishing a migration rollback
    operation.
    Tokens:
    • migration: The migration entity that was just rolled
      back.

    Name: migrate.pre_row_delete
    Description: Fired when about to delete a single item.
    Tokens:
    • migration: The migration entity that was just rolled
      back.
    • row: The row to be deleted.

    Name: migrate.post_row_delete
    Description: Fired just after a single item has been
    deleted.
    Tokens:
    • migration: The migration entity being run.
    • destination_id_values: The row's destination ID.

    Name: migrate.idmap_message
    Description: Fired when saving a message to the ID map.
    Tokens:
    • migration: The migration entity being run.
    • source_id_values: The source ID values.
    • message: The message to be logged.
    • level: The severity level of the message.
  • πŸ‡ΊπŸ‡ΈUnited States pcate

    I guess, most of the "tokens" are read-only and a few (e.g. "row") might be modifiable, right?

    @jurgenhaas, I would expect the "pre/save" events would have modifiable tokens, but the "post/delete" ones would not?

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I would expect the "pre/save" events would have modifiable tokens, but the "post/delete" ones would not?

    That sounds reasonable, yes.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • Status changed to Needs review 6 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I have implemented support for those tokens, please review.

  • Status changed to RTBC 6 months ago
  • πŸ‡©πŸ‡ͺGermany danielspeicher Steisslingen

    Works perfectly fine.

  • Status changed to Fixed 6 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Perfect, thank you. Now we're down to just 1 issue before we can go beta ;-) I'm on it.

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

Production build 0.71.5 2024