提交 615e1807 编写于 作者: S Stan Hu

More work towards importing pull requests

上级 a5ca56ee
......@@ -21,9 +21,10 @@ module BitbucketServer
get_collection(path, :pull_request)
end
def pull_request_comments(project_key, repo, pull_request)
path = "/projects/#{project_key}/repos/#{repo}/pull-requests/#{pull_request}/comments"
get_collection(path, :pull_request_comment)
def activities(project_key, repo, pull_request)
path = "/projects/#{project_key}/repos/#{repo}/pull-requests/#{pull_request}/activities"
collection = get_collection(path, :activities)
end
def pull_request_diff(project_key, repo, pull_request)
......
......@@ -97,9 +97,9 @@ module Gitlab
end
def import_pull_request_comments(pull_request, merge_request)
comments = client.pull_request_comments(repo, pull_request.iid)
comments = client.activities(repo, pull_request.iid).select(&:commment?)
inline_comments, pr_comments = comments.partition(&:inline?)
inline_comments, pr_comments = comments.partition(&:inline_comment?)
import_inline_comments(inline_comments, pull_request, merge_request)
import_standalone_pr_comments(pr_comments, merge_request)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册