Class: Gitlab::GithubImport::Importer::PullRequests::AllMergedByImporter

Inherits:
Object
  • Object
show all
Includes:
ParallelScheduling
Defined in:
lib/gitlab/github_import/importer/pull_requests/all_merged_by_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?, #collection_options, #execute, #increment_object_counter?, #initialize, #mark_as_imported, #parallel?, #parallel_import, #sequential_import, #spread_parallel_import

Methods included from JobDelayCalculator

#parallel_import_batch

Instance Method Details

#collection_methodObject



22
23
24
# File 'lib/gitlab/github_import/importer/pull_requests/all_merged_by_importer.rb', line 22

def collection_method
  :pull_requests_merged_by
end

#each_object_to_importObject



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

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



30
31
32
# File 'lib/gitlab/github_import/importer/pull_requests/all_merged_by_importer.rb', line 30

def id_for_already_imported_cache(merge_request)
  merge_request.id
end

#importer_classObject



10
11
12
# File 'lib/gitlab/github_import/importer/pull_requests/all_merged_by_importer.rb', line 10

def importer_class
  MergedByImporter
end

#object_typeObject



26
27
28
# File 'lib/gitlab/github_import/importer/pull_requests/all_merged_by_importer.rb', line 26

def object_type
  :pull_request_merged_by
end

#representation_classObject



14
15
16
# File 'lib/gitlab/github_import/importer/pull_requests/all_merged_by_importer.rb', line 14

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

#sidekiq_worker_classObject



18
19
20
# File 'lib/gitlab/github_import/importer/pull_requests/all_merged_by_importer.rb', line 18

def sidekiq_worker_class
  Gitlab::GithubImport::PullRequests::ImportMergedByWorker
end