summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-06-26 15:59:34 -0700
committerStan Hu <stanhu@gmail.com>2018-06-26 15:59:47 -0700
commit615e1807998b986582f3baf08aa3f1693294c52a (patch)
treead9f2a4a3eda54a3b5d28cfb303d4b0bf05dbd75 /lib
parenta5ca56eeeddc3cc1f1e92608b8b67e917d86837e (diff)
downloadgitlab-ce-615e1807998b986582f3baf08aa3f1693294c52a.tar.gz
More work towards importing pull requests
Diffstat (limited to 'lib')
-rw-r--r--lib/bitbucket_server/client.rb7
-rw-r--r--lib/gitlab/bitbucket_server_import/importer.rb4
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/bitbucket_server/client.rb b/lib/bitbucket_server/client.rb
index 9f6958b568e..eb8b592e833 100644
--- a/lib/bitbucket_server/client.rb
+++ b/lib/bitbucket_server/client.rb
@@ -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)
diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb
index dec393f053f..8cb0c7d1b1d 100644
--- a/lib/gitlab/bitbucket_server_import/importer.rb
+++ b/lib/gitlab/bitbucket_server_import/importer.rb
@@ -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)