summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2017-09-22 11:51:17 -0300
committerFelipe Artur <felipefac@gmail.com>2017-09-22 11:51:17 -0300
commit004da305db20f554a504daed8f44d5765aaa9a0c (patch)
treebd696887f81f32fe1c09804c0cdf524b2379f706
parent92173ac55cd921a65ce137e238ed8bc4474aaccb (diff)
downloadgitlab-ce-issue_35580_2.tar.gz
Project import fixissue_35580_2
-rw-r--r--lib/gitlab/import_export/project_tree_restorer.rb2
-rw-r--r--spec/lib/gitlab/import_export/project.light.json26
-rw-r--r--spec/lib/gitlab/import_export/project_tree_restorer_spec.rb3
3 files changed, 28 insertions, 3 deletions
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb
index 3bc095a99a9..ec49b9d960e 100644
--- a/lib/gitlab/import_export/project_tree_restorer.rb
+++ b/lib/gitlab/import_export/project_tree_restorer.rb
@@ -2,7 +2,7 @@ module Gitlab
module ImportExport
class ProjectTreeRestorer
# Relations which cannot have both group_id and project_id at the same time
- RESTRICT_PROJECT_AND_GROUP = %i(milestones).freeze
+ RESTRICT_PROJECT_AND_GROUP = %i(milestones milestone group_milestones group_milestone).freeze
def initialize(user:, shared:, project:)
@path = File.join(shared.export_path, 'project.json')
diff --git a/spec/lib/gitlab/import_export/project.light.json b/spec/lib/gitlab/import_export/project.light.json
index 2d8f3d4a566..e3e7d1bda54 100644
--- a/spec/lib/gitlab/import_export/project.light.json
+++ b/spec/lib/gitlab/import_export/project.light.json
@@ -106,7 +106,31 @@
"priorities": []
}
}
- ]
+ ],
+ "milestone":{
+ "id": 1,
+ "title": "test milestone",
+ "project_id": 8,
+ "description": "test milestone",
+ "due_date": null,
+ "created_at": "2016-06-14T15:02:04.415Z",
+ "updated_at": "2016-06-14T15:02:04.415Z",
+ "state": "active",
+ "iid": 1,
+ "group_id": null,
+ "events":[
+ {
+ "id":10,
+ "project_id":8,
+ "author_id":1,
+ "target_id":1,
+ "created_at":"2017-08-10T19:56:03.091Z",
+ "updated_at":"2017-08-10T19:56:03.091Z",
+ "target_type":"Milestone",
+ "action":1
+ }
+ ]
+ }
}
],
"snippets": [
diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
index efe11ca794a..ac1423b2936 100644
--- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
@@ -253,9 +253,10 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
expect(project.milestones.count).to eq(1)
end
- it 'has issue' do
+ it 'has issue with milestone' do
expect(project.issues.count).to eq(1)
expect(project.issues.first.labels.count).to eq(2)
+ expect(project.issues.first.milestone).to be_present
end
it 'has issue with group label and project label' do