summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2019-05-20 13:48:53 +0000
committerMayra Cabrera <mcabrera@gitlab.com>2019-05-20 13:48:53 +0000
commitc513434c9d7bdfa5e1c8bd3a86fe84df693faebd (patch)
treefe9546f93ceca37577c68594ee1edd5206149cd1
parentec79a0a2e4bf567f59cb6c24542957f5219c7208 (diff)
parente938d241ea5b574e82ec44951f14ac391c6d52d1 (diff)
downloadgitlab-ce-c513434c9d7bdfa5e1c8bd3a86fe84df693faebd.tar.gz
Merge branch '49517-fix-notes-import-export' into 'master'
Include type to notes import / export Closes #49517 See merge request gitlab-org/gitlab-ce!28401
-rw-r--r--changelogs/unreleased/49517-fix-notes-import-export.yml5
-rw-r--r--lib/gitlab/import_export/import_export.yml2
-rw-r--r--spec/lib/gitlab/import_export/project_tree_saver_spec.rb7
3 files changed, 12 insertions, 2 deletions
diff --git a/changelogs/unreleased/49517-fix-notes-import-export.yml b/changelogs/unreleased/49517-fix-notes-import-export.yml
new file mode 100644
index 00000000000..a9f4d736e0b
--- /dev/null
+++ b/changelogs/unreleased/49517-fix-notes-import-export.yml
@@ -0,0 +1,5 @@
+---
+title: Fix diff notes and discussion notes being exported as regular notes
+merge_request: 28401
+author:
+type: fixed
diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml
index c6d4fda4af5..7bbcb53f016 100644
--- a/lib/gitlab/import_export/import_export.yml
+++ b/lib/gitlab/import_export/import_export.yml
@@ -176,6 +176,8 @@ excluded_attributes:
- :enabled
methods:
+ notes:
+ - :type
labels:
- :type
label:
diff --git a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb
index cfc3e0ce926..bc4f867e891 100644
--- a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb
@@ -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,