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:
Diffstat (limited to 'lib/gitlab/import_export/group/tree_restorer.rb')
-rw-r--r--lib/gitlab/import_export/group/tree_restorer.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/group/tree_restorer.rb b/lib/gitlab/import_export/group/tree_restorer.rb
index d0c0999f291..dfe27118d66 100644
--- a/lib/gitlab/import_export/group/tree_restorer.rb
+++ b/lib/gitlab/import_export/group/tree_restorer.rb
@@ -74,6 +74,12 @@ module Gitlab
group = create_group(group_attributes)
restore_group(group, group_attributes)
+ rescue => e
+ import_failure_service.log_import_failure(
+ source: 'process_child',
+ relation_key: 'group',
+ exception: e
+ )
end
def create_group(group_attributes)
@@ -83,13 +89,17 @@ module Gitlab
parent_group = @groups_mapping.fetch(parent_id) { raise(ArgumentError, 'Parent group not found') }
- ::Groups::CreateService.new(
+ group = ::Groups::CreateService.new(
user,
name: name,
path: path,
parent_id: parent_group.id,
visibility_level: sub_group_visibility_level(group_attributes.attributes, parent_group)
).execute
+
+ group.validate!
+
+ group
end
def restore_group(group, group_attributes)
@@ -134,6 +144,10 @@ module Gitlab
)
end
end
+
+ def import_failure_service
+ Gitlab::ImportExport::ImportFailureService.new(@top_level_group)
+ end
end
end
end