Skip to content

Refactor JSON reader/writer for import/export

Kamil Trzciński requested to merge try-to-support-ndjson-in-a-generic-way into master

What does this MR do?

This is done to make it easy to use this structure for .ndjson: &2734 (comment 308466773)

Overall this MR introduces the following changes:

  • adds allowed_path to strong validate LegacyReader and LegacyWriter
  • does not change any of todays behaviour for data serialization
  • makes the interface for reader and writer to accept importable/exportable_path that will be used by ndjson to store data in separate files
  • moves consuming of attributes outside of the relation tree restorer to ease the way how we process them
  • splits specs for LegacyReader::User/File and introduces shared example for that: this is also the majority of changes introduced by this MR in order to move them
  • slightly code-formats and re-organises group and project import/export

This is done to be able to implement the following data structure for project and group exports, but continuing to support legacy format for time being in a same way for PROJECT-only:

/tree/project.json
/tree/project/merge_requests.ndjson
/tree/project/services.ndjson
/tree/groups.ndjson
/tree/groups/100/epics.ndjson
/tree/groups/200/epics.ndjson

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 🤖 GitLab Bot 🤖

Merge request reports