summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-06-06 12:19:03 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-06-06 12:19:03 -0300
commit7c072c76fc05f7db51e7d7ba6cb0fad2850ecf85 (patch)
treed3f538001ca7fcf6a91376754444a756276f432d
parentac4e3e8cf016f2c2b3dcf3997673310a5df658a9 (diff)
downloadgitlab-ce-gh-fix-comments-on-diff.tar.gz
Fix importer for GitHub comments on diffgh-fix-comments-on-diff
Fix comments on diff after LegacyDiffNote was extracted from Note
-rw-r--r--CHANGELOG1
-rw-r--r--lib/gitlab/github_import/comment_formatter.rb5
-rw-r--r--spec/lib/gitlab/github_import/comment_formatter_spec.rb2
3 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index fe9b9bec868..9012f1363b3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -45,6 +45,7 @@ v 8.8.4 (unreleased)
- Fix todos page throwing errors when you have a project pending deletion
- Reduce number of SQL queries when rendering user references
- Upgrade to jQuery 2
+ - Fix importer for GitHub comments on diff
v 8.8.3
- Fix 404 page when viewing TODOs that contain milestones or labels in different projects. !4312
diff --git a/lib/gitlab/github_import/comment_formatter.rb b/lib/gitlab/github_import/comment_formatter.rb
index 7d679eaec6a..2c1b94ef2cd 100644
--- a/lib/gitlab/github_import/comment_formatter.rb
+++ b/lib/gitlab/github_import/comment_formatter.rb
@@ -8,6 +8,7 @@ module Gitlab
commit_id: raw_data.commit_id,
line_code: line_code,
author_id: author_id,
+ type: type,
created_at: raw_data.created_at,
updated_at: raw_data.updated_at
}
@@ -53,6 +54,10 @@ module Gitlab
def note
formatter.author_line(author) + body
end
+
+ def type
+ 'LegacyDiffNote' if on_diff?
+ end
end
end
end
diff --git a/spec/lib/gitlab/github_import/comment_formatter_spec.rb b/spec/lib/gitlab/github_import/comment_formatter_spec.rb
index 55e86d4ceac..9ae02a6c45f 100644
--- a/spec/lib/gitlab/github_import/comment_formatter_spec.rb
+++ b/spec/lib/gitlab/github_import/comment_formatter_spec.rb
@@ -29,6 +29,7 @@ describe Gitlab::GithubImport::CommentFormatter, lib: true do
commit_id: nil,
line_code: nil,
author_id: project.creator_id,
+ type: nil,
created_at: created_at,
updated_at: updated_at
}
@@ -56,6 +57,7 @@ describe Gitlab::GithubImport::CommentFormatter, lib: true do
commit_id: '6dcb09b5b57875f334f61aebed695e2e4193db5e',
line_code: 'ce1be0ff4065a6e9415095c95f25f47a633cef2b_4_3',
author_id: project.creator_id,
+ type: 'LegacyDiffNote',
created_at: created_at,
updated_at: updated_at
}