diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /lib/gitlab/import_export/group | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'lib/gitlab/import_export/group')
-rw-r--r-- | lib/gitlab/import_export/group/tree_restorer.rb | 16 |
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 |