Commit 786457ca authored by James Lopez's avatar James Lopez Committed by Rémy Coutable

Fix for missing service when importing from EE to CE

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent ffcd20ce
---
title: Fix missing service error importing from EE to CE
merge_request: 8144
author:
......@@ -120,7 +120,7 @@ module Gitlab
members_mapper: members_mapper,
user: @user,
project_id: restored_project.id)
end
end.compact
relation_hash_list.is_a?(Array) ? relation_array : relation_array.first
end
......
......@@ -40,6 +40,8 @@ module Gitlab
# the relation_hash, updating references with new object IDs, mapping users using
# the "members_mapper" object, also updating notes if required.
def create
return nil if unknown_service?
setup_models
generate_imported_object
......@@ -217,6 +219,11 @@ module Gitlab
existing_object
end
end
def unknown_service?
@relation_name == :services && parsed_relation_hash['type'] &&
!Object.const_defined?(parsed_relation_hash['type'])
end
end
end
end
......@@ -7411,6 +7411,28 @@
"category": "common",
"default": false,
"wiki_page_events": true
},
{
"id": 101,
"title": "JenkinsDeprecated",
"project_id": 5,
"created_at": "2016-06-14T15:01:51.031Z",
"updated_at": "2016-06-14T15:01:51.031Z",
"active": false,
"properties": {
},
"template": false,
"push_events": true,
"issues_events": true,
"merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
"build_events": true,
"category": "common",
"default": false,
"wiki_page_events": true,
"type": "JenkinsDeprecatedService"
}
],
"hooks": [
......
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