Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bulk_imports/groups/pipelines/project_entities_pipeline.rb')
-rw-r--r--lib/bulk_imports/groups/pipelines/project_entities_pipeline.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/bulk_imports/groups/pipelines/project_entities_pipeline.rb b/lib/bulk_imports/groups/pipelines/project_entities_pipeline.rb
new file mode 100644
index 00000000000..c318675e649
--- /dev/null
+++ b/lib/bulk_imports/groups/pipelines/project_entities_pipeline.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+module BulkImports
+ module Groups
+ module Pipelines
+ class ProjectEntitiesPipeline
+ include Pipeline
+
+ extractor Common::Extractors::GraphqlExtractor, query: Graphql::GetProjectsQuery
+ transformer Common::Transformers::ProhibitedAttributesTransformer
+
+ def transform(context, data)
+ {
+ source_type: :project_entity,
+ source_full_path: data['full_path'],
+ destination_name: data['name'],
+ destination_namespace: context.entity.group.full_path,
+ parent_id: context.entity.id
+ }
+ end
+
+ def load(context, data)
+ context.bulk_import.entities.create!(data)
+ end
+ end
+ end
+ end
+end