summaryrefslogtreecommitdiff
path: root/lib/gitlab/bitbucket_import/importer.rb
diff options
context:
space:
mode:
authorGeorge Koltsov <gkoltsov@gitlab.com>2019-08-07 14:01:18 +0100
committerGeorge Koltsov <gkoltsov@gitlab.com>2019-08-07 14:01:40 +0100
commit5ba77a49997221cc646f158d56c86a636b42e735 (patch)
treeb5036628d7e648b2689da904813ad75a2db216a9 /lib/gitlab/bitbucket_import/importer.rb
parentf5fcb9a1be906dd647cb1ffed29d8499370a927e (diff)
downloadgitlab-ce-5ba77a49997221cc646f158d56c86a636b42e735.tar.gz
Add author lines to project import comments
Diffstat (limited to 'lib/gitlab/bitbucket_import/importer.rb')
-rw-r--r--lib/gitlab/bitbucket_import/importer.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/bitbucket_import/importer.rb b/lib/gitlab/bitbucket_import/importer.rb
index 8047ef4fa15..e017b30050f 100644
--- a/lib/gitlab/bitbucket_import/importer.rb
+++ b/lib/gitlab/bitbucket_import/importer.rb
@@ -260,15 +260,23 @@ module Gitlab
end
def pull_request_comment_attributes(comment)
+ author_id = gitlab_user_id(project, comment.author)
+
{
project: project,
- note: comment.note,
- author_id: gitlab_user_id(project, comment.author),
+ note: comment_note(comment, author_id),
+ author_id: author_id,
created_at: comment.created_at,
updated_at: comment.updated_at
}
end
+ def comment_note(comment, author_id)
+ note = ''
+ note += @formatter.author_line(comment.author) if author_id == project.creator_id
+ note + comment.note
+ end
+
def log_error(details)
logger.error(log_base_data.merge(details))
end