Skip to content
Snippets Groups Projects

Add BulkImports::Failure model to capture Bulk Import failures

Merged George Koltsov requested to merge georgekoltsov/bulk-import-failures into master
All threads resolved!

What does this MR do?

This MR:

  • adds a new BulkImports::Failure model to help track import failures during Group Migration process (read about this new feature Import Group is working on here: &4374 (closed))
  • adds a new db table bulk_import_failures to store import failures
  • adds new failure capturing logic to BulkImports::Pipeline::Runner

There are 2 types of failures that we would like to track: the ones that abort the entire run & the ones that don't.

  1. If an error occurred during group creation - there is no need in trying to import epics or anything else into it, since group does not exist. In this case, raise an error, mark entire run to abort.
  2. If during import of 300 epics 1 epic failed to import - track the error but keep going. This is similar to existing Project/Group Import's ImportFailure logic.

The overall Group Migration feature is still in development, not rolled out and is behind bulk_import feature flag (that is turned off).

Mentions #268022 (closed)

Migration Output

Up

== 20201112132808 CreateBulkImportFailures: migrating =========================
-- table_exists?(:bulk_import_failures)
   -> 0.0005s
-- create_table(:bulk_import_failures)
   -> 0.0176s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE bulk_import_failures\nADD CONSTRAINT check_053d65c7a4\nCHECK ( char_length(pipeline_class) <= 255 )\nNOT VALID;\n")
   -> 0.0006s
-- current_schema()
   -> 0.0001s
-- execute("SET statement_timeout TO 0")
   -> 0.0002s
-- execute("ALTER TABLE bulk_import_failures VALIDATE CONSTRAINT check_053d65c7a4;")
   -> 0.0005s
-- execute("RESET ALL")
   -> 0.0002s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE bulk_import_failures\nADD CONSTRAINT check_c7dba8398e\nCHECK ( char_length(exception_class) <= 255 )\nNOT VALID;\n")
   -> 0.0004s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE bulk_import_failures VALIDATE CONSTRAINT check_c7dba8398e;")
   -> 0.0005s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE bulk_import_failures\nADD CONSTRAINT check_6eca8f972e\nCHECK ( char_length(exception_message) <= 255 )\nNOT VALID;\n")
   -> 0.0003s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE bulk_import_failures VALIDATE CONSTRAINT check_6eca8f972e;")
   -> 0.0005s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE bulk_import_failures\nADD CONSTRAINT check_e787285882\nCHECK ( char_length(correlation_id_value) <= 255 )\nNOT VALID;\n")
   -> 0.0003s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE bulk_import_failures VALIDATE CONSTRAINT check_e787285882;")
   -> 0.0004s
== 20201112132808 CreateBulkImportFailures: migrated (0.0384s) ================

Down

== 20201112132808 CreateBulkImportFailures: reverting =========================
-- drop_table(:bulk_import_failures)
   -> 0.0020s
== 20201112132808 CreateBulkImportFailures: reverted (0.0070s) ================

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 George Koltsov

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Kassio Borges
  • Kassio Borges
  • Kassio Borges
  • George Koltsov added 708 commits

    added 708 commits

    Compare with previous version

  • George Koltsov added 1 commit

    added 1 commit

    • 70b0f5f6 - Add BulkImports::Failure model to capture Bulk Import failures

    Compare with previous version

  • George Koltsov marked this merge request as ready

    marked this merge request as ready

  • unassigned @kassio

  • 🤖 GitLab Bot 🤖 changed milestone to %13.7

    changed milestone to %13.7

  • George Koltsov added 162 commits

    added 162 commits

    Compare with previous version

  • George Koltsov added 1 commit

    added 1 commit

    • 6cb7367a - Add BulkImports::Failure model to capture Bulk Import failures

    Compare with previous version

  • George Koltsov resolved all threads

    resolved all threads

  • George Koltsov added 1 commit

    added 1 commit

    • ad3f8117 - Add BulkImports::Failure model to capture Bulk Import failures

    Compare with previous version

  • George Koltsov added 1 commit

    added 1 commit

    • c9964b87 - Add BulkImports::Failure model to capture Bulk Import failures

    Compare with previous version

  • @robotmay_gitlab may I ask you to do database review of this change, please? :pray:

  • unassigned @kassio

  • Robert May approved this merge request

    approved this merge request

  • added databasereviewed label and removed databasereview pending label

  • Robert May assigned to @pbair and unassigned @robotmay_gitlab

    assigned to @pbair and unassigned @robotmay_gitlab

  • George Koltsov added 126 commits

    added 126 commits

    Compare with previous version

  • George Koltsov marked the checklist item Changelog entry as completed

    marked the checklist item Changelog entry as completed

  • George Koltsov changed the description

    changed the description

  • assigned to @kassio

  • Kassio Borges approved this merge request

    approved this merge request

  • unassigned @kassio

  • George Koltsov added 13 commits

    added 13 commits

    Compare with previous version

  • @engwan may I ask you for backend maintainer review, please? :pray:

  • assigned to @engwan

  • George Koltsov changed the description

    changed the description

  • Sorry I wasn't able to get to this today and I'll be OOO until next Monday.

    Can you assign to another maintainer please?

  • Patrick Bair
  • added databaseapproved label and removed databasereviewed label

  • Patrick Bair approved this merge request

    approved this merge request

  • @georgekoltsov LGTM from database. I left one small question, but if you think this is fine as-is then I see no problems with it.

  • unassigned @pbair

  • @jameslopez may I ask you to review this change, please? :pray: :bow:

  • James Lopez
  • James Lopez
  • James Lopez
  • mentioned in issue #271233 (closed)

  • George Koltsov added 741 commits

    added 741 commits

    Compare with previous version

  • James Lopez resolved all threads

    resolved all threads

  • James Lopez approved this merge request

    approved this merge request

  • merged

  • James Lopez mentioned in commit c6da895b

    mentioned in commit c6da895b

  • added workflowcanary label and removed workflowstaging label

  • added workflowproduction label and removed workflowcanary label

  • 🤖 GitLab Bot 🤖 added groupimport and integrate label and removed 1 deleted label

    added groupimport and integrate label and removed 1 deleted label

  • Please register or sign in to reply
    Loading