Class: Gitlab::GithubImport::Importer::IssuesImporter

Inherits:
Object
  • Object
show all
Includes:
ParallelScheduling
Defined in:
lib/gitlab/github_import/importer/issues_importer.rb

Constant Summary

Constants included from ParallelScheduling

ParallelScheduling::ALREADY_IMPORTED_CACHE_KEY, ParallelScheduling::JOB_WAITER_CACHE_KEY, ParallelScheduling::JOB_WAITER_REMAINING_CACHE_KEY

Instance Attribute Summary

Attributes included from ParallelScheduling

#already_imported_cache_key, #client, #job_waiter_cache_key, #job_waiter_remaining_cache_key, #page_counter, #project

Instance Method Summary collapse

Methods included from ParallelScheduling

#abort_on_failure, #already_imported?, #each_object_to_import, #execute, #mark_as_imported, #parallel?, #parallel_import, #sequential_import, #spread_parallel_import

Methods included from JobDelayCalculator

#parallel_import_batch

Constructor Details

#initialize(project, client, parallel: true) ⇒ IssuesImporter

Returns a new instance of IssuesImporter.



9
10
11
12
13
# File 'lib/gitlab/github_import/importer/issues_importer.rb', line 9

def initialize(project, client, parallel: true)
  super

  @work_item_type_id = ::WorkItems::Type.default_issue_type.id
end

Instance Method Details

#collection_methodObject



31
32
33
# File 'lib/gitlab/github_import/importer/issues_importer.rb', line 31

def collection_method
  :issues
end

#collection_optionsObject



39
40
41
# File 'lib/gitlab/github_import/importer/issues_importer.rb', line 39

def collection_options
  { state: 'all', sort: 'created', direction: 'asc' }
end

#id_for_already_imported_cache(issue) ⇒ Object



35
36
37
# File 'lib/gitlab/github_import/importer/issues_importer.rb', line 35

def id_for_already_imported_cache(issue)
  issue[:number]
end

#importer_classObject



15
16
17
# File 'lib/gitlab/github_import/importer/issues_importer.rb', line 15

def importer_class
  IssueAndLabelLinksImporter
end

#increment_object_counter?(object) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/gitlab/github_import/importer/issues_importer.rb', line 43

def increment_object_counter?(object)
  object[:pull_request].nil?
end

#object_typeObject



27
28
29
# File 'lib/gitlab/github_import/importer/issues_importer.rb', line 27

def object_type
  :issue
end

#representation_classObject



19
20
21
# File 'lib/gitlab/github_import/importer/issues_importer.rb', line 19

def representation_class
  Representation::Issue
end

#sidekiq_worker_classObject



23
24
25
# File 'lib/gitlab/github_import/importer/issues_importer.rb', line 23

def sidekiq_worker_class
  ImportIssueWorker
end