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

group_attributes_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: d4f5901e971fb9130acde860da6afb21d21f2da9 (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
34
35
# frozen_string_literal: true

module BulkImports
  module Groups
    module Pipelines
      class GroupAttributesPipeline
        include Pipeline

        file_extraction_pipeline!

        relation_name BulkImports::FileTransfer::BaseConfig::SELF_RELATION

        extractor ::BulkImports::Common::Extractors::JsonExtractor, relation: relation

        transformer ::BulkImports::Common::Transformers::ProhibitedAttributesTransformer

        def transform(_context, data)
          return unless data

          data.symbolize_keys.slice(:membership_lock)
        end

        def load(_context, data)
          return unless data

          ::Groups::UpdateService.new(portable, current_user, data).execute
        end

        def after_run(_context)
          extractor.remove_tmpdir
        end
      end
    end
  end
end