[PoC] Export a single group relation to ndjson file and send it to BulkImport ETL pipeline for import via callback
What does this MR do?
This MR is a proof of concept of using ndjson relation export to be used in Bulk Import and it's ETL pipelines.
Implements 2 new group endpoints:
- Group relation export. Exports specified relation to ndjson file and sends it to provided callback url when it's complete
- Group relation import. Receives ndjson file and started Bulk Import ETL pipeline to process them
Added ndjson_pipeline!
attribute to BulkImport Pipeline type, in order to request ndjson file from source instance before doing any processing, since it relies on the file to be present.
Newly added ETL pipeline contains a lot of copy paste from existing various parts of Import/Export codebase, e.g. relation tree restorer, relation factory, object builder, etc. In a nutshell what is done there is, for each line in ndjson file:
- JSON decode into Hash
- Recursively traverse all nested hashes and convert them to corresponding relation class objects based on existing
import_export.yml
configuration from Import/Export code - Save converted Epic object with all of its nested objects (award emoji, notes, events, etc).
Every epic carried over it's subrelations: award emoji, notes and note award emoji. Import of 1k epics took less than 2 minutes.
In terms of security, we will probably need to include some sort of authenticity token/user information for relation export/import to make sure the request that comes in is legit.
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
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