Import comments on GitHub Pull Request into GitLab

parent 95f1fe72
...@@ -71,9 +71,23 @@ module Gitlab ...@@ -71,9 +71,23 @@ module Gitlab
created_at: pull_request.created_at, created_at: pull_request.created_at,
updated_at: pull_request.updated_at updated_at: pull_request.updated_at
) )
client.issue_comments(project.import_source, pull_request.number).each do |c|
merge_request.notes.create!(
project: project,
note: format_body(c.user.login, c.body),
author_id: gl_author_id(project, c.user.id),
created_at: c.created_at,
updated_at: c.updated_at
)
end
end end
end end
def format_body(author, body)
@formatter.author_line(author) + (body || "")
end
def merge_request_state(pull_request) def merge_request_state(pull_request)
case true case true
when pull_request.state == 'closed' && pull_request.merged_at.present? when pull_request.state == 'closed' && pull_request.merged_at.present?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment