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

labels_pipeline.rb « pipelines « groups « bulk_imports « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 40dab9b444c795fbf77274435bcf0add52d69f06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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