Skip to content

Preserve Epic parent-child association when importing using Bulk Import

What does this MR do?

This MR updates Bulk Import's (https://docs.gitlab.com/ee/development/bulk_import.html) Group Epic import to preserve epic's parent-child association. It:

  • Updates EE::BulkImports::Groups::Graphql::GetEpicsQuery to include iid, parent and children information
  • During transformation, look up parent and children epics by iid and map them to newly created epic

To test

  1. Create a new group and seed it with epics (having child-parent associations)
  2. Copy name & path of that group
  3. Open rails console and run (replace with your values)
Feature.enable(:bulk_import) 

rand = (1..1000).to_a.sample
user = User.first
credentials = { url: 'http://gdk.test:3000', access_token: <api scope token> }
params = [{ source_type: 'group_entity', source_name: '<source group name>', source_full_path: '<source group path>', destination_name: "foo#{rand}", destination_namespace: 'root' }]

BulkImportService.new(user, params, credentials).execute

bulk_import = BulkImport.last
bulk_import.finished? 

Alternatively you can import the group via UI by opening Import tab in '/groups/new' page.

  1. Wait for bulk import to finish (this requires sidekiq to be running)
  2. Once finished, verify a new group epics are imported and their parent-child association is preserved

Mentions #297459 (closed)

Screenshots (strongly suggested)

Source Destination
image image

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