Track Direct Transfer/Offline Transfer group lifecycle events

What does this MR do and why?

Fires the remaining internal events for the group import lifecycle in Direct Transfer and Offline Transfer, mirroring the project lifecycle events already shipped in !253895 (merged).

Five events are emitted:

  • start_group_import
  • finish_group_import
  • fail_group_import
  • cancel_group_import
  • timeout_group_import

The first three already existed as event definitions but only fired from standard file-based group import (GroupImportState). This MR adds the DT/OT half, plus two new events (cancel_group_import, timeout_group_import) that only apply to DT/OT since file-based group import has no cancel/timeout states.

Where the events fire

  • lib/bulk_imports/groups/loaders/group_loader.rb — start_group_import when the Group record is created. The same loader is reused by Offline Transfer's Import::Offline::Groups::Pipelines::GroupPipeline, so this covers both without duplication.
  • lib/bulk_imports/common/pipelines/entity_finisher.rb — finish_group_import when a group_entity reaches the finished state.
  • app/models/bulk_imports/entity.rb — fail_group_import, cancel_group_import, and timeout_group_import via the state machine's existing after_transition hooks for fail_op, cancel, and cleanup_stale.

Every event carries the same shape as the project events: user / namespace identifiers, a label (importer name), and a hashed import_source property. The label is derived from bulk_import.offline? (gitlab_group_migration for Direct Transfer, offline_transfer for Offline Transfer), not from any attribute of the group, since the group record doesn't exist yet on fail_group_import if the entity fails before its pipeline runs. This mirrors the pattern established in !253895 (merged) for project events.

Scope notes

  • This MR covers the second half of #627869 (closed) (the DT/OT half). The standard file-based group import half shipped in !253927 (merged).
  • Part of #617884.
  • cancel_group_import and timeout_group_import are DT/OT-only. File-based group import (GroupImportState) has no canceled or timeout states.
  • config/events/cancel_group_import.yml and timeout_group_import.yml's introduced_by_url will be updated to this MR once it's assigned a number.

References

How to set up and validate locally

  1. Enable Snowplow Micro so events are actually collected:

    gdk config set snowplow_micro.enabled true
    gdk reconfigure
    gdk restart
  2. Monitor http://gdk.test:9091/micro/good to watch events

  3. Trigger a Direct Transfer group migration: New group -> Import group -> Direct Transfer

  4. Optionally trigger an Offline Transfer group migration to see label offline_transfer on the same events.

Related to #627869 (closed)

Merge request reports

Loading
Loading