diff options
Diffstat (limited to 'lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb')
-rw-r--r-- | lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb b/lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb new file mode 100644 index 00000000000..466288fde4c --- /dev/null +++ b/lib/gitlab/github_import/importer/pull_requests_merged_by_importer.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Gitlab + module GithubImport + module Importer + class PullRequestsMergedByImporter + include ParallelScheduling + + def importer_class + PullRequestMergedByImporter + end + + def representation_class + Gitlab::GithubImport::Representation::PullRequest + end + + def sidekiq_worker_class + ImportPullRequestMergedByWorker + end + + def collection_method + :pull_requests_merged_by + end + + def id_for_already_imported_cache(pr) + pr.number + end + + def each_object_to_import + project.merge_requests.with_state(:merged).find_each do |merge_request| + pull_request = client.pull_request(project.import_source, merge_request.iid) + yield(pull_request) + end + end + end + end + end +end |