Add better error handling to BulkImports::GroupLoader
What does this MR do and why?
This MR:
- Fixes a bug where an unhadled error during group creation did not update Import state properly, giving an impression the import was completed, where in reality it failed
- Adds a bit of resiliency to BulkImport's GroupLoader, in order to provide better error handling. We want to raise exceptions in the
GroupLoader
which get bubbled up and handled in theBulkImports::Pipeline::Runner
and update the import state properly (http://gitlab.com/gitlab-org/gitlab/blob/georgekoltsov/enhance-group-migration-resiliency/lib/bulk_imports/pipeline/runner.rb#L47-L65)
Mentions https://gitlab.com/gitlab-org/gitlab/-/issues/342522
Screenshots or screen recordings
How to set up and validate locally
Feature.enable(:bulk_import)
- Create a top level group
- Go to
/groups/new#import-group-pane
page and enter instance url and access token (needs to beapi
scope) - Select newly created group, enter destination to be user namespace
- Wait for Group import to complete and verify it failed
- Verify
bulk_import_failures
table contains an error andbulk_import
state isfailed
(-1
)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by George Koltsov