lib/gitlab/import_export/project_tree_restorer.rb
# Relations which cannot be saved at project level (and have a group assigned)
Relations which cannot be saved at project level (and have a group assigned)
Relations which cannot be saved at project level ( and have a group assigned )
def restore
        begin
          @tree_hash = read_tree_hash
        rescue => e
          Rails.logger.error("Import/Export error: #{e.message}") 
          raise Gitlab::ImportExport::Error.new('Incorrect JSON format')
        end
        @project_members = @tree_hash.delete('project_members')
        RelationRenameService.rename(@tree_hash)
        ActiveRecord::Base.uncached do
          ActiveRecord::Base.no_touching do
            update_project_params!
            create_project_relations!
            post_import!
          end
        end
        @project.reload 
        true
      rescue => e
        @shared.error(e)
        false
      end
def restore begin @tree_hash = read_tree_hash rescue => e Rails . logger . error ( "Import/Export error: #{e.message}" ) raise Gitlab :: ImportExport :: Error . new ( 'Incorrect JSON format' ) end @project_members = @tree_hash . delete ( 'project_members' ) RelationRenameService . rename ( @tree_hash ) ActiveRecord :: Base . uncached do ActiveRecord :: Base . no_touching do update_project_params! create_project_relations! post_import! end end @project . reload true rescue => e @shared . error ( e ) false end
Relations which cannot be saved at project level (and have a group assigned)
Relations which cannot be saved at project level ( and have a group assigned )
# rubocop:disable Gitlab/RailsLogger # ensure that we have latest version of the restore # rubocop:disable Cop/ActiveRecordAssociationReload