Class: Gitlab::ImportExport::Group::RelationTreeRestorer

Inherits:
Object
  • Object
show all
Includes:
Utils::StrongMemoize, Import::Framework::ProgressTracking
Defined in:
lib/gitlab/import_export/group/relation_tree_restorer.rb

Direct Known Subclasses

Project::RelationTreeRestorer

Constant Summary

Constants included from Import::Framework::ProgressTracking

Import::Framework::ProgressTracking::CACHE_EXPIRATION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Import::Framework::ProgressTracking

#processed_entry?, #save_processed_entry, #with_progress_tracking

Constructor Details

#initialize(user:, shared:, relation_reader:, members_mapper:, object_builder:, relation_factory:, reader:, importable:, importable_attributes:, importable_path:, skip_on_duplicate_iid: false) ⇒ RelationTreeRestorer

rubocop:disable Metrics/ParameterLists



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/gitlab/import_export/group/relation_tree_restorer.rb', line 12

def initialize( # rubocop:disable Metrics/ParameterLists
  user:,
  shared:,
  relation_reader:,
  members_mapper:,
  object_builder:,
  relation_factory:,
  reader:,
  importable:,
  importable_attributes:,
  importable_path:,
  skip_on_duplicate_iid: false
)
  @user = user
  @shared = shared
  @importable = importable
  @relation_reader = relation_reader
  @members_mapper = members_mapper
  @object_builder = object_builder
  @relation_factory = relation_factory
  @reader = reader
  @importable_attributes = importable_attributes
  @importable_path = importable_path
  @skip_on_duplicate_iid = skip_on_duplicate_iid
end

Instance Attribute Details

#importableObject (readonly)

Returns the value of attribute importable.



10
11
12
# File 'lib/gitlab/import_export/group/relation_tree_restorer.rb', line 10

def importable
  @importable
end

Instance Method Details

#restoreObject



38
39
40
41
42
# File 'lib/gitlab/import_export/group/relation_tree_restorer.rb', line 38

def restore
  bulk_insert_without_cache_or_touch do
    create_relations!
  end
end

#restore_single_relation(relation_key, extra_track_scope: {}) ⇒ Object



44
45
46
# File 'lib/gitlab/import_export/group/relation_tree_restorer.rb', line 44

def restore_single_relation(relation_key, extra_track_scope: {})
  # NO-OP. This is currently only available for file-based project import.
end