Include type to notes import / export

This commit is contained in:
Heinrich Lee Yu 2019-05-17 16:39:33 +08:00
parent f7ebea045b
commit e938d241ea
3 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
title: Fix diff notes and discussion notes being exported as regular notes
merge_request: 28401
author:
type: fixed

View File

@ -176,6 +176,8 @@ excluded_attributes:
- :enabled
methods:
notes:
- :type
labels:
- :type
label:

View File

@ -91,7 +91,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
end
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
it 'has issue assignees' do
@ -299,7 +302,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
create(:commit_status, project: project, pipeline: ci_build.pipeline)
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: snippet, project: project)
create(:note_on_commit,