Add Attributes cleaner to Group Migration
What does this MR do?
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
Mentions #283910 (closed)
Screenshots (strongly suggested)
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