Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-10-25 06:12:12 +00:00
parent a85b67d51a
commit 8883fb99dd
15 changed files with 107 additions and 74 deletions

View File

@ -3685,7 +3685,6 @@ RSpec/FeatureCategory:
- 'spec/lib/gitlab/import_export/design_repo_restorer_spec.rb'
- 'spec/lib/gitlab/import_export/design_repo_saver_spec.rb'
- 'spec/lib/gitlab/import_export/duration_measuring_spec.rb'
- 'spec/lib/gitlab/import_export/error_spec.rb'
- 'spec/lib/gitlab/import_export/file_importer_spec.rb'
- 'spec/lib/gitlab/import_export/group/object_builder_spec.rb'
- 'spec/lib/gitlab/import_export/group/relation_factory_spec.rb'
@ -4387,7 +4386,6 @@ RSpec/FeatureCategory:
- 'spec/models/bulk_imports/configuration_spec.rb'
- 'spec/models/bulk_imports/export_status_spec.rb'
- 'spec/models/bulk_imports/export_upload_spec.rb'
- 'spec/models/bulk_imports/failure_spec.rb'
- 'spec/models/bulk_imports/file_transfer_spec.rb'
- 'spec/models/bulk_imports/tracker_spec.rb'
- 'spec/models/chat_team_spec.rb'

View File

@ -1 +1 @@
9ecfbf16fc35003b408005a64306ce311f8a96db
88ea77eda336a64b989368104b91cf758acd3e25

View File

@ -15,6 +15,10 @@ class BulkImports::Failure < ApplicationRecord
pipeline_relation || default_relation
end
def exception_message=(message)
super(::Projects::ImportErrorFilter.filter_message(message).truncate(255))
end
private
def pipeline_relation

View File

@ -56,7 +56,7 @@ module BulkImports
pipeline_class: tracker.pipeline_name,
pipeline_step: 'pipeline_batch_worker_run',
exception_class: exception.class.to_s,
exception_message: exception.message.truncate(255),
exception_message: exception.message,
correlation_id_value: Labkit::Correlation::CorrelationId.current_or_new_id
)
end

View File

@ -87,7 +87,7 @@ module BulkImports
pipeline_class: pipeline_tracker.pipeline_name,
pipeline_step: 'pipeline_worker_run',
exception_class: exception.class.to_s,
exception_message: exception.message.truncate(255),
exception_message: exception.message,
correlation_id_value: Labkit::Correlation::CorrelationId.current_or_new_id
)
end

View File

@ -393,6 +393,7 @@ On self-managed GitLab, by default this feature is not available. To make it ava
With compliance frameworks report, you can see all the compliance frameworks in a group. Each row of the report shows:
- Framework name.
- Associated projects.
The default framework for the group has a **default** badge.

View File

@ -135,7 +135,7 @@ module BulkImports
bulk_import_entity_id: tracker.entity.id,
pipeline_class: tracker.pipeline_name,
exception_class: 'RecordInvalid',
exception_message: record.errors.full_messages.to_sentence.truncate(255),
exception_message: record.errors.full_messages.to_sentence,
correlation_id_value: Labkit::Correlation::CorrelationId.current_or_new_id
)
end

View File

@ -120,7 +120,7 @@ module BulkImports
pipeline_class: pipeline,
pipeline_step: step,
exception_class: exception.class.to_s,
exception_message: exception.message.truncate(255),
exception_message: exception.message,
correlation_id_value: Labkit::Correlation::CorrelationId.current_or_new_id
}

View File

@ -40,13 +40,12 @@ module Gitlab
cmd = %W[gzip #{filepath}]
cmd << "-#{options}" if options
_, status = Gitlab::Popen.popen(cmd)
output, status = Gitlab::Popen.popen(cmd)
if status == 0
status
else
raise Gitlab::ImportExport::Error.file_compression_error
end
return status if status == 0
message = cmd_error_message(output, status)
raise Gitlab::ImportExport::Error.file_compression_error(message)
end
def mkdir_p(path)
@ -104,9 +103,7 @@ module Gitlab
return true if status == 0
output = output&.strip
message = "command exited with error code #{status}"
message += ": #{output}" if output.present?
message = cmd_error_message(output, status)
if @shared.respond_to?(:error)
@shared.error(Gitlab::ImportExport::Error.new(message))
@ -149,6 +146,12 @@ module Gitlab
FileUtils.remove_dir(dir)
raise
end
def cmd_error_message(output, status)
message = "Command exited with error code #{status}"
message << ": #{output.strip}" unless output.blank?
message
end
end
end
end

View File

@ -14,8 +14,8 @@ module Gitlab
self.new('Unknown object type')
end
def self.file_compression_error
self.new('File compression/decompression failed')
def self.file_compression_error(error)
self.new(format('File compression or decompression failed. %{error}', error: error))
end
def self.incompatible_import_file_error

View File

@ -61,7 +61,7 @@
"@gitlab/favicon-overlay": "2.0.0",
"@gitlab/fonts": "^1.3.0",
"@gitlab/svgs": "3.66.0",
"@gitlab/ui": "66.34.0",
"@gitlab/ui": "66.36.1",
"@gitlab/visual-review-tools": "1.7.3",
"@gitlab/web-ide": "0.0.1-dev-20231004090414",
"@mattiasbuelens/web-streams-adapter": "^0.1.0",
@ -193,7 +193,7 @@
"remark-rehype": "^10.1.0",
"scrollparent": "^2.0.1",
"semver": "^7.3.4",
"sentrybrowser": "npm:@sentry/browser@7.74.1",
"sentrybrowser": "npm:@sentry/browser@7.75.0",
"sentrybrowser5": "npm:@sentry/browser@5.30.0",
"sortablejs": "^1.10.2",
"string-hash": "1.1.3",

View File

@ -249,7 +249,11 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil, feature_category: :importe
context 'when exception occurs' do
it 'raises an exception' do
expect { subject.gzip(dir: path, filename: 'test') }.to raise_error(Gitlab::ImportExport::Error)
expect { subject.gzip(dir: path, filename: 'test') }
.to raise_error(
Gitlab::ImportExport::Error,
%r{File compression or decompression failed. Command exited with error code 1: gzip}
)
end
end
end
@ -269,7 +273,11 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil, feature_category: :importe
context 'when exception occurs' do
it 'raises an exception' do
expect { subject.gunzip(dir: path, filename: 'test') }.to raise_error(Gitlab::ImportExport::Error)
expect { subject.gunzip(dir: path, filename: 'test') }
.to raise_error(
Gitlab::ImportExport::Error,
%r{File compression or decompression failed. Command exited with error code 1: gzip}
)
end
end
end
@ -292,7 +300,7 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil, feature_category: :importe
include Gitlab::ImportExport::CommandLineUtil
end.new
expect { klass.tar_cf(archive: 'test', dir: 'test') }.to raise_error(Gitlab::ImportExport::Error, 'command exited with error code 1: Error')
expect { klass.tar_cf(archive: 'test', dir: 'test') }.to raise_error(Gitlab::ImportExport::Error, 'Command exited with error code 1: Error')
end
end
end
@ -347,7 +355,7 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil, feature_category: :importe
include Gitlab::ImportExport::CommandLineUtil
end.new
expect { klass.untar_xf(archive: 'test', dir: 'test') }.to raise_error(Gitlab::ImportExport::Error, 'command exited with error code 1: Error')
expect { klass.untar_xf(archive: 'test', dir: 'test') }.to raise_error(Gitlab::ImportExport::Error, 'Command exited with error code 1: Error')
end
it 'returns false and includes error status' do
@ -362,7 +370,7 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil, feature_category: :importe
end.new
expect(klass.tar_czf(archive: 'test', dir: 'test')).to eq(false)
expect(klass.shared.errors).to eq(['command exited with error code 1: Error'])
expect(klass.shared.errors).to eq(['Command exited with error code 1: Error'])
end
end
end

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::ImportExport::Error do
RSpec.describe Gitlab::ImportExport::Error, feature_category: :importers do
describe '.permission_error' do
subject(:error) do
described_class.permission_error(user, importable)
@ -28,4 +28,12 @@ RSpec.describe Gitlab::ImportExport::Error do
end
end
end
describe '.file_compression_error' do
it 'adds error to exception message' do
message = described_class.file_compression_error('Error').message
expect(message).to eq('File compression or decompression failed. Error')
end
end
end

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe BulkImports::Failure, type: :model do
RSpec.describe BulkImports::Failure, type: :model, feature_category: :importers do
let(:failure) { create(:bulk_import_failure) }
describe 'associations' do
@ -44,4 +44,18 @@ RSpec.describe BulkImports::Failure, type: :model do
end
end
end
describe '#exception_message=' do
it 'filters file paths' do
failure = described_class.new
failure.exception_message = 'Failed to read /FILE/PATH'
expect(failure.exception_message).to eq('Failed to read [FILTERED]')
end
it 'truncates long string' do
failure = described_class.new
failure.exception_message = 'A' * 1000
expect(failure.exception_message.size).to eq(255)
end
end
end

View File

@ -1274,10 +1274,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.66.0.tgz#5dbe98f9811001942d78395756b9d7c588300c01"
integrity sha512-FdkoMAprxjJJnl90GJYoCMeIpvCaYPNAnRkrlsmo7NY3Ce8fpRb/XE/ZakqULeadj82S7R1IRuTHYfWB06vVtA==
"@gitlab/ui@66.34.0":
version "66.34.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-66.34.0.tgz#5869589cd067f2b359ef369a6db963820bb9f128"
integrity sha512-zoEtq7guKo1OlJlGDJI5K8o3UIpsz8vvghNhX6w1OsVEQ7K2chn+Wgb9zPVGwyAoU48QZAtK8EGgm/FnbPkTlA==
"@gitlab/ui@66.36.1":
version "66.36.1"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-66.36.1.tgz#92a3ae8846066f55ec1ee0271055040f13da9c38"
integrity sha512-2qT2+k7VXyNJbkQblhRUFI1LCey9vn+11efF5snIYHP/cuFmo+OarogYt0fhDnR9gONNMjKBk6CLyvb2rGM8sA==
dependencies:
"@floating-ui/dom" "1.2.9"
bootstrap-vue "2.23.1"
@ -1913,15 +1913,14 @@
estree-walker "^2.0.2"
picomatch "^2.3.1"
"@sentry-internal/tracing@7.74.1":
version "7.74.1"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.74.1.tgz#55ff387e61d2c9533a9a0d099d376332426c8e08"
integrity sha512-nNaiZreQxCitG2PzYPaC7XtyA9OMsETGYMKAtiK4p62/uTmeYbsBva9BoNx1XeiHRwbrVQYRMKQ9nV5e2jS4/A==
"@sentry-internal/tracing@7.75.0":
version "7.75.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.75.0.tgz#0d6cb4d3ff4ea6dd456f64455b2d505d7eb27656"
integrity sha512-/j4opF/jB9j8qnSiQK75/lFLtkfqXS5/MoOKc2KWK/pOaf15W+6uJzGQ8jRBHLYd9dDg6AyqsF48Wqy561/mNg==
dependencies:
"@sentry/core" "7.74.1"
"@sentry/types" "7.74.1"
"@sentry/utils" "7.74.1"
tslib "^2.4.1 || ^1.9.3"
"@sentry/core" "7.75.0"
"@sentry/types" "7.75.0"
"@sentry/utils" "7.75.0"
"@sentry/core@5.30.0":
version "5.30.0"
@ -1934,14 +1933,13 @@
"@sentry/utils" "5.30.0"
tslib "^1.9.3"
"@sentry/core@7.74.1":
version "7.74.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.74.1.tgz#9e33cf59b754a994e4054c47c74df1d3fbd30d3c"
integrity sha512-LvEhOSfdIvwkr+PdlrT/aA/iOLhkXrSkvjqAQyogE4ddCWeYfS0NoirxNt1EaxMBAWKhYZRqzkA7WA4LDLbzlA==
"@sentry/core@7.75.0":
version "7.75.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.75.0.tgz#d5477faf9afdfbf45b4ff46b809729f14d4e1b80"
integrity sha512-vXg3cdJgwzP24oTS9zFCgLW4MgTkMZqXx+ESRq7gTD9qJTpcmAmYT+Ckmvebg8K6DBThV6+0v61r50na2+XdrA==
dependencies:
"@sentry/types" "7.74.1"
"@sentry/utils" "7.74.1"
tslib "^2.4.1 || ^1.9.3"
"@sentry/types" "7.75.0"
"@sentry/utils" "7.75.0"
"@sentry/hub@5.30.0":
version "5.30.0"
@ -1961,24 +1959,25 @@
"@sentry/types" "5.30.0"
tslib "^1.9.3"
"@sentry/replay@7.74.1":
version "7.74.1"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.74.1.tgz#dcb5040a3b0a9bda160b70cde5368ecbb4f0e782"
integrity sha512-qmbOl+jYdyhoHFbPp9WemKx8UojID5hVmuVLxNIP0ANqAwmE9OQEK9YFg2cf7L/TpKb1tqz0qLgi5MYIdcdpgQ==
"@sentry/replay@7.75.0":
version "7.75.0"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.75.0.tgz#0b1d9e9a6954ecc004597456f2c82e7630b8139c"
integrity sha512-TAAlj7JCMF6hFFL71RmPzVX89ltyPYFWR+t4SuWaBmU6HmTliI2eJvK+M36oE+N7s3CkyRVTaXXRe0YMwRMuZQ==
dependencies:
"@sentry/core" "7.74.1"
"@sentry/types" "7.74.1"
"@sentry/utils" "7.74.1"
"@sentry-internal/tracing" "7.75.0"
"@sentry/core" "7.75.0"
"@sentry/types" "7.75.0"
"@sentry/utils" "7.75.0"
"@sentry/types@5.30.0":
version "5.30.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402"
integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==
"@sentry/types@7.74.1":
version "7.74.1"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.74.1.tgz#b6f9b1bd266254f1f8b55fbcc92fa649ba2100ed"
integrity sha512-2jIuPc+YKvXqZETwr2E8VYnsH1zsSUR/wkIvg1uTVeVNyoowJv+YsOtCdeGyL2AwiotUBSPKu7O1Lz0kq5rMOQ==
"@sentry/types@7.75.0":
version "7.75.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.75.0.tgz#e171f1680785a155cb828942af890ad4ee657ca3"
integrity sha512-xG8OLADxG7HpGhMxrF4v4tKq/v/gqmLsTZ858R51pz0xCWM8SK6ZSWOKudkAGBIpRjI6RUHMnkBtRAN2aKDOkQ==
"@sentry/utils@5.30.0":
version "5.30.0"
@ -1988,13 +1987,12 @@
"@sentry/types" "5.30.0"
tslib "^1.9.3"
"@sentry/utils@7.74.1":
version "7.74.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.74.1.tgz#e9a8453c954d02ebed2fd3dbe7588483d8f6d3cb"
integrity sha512-qUsqufuHYcy5gFhLZslLxA5kcEOkkODITXW3c7D+x+8iP/AJqa8v8CeUCVNS7RetHCuIeWAbbTClC4c411EwQg==
"@sentry/utils@7.75.0":
version "7.75.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.75.0.tgz#7a638c4c027ca2018518ee8d2eead1397cb97d66"
integrity sha512-UHWKeevhUNRp+mAWDbMVFOMgseoq8t/xFgdUywO/2PC14qZKRBH+0k1BKoNkp5sOzDT06ETj2w6wYoYhy6i+dA==
dependencies:
"@sentry/types" "7.74.1"
tslib "^2.4.1 || ^1.9.3"
"@sentry/types" "7.75.0"
"@sinclair/typebox@^0.24.1":
version "0.24.40"
@ -11917,17 +11915,16 @@ send@0.17.2:
"@sentry/utils" "5.30.0"
tslib "^1.9.3"
"sentrybrowser@npm:@sentry/browser@7.74.1":
version "7.74.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.74.1.tgz#9302d440bbdcb018abd5fee5959dab4b2fe97383"
integrity sha512-OYWNne/KO60lOvkIpIlJUyiJt/9j8DGI57thSDFEYSmmbNqMitczUTBOaEStouvHKyfchqLZm1CZfWKt+z0VOA==
"sentrybrowser@npm:@sentry/browser@7.75.0":
version "7.75.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.75.0.tgz#7ea88f335c7bbaf3b5eecbf4e12590785abc0ee7"
integrity sha512-DXH/69vzp2j8xjydX+lrUYasrk7a1mpbXFGA9GtnII7shMCy55+QkVxpa6cLojYUaG2K/8yFDMcrP9N395LnWg==
dependencies:
"@sentry-internal/tracing" "7.74.1"
"@sentry/core" "7.74.1"
"@sentry/replay" "7.74.1"
"@sentry/types" "7.74.1"
"@sentry/utils" "7.74.1"
tslib "^2.4.1 || ^1.9.3"
"@sentry-internal/tracing" "7.75.0"
"@sentry/core" "7.75.0"
"@sentry/replay" "7.75.0"
"@sentry/types" "7.75.0"
"@sentry/utils" "7.75.0"
serialize-javascript@^2.1.2:
version "2.1.2"
@ -13001,7 +12998,7 @@ tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
tslib@^2.1.0, tslib@^2.2.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.4.1, "tslib@^2.4.1 || ^1.9.3", tslib@^2.5.0:
tslib@^2.1.0, tslib@^2.2.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.4.1, tslib@^2.5.0:
version "2.6.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==