Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-07-15 22:18:31 +0300
committerDouwe Maan <douwe@selenight.nl>2016-07-15 22:18:31 +0300
commit4859770e2644be547943a7b4184292d099109ae3 (patch)
tree39f534c6b44a9e35a78cdec3d2f1538bcc66e400
parentd4677353b84681bd73f321a0b04bb7eba32dbc9c (diff)
parent37d1e65a2deb64d95183e69c3680a6eeb1770fdb (diff)
Merge branch 'fix/ee-to-ce-import'
-rw-r--r--CHANGELOG1
-rw-r--r--lib/gitlab/import_export/relation_factory.rb8
-rw-r--r--spec/lib/gitlab/import_export/project.json1
3 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 5ab16db31ce..ef4a7aac206 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -96,6 +96,7 @@ v 8.10.0 (unreleased)
- Change status color and icon for running builds
- Fix markdown rendering for: consecutive labels references, label references that begin with a digit or contains `.`
- Fix last update timestamp on issues not preserved on gitlab.com and project imports
+ - Fix issues importing projects from EE to CE
v 8.9.6
- Fix importing of events under notes for GitLab projects. !5154
diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb
index 9824df3f274..6ba25a31641 100644
--- a/lib/gitlab/import_export/relation_factory.rb
+++ b/lib/gitlab/import_export/relation_factory.rb
@@ -87,7 +87,7 @@ module Gitlab
project_id = @relation_hash.delete('project_id')
# project_id may not be part of the export, but we always need to populate it if required.
- @relation_hash['project_id'] = project_id if relation_class.column_names.include?('project_id')
+ @relation_hash['project_id'] = project_id
@relation_hash['gl_project_id'] = project_id if @relation_hash['gl_project_id']
@relation_hash['target_project_id'] = project_id if @relation_hash['target_project_id']
@relation_hash['source_project_id'] = -1 if @relation_hash['source_project_id']
@@ -111,7 +111,7 @@ module Gitlab
end
def imported_object
- imported_object = relation_class.new(@relation_hash)
+ imported_object = relation_class.new(parsed_relation_hash)
yield(imported_object) if block_given?
imported_object.importing = true if imported_object.respond_to?(:importing)
imported_object
@@ -125,6 +125,10 @@ module Gitlab
def admin_user?
@user.is_admin?
end
+
+ def parsed_relation_hash
+ @relation_hash.reject { |k, _v| !relation_class.attribute_method?(k) }
+ end
end
end
end
diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json
index 7286b0c39c0..4113d829c3c 100644
--- a/spec/lib/gitlab/import_export/project.json
+++ b/spec/lib/gitlab/import_export/project.json
@@ -26,6 +26,7 @@
"deleted_at": null,
"due_date": null,
"moved_to_id": null,
+ "test_ee_field": "test",
"notes": [
{
"id": 351,