Class: Gitlab::GithubImport::Importer::PullRequestReviewImporter

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/github_import/importer/pull_request_review_importer.rb

Instance Method Summary collapse

Constructor Details

#initialize(review, project, client) ⇒ PullRequestReviewImporter

Returns a new instance of PullRequestReviewImporter.


7
8
9
10
11
12
# File 'lib/gitlab/github_import/importer/pull_request_review_importer.rb', line 7

def initialize(review, project, client)
  @review = review
  @project = project
  @client = client
  @merge_request = project.merge_requests.find_by_id(review.merge_request_id)
end

Instance Method Details

#executeObject


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gitlab/github_import/importer/pull_request_review_importer.rb', line 14

def execute
  user_finder = GithubImport::UserFinder.new(project, client)
  gitlab_user_id = user_finder.user_id_for(review.author)

  if gitlab_user_id
    add_review_note!(gitlab_user_id)
    add_approval!(gitlab_user_id)
  else
    add_complementary_review_note!(project.creator_id)
  end
end