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/labels_pipeline.rb')
-rw-r--r--lib/bulk_imports/groups/pipelines/labels_pipeline.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/bulk_imports/groups/pipelines/labels_pipeline.rb b/lib/bulk_imports/groups/pipelines/labels_pipeline.rb
new file mode 100644
index 00000000000..40dab9b444c
--- /dev/null
+++ b/lib/bulk_imports/groups/pipelines/labels_pipeline.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+module BulkImports
+ module Groups
+ module Pipelines
+ class LabelsPipeline
+ include Pipeline
+
+ extractor BulkImports::Common::Extractors::GraphqlExtractor,
+ query: BulkImports::Groups::Graphql::GetLabelsQuery
+
+ transformer Common::Transformers::ProhibitedAttributesTransformer
+
+ loader BulkImports::Groups::Loaders::LabelsLoader
+
+ def after_run(extracted_data)
+ context.entity.update_tracker_for(
+ relation: :labels,
+ has_next_page: extracted_data.has_next_page?,
+ next_page: extracted_data.next_page
+ )
+
+ if extracted_data.has_next_page?
+ run
+ end
+ end
+ end
+ end
+ end
+end