Import comments on GitHub Pull Request into GitLab

This commit is contained in:
Douglas Barbosa Alexandre 2015-12-21 19:08:54 -02:00
parent 95f1fe724a
commit 223f7f5345

View file

@ -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?