Skip to content

Add Attributes cleaner to Group Migration

What does this MR do?

overall Group Migration feature is behind bulk_import feature flag which is currently turned off. This feature is still in active development (read about it here: &4374 (closed))

This MR adds a new transformer to Group Migration main pipelines which removes prohibited references that are not allowed when performing an import of Groups & their epics. This is a similar feature that we have in Project Import/Export Gitlab::ImportExport::AttributeCleaner https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/import_export/attribute_cleaner.rb

Filter out any hash keys that:

  • is an id
  • end on _id, _ids, _html, attributes, cached_markdown_version
  • remote_*_url, remote_*_urls, remote_*_request_header

When performing Group Migration using GraphQL we explicitly request a fixed set of fields without any mentions of the fields above. However, this does not mean that a source GitLab instance can't be mocked to return information including these fields, hence we need this transformer to perform a cleanup, before persisting data, in order to prevent unexpected side effects.

This transformer needs to be added into each pipeline manually as of now, however we plan to iterate 👣 on this and add automated detection of missing transformers in the pipelines (fail a CI job if transformer has not been found) or include it by default when defining a pipeline. This is out of scope of this MR and Import team will add this functionality later on.

Mentions #283910 (closed)

Screenshots (strongly suggested)

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