summaryrefslogtreecommitdiff
path: root/lib/gitlab/github_import/importer/pull_requests_reviews_importer.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /lib/gitlab/github_import/importer/pull_requests_reviews_importer.rb
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
downloadgitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'lib/gitlab/github_import/importer/pull_requests_reviews_importer.rb')
-rw-r--r--lib/gitlab/github_import/importer/pull_requests_reviews_importer.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/github_import/importer/pull_requests_reviews_importer.rb b/lib/gitlab/github_import/importer/pull_requests_reviews_importer.rb
index 809a518d13a..e389acbf877 100644
--- a/lib/gitlab/github_import/importer/pull_requests_reviews_importer.rb
+++ b/lib/gitlab/github_import/importer/pull_requests_reviews_importer.rb
@@ -29,6 +29,10 @@ module Gitlab
:pull_request_reviews
end
+ def object_type
+ :pull_request_review
+ end
+
def id_for_already_imported_cache(review)
review.id
end
@@ -57,6 +61,8 @@ module Gitlab
project.merge_requests.find_each do |merge_request|
next if already_imported?(merge_request)
+ Gitlab::GithubImport::ObjectCounter.increment(project, object_type, :fetched)
+
client
.pull_request_reviews(project.import_source, merge_request.iid)
.each do |review|
@@ -81,6 +87,8 @@ module Gitlab
page.objects.each do |review|
next if already_imported?(review)
+ Gitlab::GithubImport::ObjectCounter.increment(project, object_type, :fetched)
+
review.merge_request_id = merge_request.id
yield(review)