From 5831112eb6537e28b164a21f57d0c2e0d5b874fa Mon Sep 17 00:00:00 2001 From: Patrick Bajao Date: Wed, 8 Sep 2021 16:31:14 +0800 Subject: [PATCH 1/2] Create discussion_id for each LegacyDiffNote --- lib/gitlab/github_import/importer/diff_note_importer.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/gitlab/github_import/importer/diff_note_importer.rb b/lib/gitlab/github_import/importer/diff_note_importer.rb index 9bda066efcc8a0..823d5cf0e81742 100644 --- a/lib/gitlab/github_import/importer/diff_note_importer.rb +++ b/lib/gitlab/github_import/importer/diff_note_importer.rb @@ -24,6 +24,7 @@ def execute note_body = MarkdownText.format(note.note, note.author, author_found) attributes = { + discussion_id: Discussion.discussion_id(note), noteable_type: 'MergeRequest', noteable_id: mr_id, project_id: project.id, -- GitLab From 0b3dba3aa003b39518c27144390a5b0e76db3f02 Mon Sep 17 00:00:00 2001 From: Patrick Bajao Date: Wed, 8 Sep 2021 16:31:27 +0800 Subject: [PATCH 2/2] Get the original_commit_id instead of commit_id --- lib/gitlab/github_import/representation/diff_note.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/github_import/representation/diff_note.rb b/lib/gitlab/github_import/representation/diff_note.rb index d336b1ba79740f..1392fddcaccaaa 100644 --- a/lib/gitlab/github_import/representation/diff_note.rb +++ b/lib/gitlab/github_import/representation/diff_note.rb @@ -33,7 +33,7 @@ def self.from_api_response(note) noteable_type: 'MergeRequest', noteable_id: matches[:iid].to_i, file_path: note.path, - commit_id: note.commit_id, + commit_id: note.original_commit_id, diff_hunk: note.diff_hunk, author: user, note: note.body, -- GitLab