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
- Create a new group and seed it with epics (having child-parent associations)
- Copy name & path of that group
- 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.
- Wait for bulk import to finish (this requires sidekiq to be running)
- Once finished, verify a new group epics are imported and their parent-child association is preserved
Mentions #297459 (closed)
Screenshots (strongly suggested)
Source | Destination |
---|---|
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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