Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/github_import/importer/events/reviewed.rb')
-rw-r--r--lib/gitlab/github_import/importer/events/reviewed.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/gitlab/github_import/importer/events/reviewed.rb b/lib/gitlab/github_import/importer/events/reviewed.rb
new file mode 100644
index 00000000000..1c0e8a9e6e8
--- /dev/null
+++ b/lib/gitlab/github_import/importer/events/reviewed.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module GithubImport
+ module Importer
+ module Events
+ class Reviewed < BaseImporter
+ def execute(issue_event)
+ return true unless import_settings.extended_events?
+
+ review = Representation::PullRequestReview.new(
+ merge_request_iid: issue_event.issuable_id,
+ author: issue_event.actor&.to_hash,
+ note: issue_event.body.to_s,
+ review_type: issue_event.state.upcase, # On timeline API, the state is in lower case
+ submitted_at: issue_event.submitted_at,
+ review_id: issue_event.id
+ )
+
+ PullRequests::ReviewImporter.new(review, project, client).execute({ add_reviewer: false })
+ end
+ end
+ end
+ end
+ end
+end