Skip to content

BulkImports: Add `pipeline_name`, `stage`, `jid` and `status` to `BulkImports::Tracker`

Context

As part of the road to a better concurrent approach (&5544) for the Gitlab Group Migration, we need a way to keep track of the status of each pipeline. Currently, the data-model already have a way to keep track of the pagination requirements for each pipeline in the bulkimport_trackers table. Since the pagination is already scoped by pipeline, it seems to be a perfect place to add more data required by the concurrent model.

Proposed changes

  1. Add stage, jid and status to BulkImports::Tracker
  2. Add attribute_alias :pipeline_name, :relation, to make more explicit what's being saved in this column. Adding a new column would add constraints complexity since relation is already required and pipeline_name would also be required, in case of a database revert we could end up with null values on columns that have a not_null constraint.
  3. Add the a state machine to BulkImports::Tracker, similar to the one in BulkImports::Entity

Based on the spike: !54970 (closed)

Edited by Kassio Borges