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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-11 21:10:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-11 21:10:13 +0300
commite58ce90f147742c314b9cc08c2d1c0b585e39cf9 (patch)
tree467a1716bb63f4061e57b824c0e07532ca2fba4c /lib/gitlab/import_export
parent62cd7010ef91dcaa5a5a36790985053db0b38671 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/import_export')
-rw-r--r--lib/gitlab/import_export/file_importer.rb4
-rw-r--r--lib/gitlab/import_export/group/legacy_tree_restorer.rb4
-rw-r--r--lib/gitlab/import_export/group/tree_restorer.rb2
-rw-r--r--lib/gitlab/import_export/group/tree_saver.rb4
-rw-r--r--lib/gitlab/import_export/json/legacy_reader.rb2
-rw-r--r--lib/gitlab/import_export/json/legacy_writer.rb2
-rw-r--r--lib/gitlab/import_export/json/ndjson_reader.rb2
-rw-r--r--lib/gitlab/import_export/json/ndjson_writer.rb2
-rw-r--r--lib/gitlab/import_export/json/streaming_serializer.rb2
-rw-r--r--lib/gitlab/import_export/legacy_relation_tree_saver.rb2
-rw-r--r--lib/gitlab/import_export/project/tree_restorer.rb4
-rw-r--r--lib/gitlab/import_export/project/tree_saver.rb6
12 files changed, 17 insertions, 19 deletions
diff --git a/lib/gitlab/import_export/file_importer.rb b/lib/gitlab/import_export/file_importer.rb
index 4b3258f8caa..5274fcec43e 100644
--- a/lib/gitlab/import_export/file_importer.rb
+++ b/lib/gitlab/import_export/file_importer.rb
@@ -28,9 +28,7 @@ module Gitlab
copy_archive
wait_for_archived_file do
- # Disable archive validation by default
- # See: https://gitlab.com/gitlab-org/gitlab/-/issues/235949
- validate_decompressed_archive_size if Feature.enabled?(:validate_import_decompressed_archive_size)
+ validate_decompressed_archive_size if Feature.enabled?(:validate_import_decompressed_archive_size, default_enabled: :yaml)
decompress_archive
end
rescue StandardError => e
diff --git a/lib/gitlab/import_export/group/legacy_tree_restorer.rb b/lib/gitlab/import_export/group/legacy_tree_restorer.rb
index 2b95c098b59..8b39362b6bb 100644
--- a/lib/gitlab/import_export/group/legacy_tree_restorer.rb
+++ b/lib/gitlab/import_export/group/legacy_tree_restorer.rb
@@ -55,11 +55,11 @@ module Gitlab
def relation_reader
strong_memoize(:relation_reader) do
if @group_hash.present?
- ImportExport::JSON::LegacyReader::Hash.new(
+ ImportExport::Json::LegacyReader::Hash.new(
@group_hash,
relation_names: reader.group_relation_names)
else
- ImportExport::JSON::LegacyReader::File.new(
+ ImportExport::Json::LegacyReader::File.new(
File.join(shared.export_path, 'group.json'),
relation_names: reader.group_relation_names)
end
diff --git a/lib/gitlab/import_export/group/tree_restorer.rb b/lib/gitlab/import_export/group/tree_restorer.rb
index ea7de4cc896..19d707aaca5 100644
--- a/lib/gitlab/import_export/group/tree_restorer.rb
+++ b/lib/gitlab/import_export/group/tree_restorer.rb
@@ -118,7 +118,7 @@ module Gitlab
def relation_reader
strong_memoize(:relation_reader) do
- ImportExport::JSON::NdjsonReader.new(
+ ImportExport::Json::NdjsonReader.new(
File.join(shared.export_path, 'tree')
)
end
diff --git a/lib/gitlab/import_export/group/tree_saver.rb b/lib/gitlab/import_export/group/tree_saver.rb
index 0f588a55f9d..796b9258e57 100644
--- a/lib/gitlab/import_export/group/tree_saver.rb
+++ b/lib/gitlab/import_export/group/tree_saver.rb
@@ -42,7 +42,7 @@ module Gitlab
end
def serialize(group)
- ImportExport::JSON::StreamingSerializer.new(
+ ImportExport::Json::StreamingSerializer.new(
group,
group_tree,
json_writer,
@@ -64,7 +64,7 @@ module Gitlab
end
def json_writer
- @json_writer ||= ImportExport::JSON::NdjsonWriter.new(@full_path)
+ @json_writer ||= ImportExport::Json::NdjsonWriter.new(@full_path)
end
end
end
diff --git a/lib/gitlab/import_export/json/legacy_reader.rb b/lib/gitlab/import_export/json/legacy_reader.rb
index f29c0a44188..97b34088e3e 100644
--- a/lib/gitlab/import_export/json/legacy_reader.rb
+++ b/lib/gitlab/import_export/json/legacy_reader.rb
@@ -2,7 +2,7 @@
module Gitlab
module ImportExport
- module JSON
+ module Json
class LegacyReader
class File < LegacyReader
include Gitlab::Utils::StrongMemoize
diff --git a/lib/gitlab/import_export/json/legacy_writer.rb b/lib/gitlab/import_export/json/legacy_writer.rb
index 7be21410d26..e03ab9f7650 100644
--- a/lib/gitlab/import_export/json/legacy_writer.rb
+++ b/lib/gitlab/import_export/json/legacy_writer.rb
@@ -2,7 +2,7 @@
module Gitlab
module ImportExport
- module JSON
+ module Json
class LegacyWriter
include Gitlab::ImportExport::CommandLineUtil
diff --git a/lib/gitlab/import_export/json/ndjson_reader.rb b/lib/gitlab/import_export/json/ndjson_reader.rb
index 5c8edd485e5..4899bd3b0ee 100644
--- a/lib/gitlab/import_export/json/ndjson_reader.rb
+++ b/lib/gitlab/import_export/json/ndjson_reader.rb
@@ -2,7 +2,7 @@
module Gitlab
module ImportExport
- module JSON
+ module Json
class NdjsonReader
MAX_JSON_DOCUMENT_SIZE = 50.megabytes
diff --git a/lib/gitlab/import_export/json/ndjson_writer.rb b/lib/gitlab/import_export/json/ndjson_writer.rb
index e74fdd74049..e303ac6eefa 100644
--- a/lib/gitlab/import_export/json/ndjson_writer.rb
+++ b/lib/gitlab/import_export/json/ndjson_writer.rb
@@ -2,7 +2,7 @@
module Gitlab
module ImportExport
- module JSON
+ module Json
class NdjsonWriter
include Gitlab::ImportExport::CommandLineUtil
diff --git a/lib/gitlab/import_export/json/streaming_serializer.rb b/lib/gitlab/import_export/json/streaming_serializer.rb
index ec42c5e51c0..d1e013a151c 100644
--- a/lib/gitlab/import_export/json/streaming_serializer.rb
+++ b/lib/gitlab/import_export/json/streaming_serializer.rb
@@ -2,7 +2,7 @@
module Gitlab
module ImportExport
- module JSON
+ module Json
class StreamingSerializer
include Gitlab::ImportExport::CommandLineUtil
diff --git a/lib/gitlab/import_export/legacy_relation_tree_saver.rb b/lib/gitlab/import_export/legacy_relation_tree_saver.rb
index f8b8b74ffd7..c6b961ea210 100644
--- a/lib/gitlab/import_export/legacy_relation_tree_saver.rb
+++ b/lib/gitlab/import_export/legacy_relation_tree_saver.rb
@@ -22,7 +22,7 @@ module Gitlab
private
def batch_size(exportable)
- Gitlab::ImportExport::JSON::StreamingSerializer.batch_size(exportable)
+ Gitlab::ImportExport::Json::StreamingSerializer.batch_size(exportable)
end
end
end
diff --git a/lib/gitlab/import_export/project/tree_restorer.rb b/lib/gitlab/import_export/project/tree_restorer.rb
index 113502b4e3c..d8992061524 100644
--- a/lib/gitlab/import_export/project/tree_restorer.rb
+++ b/lib/gitlab/import_export/project/tree_restorer.rb
@@ -56,13 +56,13 @@ module Gitlab
def ndjson_relation_reader
return unless Feature.enabled?(:project_import_ndjson, project.namespace, default_enabled: true)
- ImportExport::JSON::NdjsonReader.new(
+ ImportExport::Json::NdjsonReader.new(
File.join(shared.export_path, 'tree')
)
end
def legacy_relation_reader
- ImportExport::JSON::LegacyReader::File.new(
+ ImportExport::Json::LegacyReader::File.new(
File.join(shared.export_path, 'project.json'),
relation_names: reader.project_relation_names,
allowed_path: importable_path
diff --git a/lib/gitlab/import_export/project/tree_saver.rb b/lib/gitlab/import_export/project/tree_saver.rb
index 16012f3c0c0..1f0fa249390 100644
--- a/lib/gitlab/import_export/project/tree_saver.rb
+++ b/lib/gitlab/import_export/project/tree_saver.rb
@@ -14,7 +14,7 @@ module Gitlab
end
def save
- ImportExport::JSON::StreamingSerializer.new(
+ ImportExport::Json::StreamingSerializer.new(
exportable,
reader.project_tree,
json_writer,
@@ -56,10 +56,10 @@ module Gitlab
@json_writer ||= begin
if ::Feature.enabled?(:project_export_as_ndjson, @project.namespace, default_enabled: true)
full_path = File.join(@shared.export_path, 'tree')
- Gitlab::ImportExport::JSON::NdjsonWriter.new(full_path)
+ Gitlab::ImportExport::Json::NdjsonWriter.new(full_path)
else
full_path = File.join(@shared.export_path, ImportExport.project_filename)
- Gitlab::ImportExport::JSON::LegacyWriter.new(full_path, allowed_path: 'project')
+ Gitlab::ImportExport::Json::LegacyWriter.new(full_path, allowed_path: 'project')
end
end
end