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

group_importer.rb « importers « bulk_imports « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 82cb1ca03a2a95bb219bf93abe0209576d037aea (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
31
32
33
# frozen_string_literal: true

module BulkImports
  module Importers
    class GroupImporter
      def initialize(entity)
        @entity = entity
      end

      def execute
        entity.start!
        bulk_import = entity.bulk_import
        configuration = bulk_import.configuration

        context = BulkImports::Pipeline::Context.new(
          current_user: bulk_import.user,
          entity: entity,
          configuration: configuration
        )

        BulkImports::Groups::Pipelines::GroupPipeline.new.run(context)
        'BulkImports::EE::Groups::Pipelines::EpicsPipeline'.constantize.new.run(context) if Gitlab.ee?
        BulkImports::Groups::Pipelines::SubgroupEntitiesPipeline.new.run(context)

        entity.finish!
      end

      private

      attr_reader :entity
    end
  end
end