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_importfinish_group_importfail_group_importcancel_group_importtimeout_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_importwhen the Group record is created. The same loader is reused by Offline Transfer'sImport::Offline::Groups::Pipelines::GroupPipeline, so this covers both without duplication.lib/bulk_imports/common/pipelines/entity_finisher.rb—finish_group_importwhen agroup_entityreaches the finished state.app/models/bulk_imports/entity.rb—fail_group_import,cancel_group_import, andtimeout_group_importvia the state machine's existingafter_transitionhooks forfail_op,cancel, andcleanup_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_importandtimeout_group_importare DT/OT-only. File-based group import (GroupImportState) has nocanceledortimeoutstates.config/events/cancel_group_import.ymlandtimeout_group_import.yml'sintroduced_by_urlwill be updated to this MR once it's assigned a number.
References
- #617884
- #627869 (closed)
- !253895 (merged) (project lifecycle events, the pattern this MR mirrors)
- !253927 (merged) (file-based group lifecycle events)
How to set up and validate locally
-
Enable Snowplow Micro so events are actually collected:
gdk config set snowplow_micro.enabled true gdk reconfigure gdk restart -
Monitor
http://gdk.test:9091/micro/goodto watch events -
Trigger a Direct Transfer group migration: New group -> Import group -> Direct Transfer
-
Optionally trigger an Offline Transfer group migration to see label
offline_transferon the same events.
Related to #627869 (closed)