Class: Gitlab::GithubImport::Importer::PullRequestsMergedByImporter

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

Constant Summary

Constants included from ParallelScheduling

ParallelScheduling::ALREADY_IMPORTED_CACHE_KEY

Instance Attribute Summary

Attributes included from ParallelScheduling

#already_imported_cache_key, #client, #page_counter, #project

Instance Method Summary collapse

Methods included from ParallelScheduling

#abort_on_failure, #already_imported?, #collection_options, #execute, #initialize, #mark_as_imported, #parallel?, #parallel_import, #parallel_import_batch, #parallel_import_deprecated, #sequential_import, #spread_parallel_import

Instance Method Details

#collection_methodObject


21
22
23
# File 'lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb', line 21

def collection_method
  :pull_requests_merged_by
end

#each_object_to_importObject


33
34
35
36
37
38
39
40
41
42
# File 'lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb', line 33

def each_object_to_import
  merge_requests_to_import.find_each do |merge_request|
    Gitlab::GithubImport::ObjectCounter.increment(project, object_type, :fetched)

    pull_request = client.pull_request(project.import_source, merge_request.iid)
    yield(pull_request)

    mark_as_imported(merge_request)
  end
end

#id_for_already_imported_cache(merge_request) ⇒ Object


29
30
31
# File 'lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb', line 29

def id_for_already_imported_cache(merge_request)
  merge_request.id
end

#importer_classObject


9
10
11
# File 'lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb', line 9

def importer_class
  PullRequestMergedByImporter
end

#object_typeObject


25
26
27
# File 'lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb', line 25

def object_type
  :pull_request_merged_by
end

#representation_classObject


13
14
15
# File 'lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb', line 13

def representation_class
  Gitlab::GithubImport::Representation::PullRequest
end

#sidekiq_worker_classObject


17
18
19
# File 'lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb', line 17

def sidekiq_worker_class
  ImportPullRequestMergedByWorker
end