Commit e938d241 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Include type to notes import / export

parent f7ebea04
---
title: Fix diff notes and discussion notes being exported as regular notes
merge_request: 28401
author:
type: fixed
...@@ -176,6 +176,8 @@ excluded_attributes: ...@@ -176,6 +176,8 @@ excluded_attributes:
- :enabled - :enabled
methods: methods:
notes:
- :type
labels: labels:
- :type - :type
label: label:
......
...@@ -91,7 +91,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver do ...@@ -91,7 +91,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
end end
it 'has issue comments' do it 'has issue comments' do
expect(saved_project_json['issues'].first['notes']).not_to be_empty notes = saved_project_json['issues'].first['notes']
expect(notes).not_to be_empty
expect(notes.first['type']).to eq('DiscussionNote')
end end
it 'has issue assignees' do it 'has issue assignees' do
...@@ -299,7 +302,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do ...@@ -299,7 +302,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
create(:commit_status, project: project, pipeline: ci_build.pipeline) create(:commit_status, project: project, pipeline: ci_build.pipeline)
create(:milestone, project: project) create(:milestone, project: project)
create(:note, noteable: issue, project: project) create(:discussion_note, noteable: issue, project: project)
create(:note, noteable: merge_request, project: project) create(:note, noteable: merge_request, project: project)
create(:note, noteable: snippet, project: project) create(:note, noteable: snippet, project: project)
create(:note_on_commit, create(:note_on_commit,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment