diff options
author | Stan Hu <stanhu@gmail.com> | 2018-06-28 00:27:04 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-06-28 00:27:04 -0700 |
commit | 014abc9c07c1389e64ccf336559b488835730a45 (patch) | |
tree | 94f44ff09f543fe5c349dd07bc9659150d384b54 /lib/gitlab/bitbucket_server_import/importer.rb | |
parent | 5728ffbf12c8f5f767bc6d6b9a453b2add974e96 (diff) | |
download | gitlab-ce-014abc9c07c1389e64ccf336559b488835730a45.tar.gz |
Handle threaded comments and prepare for inline comments
Diffstat (limited to 'lib/gitlab/bitbucket_server_import/importer.rb')
-rw-r--r-- | lib/gitlab/bitbucket_server_import/importer.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb index 43a52a61ee5..f8871ade6e7 100644 --- a/lib/gitlab/bitbucket_server_import/importer.rb +++ b/lib/gitlab/bitbucket_server_import/importer.rb @@ -105,11 +105,11 @@ module Gitlab 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) + import_standalone_pr_comments(pr_comments.map(&:comment), merge_request) end def import_merge_event(merge_request, merge_event) - committer = merge_event.commiter_email + committer = merge_event.committer_email return unless committer @@ -169,6 +169,10 @@ module Gitlab pr_comments.each do |comment| begin merge_request.notes.create!(pull_request_comment_attributes(comment)) + + comment.comments.each do |replies| + merge_request.notes.create!(pull_request_comment_attributes(replies)) + end rescue StandardError => e errors << { type: :pull_request, iid: comment.id, errors: e.message } end @@ -180,7 +184,6 @@ module Gitlab end def pull_request_comment_attributes(comment) - byebug { project: project, note: comment.note, |