diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2015-12-21 19:08:54 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-01-05 15:24:55 -0200 |
commit | 223f7f53453d544a8c46c75ca9c54b8b60620961 (patch) | |
tree | a3f232078790bac4efd6c57d06fb6aedc505963f /lib/gitlab/github_import/importer.rb | |
parent | 95f1fe724a47b12b1d66a722be13d15c5fbd2688 (diff) | |
download | gitlab-ce-223f7f53453d544a8c46c75ca9c54b8b60620961.tar.gz |
Import comments on GitHub Pull Request into GitLab
Diffstat (limited to 'lib/gitlab/github_import/importer.rb')
-rw-r--r-- | lib/gitlab/github_import/importer.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb index 656fac9ac7e..35a2930d4a1 100644 --- a/lib/gitlab/github_import/importer.rb +++ b/lib/gitlab/github_import/importer.rb @@ -71,9 +71,23 @@ module Gitlab created_at: pull_request.created_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 + def format_body(author, body) + @formatter.author_line(author) + (body || "") + end + def merge_request_state(pull_request) case true when pull_request.state == 'closed' && pull_request.merged_at.present? |