Skip to content
Snippets Groups Projects
Commit 6435eb7b authored by Kos Palchyk's avatar Kos Palchyk :speech_balloon: Committed by drew stachon
Browse files

Changes storage magnitude notation

Updates labels for magnitudes of storage values
from KB, MB, GB to KiB, MiB, GiB

Changelog: changed
parent 914358ba
No related branches found
No related tags found
1 merge request!120333Use power-of-2 labels
Showing
with 53 additions and 51 deletions
......@@ -229,13 +229,13 @@ de:
storage_units:
format: "%n %u"
units:
byte:
one: Byte
other: Bytes
gb: GB
kb: KB
mb: MB
tb: TB
byte: B
kb: KiB
mb: MiB
gb: GiB
tb: TiB
pb: PiB
eb: EiB
percentage:
format:
delimiter: ''
......
......@@ -269,13 +269,13 @@ en:
storage_units:
format: "%n %u"
units:
byte:
one: Byte
other: Bytes
gb: GB
kb: KB
mb: MB
tb: TB
byte: B
kb: KiB
mb: MiB
gb: GiB
tb: TiB
pb: PiB
eb: EiB
percentage:
format:
delimiter: ''
......
......@@ -227,13 +227,13 @@ es:
storage_units:
format: "%n %u"
units:
byte:
one: Byte
other: Bytes
gb: GB
kb: KB
mb: MB
tb: TB
byte: B
kb: KiB
mb: MiB
gb: GiB
tb: TiB
pb: PiB
eb: EiB
percentage:
format:
delimiter: ''
......
......@@ -22,7 +22,7 @@ def validate!
end
if large_blob
raise ::Gitlab::GitAccess::ForbiddenError, %Q{File "#{large_blob.path}" is larger than the allowed size of #{max_file_size} MB. Use Git LFS to manage this file.}
raise ::Gitlab::GitAccess::ForbiddenError, %Q{File "#{large_blob.path}" is larger than the allowed size of #{max_file_size} MiB. Use Git LFS to manage this file.}
end
end
end
......
......@@ -20,7 +20,7 @@
let(:usage_ratio) { 0.8 }
let(:above_size_limit) { false }
let(:alert_title) { /You have used \d+% of the storage quota for #{group.name}/ }
let(:alert_title_free_tier) { "You have reached the free storage limit of 1,000 MB for #{group.name}" }
let(:alert_title_free_tier) { "You have reached the free storage limit of 1,000 MiB for #{group.name}" }
let(:alert_message_below_limit) do
"If #{group.name} exceeds the storage quota, your ability to write new data to this namespace will be " \
......
......@@ -48,7 +48,7 @@
render_inline(component)
storage_size = 5.gigabytes / 1.gigabyte
expect(page).to have_text "The namespace is currently using #{storage_size} GB of namespace storage"
expect(page).to have_text "The namespace is currently using #{storage_size} GiB of namespace storage"
end
it 'renders the correct callout data' do
......
......@@ -6,23 +6,23 @@
let(:group) { build_stubbed(:group) }
let(:user) { build_stubbed(:user) }
let(:alert_title) { /You have used \d+% of the storage quota for #{group.name}/ }
let(:alert_title_free_tier) { "You have reached the free storage limit of 1,000 MB on 72 projects" }
let(:alert_title_free_tier) { "You have reached the free storage limit of 1,000 MiB on 72 projects" }
let(:alert_message_below_limit) do
"If a project reaches 100% of the storage quota (1,000 MB) the project will be in a read-only state, " \
"If a project reaches 100% of the storage quota (1,000 MiB) the project will be in a read-only state, " \
"and you won't be able to push to your repository or add large files. To reduce storage usage, " \
"reduce git repository and git LFS storage. For more information about storage limits, see our FAQ."
end
let(:alert_message_above_limit_no_purchased_storage) do
"You have consumed all available storage and you can't push or add large files to projects over the " \
"free tier limit (1,000 MB). To remove the read-only state, reduce git repository and git LFS storage, " \
"free tier limit (1,000 MiB). To remove the read-only state, reduce git repository and git LFS storage, " \
"or purchase more storage. For more information about storage limits, see our FAQ."
end
let(:alert_message_above_limit_with_purchased_storage) do
"You have consumed all available storage and you can't push or add large files to projects over the " \
"free tier limit (1,000 MB). To remove the read-only state, reduce git repository and git LFS storage, " \
"free tier limit (1,000 MiB). To remove the read-only state, reduce git repository and git LFS storage, " \
"or purchase more storage. For more information about storage limits, see our FAQ."
end
......
......@@ -32,7 +32,7 @@
end
describe 'PUT #update' do
it 'converts the user entered MB value into bytes' do
it 'converts the user entered MiB value into bytes' do
put :update, params: { id: group, group: { repository_size_limit: '5000' } }
expect(controller).to set_flash[:notice].to 'Group was successfully updated.'
......
......@@ -34,7 +34,7 @@
visit(group_path(free_group))
expect(page).to have_text("You have reached the free storage limit of 10 MB on 1 project")
expect(page).to have_text("You have reached the free storage limit of 10 MiB on 1 project")
end
it 'shows the banner when a project repository in a paid group has exceed the storage limit' do
......@@ -42,7 +42,7 @@
visit(group_path(paid_group))
expect(page).to have_text("You have reached the free storage limit of 10 MB on 1 project")
expect(page).to have_text("You have reached the free storage limit of 10 MiB on 1 project")
end
end
......@@ -56,7 +56,7 @@
visit(group_path(paid_group))
expect(page).to have_text("You have reached the free storage limit of 10 MB on 1 project")
expect(page).to have_text("You have reached the free storage limit of 10 MiB on 1 project")
end
end
end
......@@ -43,7 +43,7 @@
it_behaves_like 'use predefined push rules'
it 'returns an error if file exceeds the maximum file size' do
expect { subject.validate! }.to raise_error(Gitlab::GitAccess::ForbiddenError, "File \"file.bin\" is larger than the allowed size of 1 MB. Use Git LFS to manage this file.")
expect { subject.validate! }.to raise_error(Gitlab::GitAccess::ForbiddenError, "File \"file.bin\" is larger than the allowed size of 1 MiB. Use Git LFS to manage this file.")
end
end
end
......@@ -48,7 +48,7 @@
it 'returns the expected message' do
expected_message = "##### ERROR ##### You have used 120% of the storage quota for " \
"#{namespace.name} (12 MB of 10 MB). #{namespace.name} is now read-only. " \
"#{namespace.name} (12 MiB of 10 MiB). #{namespace.name} is now read-only. " \
"Projects under this namespace are locked and actions will be restricted. " \
"To manage storage, or purchase additional storage, " \
"see #{usage_quotas_guide}. " \
......@@ -62,7 +62,7 @@
describe '#new_changes_error' do
it 'returns the expected message' do
expected_message = "Your push to this repository has been rejected because " \
"it would exceed the namespace storage limit of 10 MB. " \
"it would exceed the namespace storage limit of 10 MiB. " \
"Reduce your namespace storage or purchase additional storage."
expect(error_message.new_changes_error).to eq(expected_message)
......@@ -71,8 +71,8 @@
describe '#above_size_limit_message' do
it 'returns the expected message' do
expected_message = "The namespace storage size (12 MB) exceeds the limit of 10 MB " \
"by 2 MB. You won't be able to push new code to this project. " \
expected_message = "The namespace storage size (12 MiB) exceeds the limit of 10 MiB " \
"by 2 MiB. You won't be able to push new code to this project. " \
"Please contact your GitLab administrator for more information."
expect(error_message.above_size_limit_message).to eq(expected_message)
......
......@@ -25,7 +25,7 @@
expect(mail).to have_subject "Action required: Storage has been exceeded for #{namespace.name}"
expect(mail).to bcc_to recipients
expect(mail).to have_body_text(
"You have used 101% of the storage quota for #{usage_quotas_link} (101 MB of 100 MB)"
"You have used 101% of the storage quota for #{usage_quotas_link} (101 MiB of 100 MiB)"
)
expect(mail).to have_body_text buy_storage_url(namespace)
end
......@@ -42,7 +42,9 @@
expect(mail).to have_subject "You have used 75% of the storage quota for #{namespace.name}"
expect(mail).to bcc_to recipients
expect(mail).to have_body_text "You have used 75% of the storage quota for #{usage_quotas_link} (75 MB of 100 MB)"
expect(mail).to have_body_text(
"You have used 75% of the storage quota for #{usage_quotas_link} (75 MiB of 100 MiB)"
)
expect(mail).to have_body_text buy_storage_url(namespace)
end
end
......
......@@ -72,7 +72,7 @@
}
end
specify { expect(subject).to have_content('This attachment has been truncated to avoid exceeding the maximum allowed attachment size of 15 MB.') }
specify { expect(subject).to have_content('This attachment has been truncated to avoid exceeding the maximum allowed attachment size of 15 MiB.') }
end
end
end
......@@ -366,7 +366,7 @@ def check_access_by_alias(alias_name)
expect(json_response["status"]).to eq(false)
expect(json_response["message"]).to eq(
'Your push to this repository has been rejected because ' \
'it would exceed the namespace storage limit of 4 MB. ' \
'it would exceed the namespace storage limit of 4 MiB. ' \
'Reduce your namespace storage or purchase additional storage.'
)
end
......
......@@ -86,7 +86,7 @@
batch_request
expect(response).to have_gitlab_http_status(:not_acceptable)
expect(json_response['message']).to eql('Your push has been rejected, because this repository has exceeded its size limit of 100 MB by 160 MB. Please contact your GitLab administrator for more information.')
expect(json_response['message']).to eql('Your push has been rejected, because this repository has exceeded its size limit of 100 MiB by 160 MiB. Please contact your GitLab administrator for more information.')
end
end
......@@ -106,7 +106,7 @@
expect(response).to have_gitlab_http_status(:not_acceptable)
expect(json_response['documentation_url']).to include('/help')
expect(json_response['message']).to eql('Your push has been rejected, because this repository has exceeded its size limit of 300 MB by 50 MB. Please contact your GitLab administrator for more information.')
expect(json_response['message']).to eql('Your push has been rejected, because this repository has exceeded its size limit of 300 MiB by 50 MiB. Please contact your GitLab administrator for more information.')
end
end
......
......@@ -99,7 +99,7 @@
context 'when param present' do
let(:opts) { { repository_size_limit: '100' } }
it 'converts from MB to Bytes' do
it 'converts from MiB to Bytes' do
service.execute
expect(setting.reload.repository_size_limit).to eql(100 * 1024 * 1024)
......
......@@ -34,7 +34,7 @@
expect(result[:status]).to be(:error)
expect(result[:message]).to eq(
'Your changes could not be committed, because this ' \
'repository has exceeded its size limit of 1 Byte by 1 Byte'
'repository has exceeded its size limit of 1 B by 1 B'
)
end
end
......
......@@ -134,7 +134,7 @@
{
"message" =>
"Your push has been rejected, because this repository " \
"has exceeded its size limit of 10 Bytes by 45 Bytes. " \
"has exceeded its size limit of 10 B by 45 B. " \
"Please contact your GitLab administrator for more information.",
"type" => "alert"
}
......@@ -153,7 +153,7 @@
{
"message" =>
"##### WARNING ##### You have used 95% of the storage quota for #{namespace.name} " \
"(0 Bytes of 0 Bytes). If #{namespace.name} exceeds the storage quota, all projects " \
"(0 B of 0 B). If #{namespace.name} exceeds the storage quota, all projects " \
"in the namespace will be locked and actions will be restricted. To manage storage, " \
"or purchase additional storage, see " \
"http://localhost/help/user/usage_quotas#manage-your-storage-usage. To learn more about " \
......@@ -183,7 +183,7 @@
it 'returns warning message' do
expect(subject).to match_array([{ "message" => "##### WARNING ##### You have used 96% of the storage quota for #{project.namespace.name} " \
"(11 Bytes of 12 Bytes). If #{project.namespace.name} exceeds the storage quota, " \
"(11 B of 12 B). If #{project.namespace.name} exceeds the storage quota, " \
"all projects in the namespace will be locked and actions will be restricted. " \
"To manage storage, or purchase additional storage, " \
"see http://localhost/help/user/usage_quotas#manage-your-storage-usage. " \
......@@ -202,7 +202,7 @@
it 'returns warning message' do
expect(subject).to match_array([{ "message" => "##### WARNING ##### You have used 96% of the storage quota for #{group.name} " \
"(11 Bytes of 12 Bytes). If #{group.name} exceeds the storage quota, " \
"(11 B of 12 B). If #{group.name} exceeds the storage quota, " \
"all projects in the namespace will be locked and actions will be restricted. " \
"To manage storage, or purchase additional storage, " \
"see http://localhost/help/user/usage_quotas#manage-your-storage-usage. " \
......
......@@ -180,7 +180,7 @@ def update_file_template_project_id(id)
context 'when param present' do
let(:opts) { { repository_size_limit: '100' } }
it 'converts from MB to Bytes' do
it 'converts from MiB to Bytes' do
update_group(group, user, opts)
expect(group.reload.repository_size_limit).to eql(100 * 1024 * 1024)
......
......@@ -27,7 +27,7 @@
expect(merge_request.merge_error).to eq(
'This merge request cannot be merged, ' \
'because this repository has exceeded its size limit of 5 Bytes by 3 Bytes'
'because this repository has exceeded its size limit of 5 B by 3 B'
)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment