Skip to content

[RUN AS-IF-FOSS] BulkImports: Track pipeline worker with BulkImports::Tracker#status

Kassio Borges requested to merge kassio/bulkimports-track-pipeline-work into master

What does this MR do?

Context

Create a database representation, with the BulkImports::Tracker, for each BulkImport Pipeline (include BulkImports::Pipeline). This way, the pipeline progress can be tracked using the status column (state machine).

With this change we can run each pipeline on its own background job (#323384 (closed)), which will bring the power of retrying the pipeline in case of failures, like rate limiting.

Besides that, having each pipeline progress in the database will be handy to create a better UI to give an accurate sense of progress to the user in the future.

  • Merge request that introduced the status column to BulkImports::tracker: !5568 (merged)

The change

Before this change, BulkImports::Tracker was tracking only the pagination status, when required. So, a record was only created when the pipeline required pagination handling.

Now, before running a pipeline a BulkImports::Tracker record is created, and when the pipeline is finished, failed or skipped, these status are also updated/tracked in the pipeline's BulkImports::Tracker record.

The pipeline status is required to run them in individual background jobs because the pipelines have an order to run. For instance, we cannot import Epics before importing the Group or the Group labels.

Next step

  • #323384 (closed) - Create the BulkImports::PipelineWorker to run each pipeline on its own job.
  • !55928 (merged) - The code duplication on the #after_run method became more evident after this change. This MR aims to DRY this duplication.

References

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Kassio Borges

Merge request reports