Commit cedd5fb7 authored by Nicolas Dular's avatar Nicolas Dular

Remove namespace storage limit setting

This removes the frontend and backend that is related to the
namespace storage limit setting. For the MVC we initially thought
that the limit will be instance wide, this requirement changed
though and it is now based on the plan of a namespace.

To remove the column from the db, we for now ignore the column
and will do the actual removal of the column the next release.
parent a4dfe1f2
......@@ -225,7 +225,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:lets_encrypt_terms_of_service_accepted,
:domain_blacklist_file,
:raw_blob_request_limit,
:namespace_storage_size_limit,
:issues_create_limit,
:default_branch_name,
disabled_oauth_sign_in_sources: [],
......
......@@ -5,6 +5,9 @@ class ApplicationSetting < ApplicationRecord
include CacheMarkdownField
include TokenAuthenticatable
include ChronicDurationAttribute
include IgnorableColumns
ignore_column :namespace_storage_size_limit, remove_with: '13.5', remove_after: '2020-09-22'
GRAFANA_URL_ERROR_MESSAGE = 'Please check your Grafana URL setting in ' \
'Admin Area > Settings > Metrics and profiling > Metrics - Grafana'
......@@ -363,10 +366,6 @@ class ApplicationSetting < ApplicationRecord
length: { maximum: 255 },
allow_blank: true
validates :namespace_storage_size_limit,
presence: true,
numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :issues_create_limit,
numericality: { only_integer: true, greater_than_or_equal_to: 0 }
......
......@@ -96,7 +96,6 @@ module ApplicationSettingImplementation
max_import_size: 50,
minimum_password_length: DEFAULT_MINIMUM_PASSWORD_LENGTH,
mirror_available: true,
namespace_storage_size_limit: 0,
notify_on_unknown_sign_in: true,
outbound_local_requests_whitelist: [],
password_authentication_enabled_for_git: true,
......
......@@ -8,14 +8,6 @@
= f.label :gravatar_enabled, class: 'form-check-label' do
= _('Gravatar enabled')
.form-group
= f.label :namespace_storage_size_limit, class: 'label-bold' do
= _('Maximum namespace storage (MB)')
= f.number_field :namespace_storage_size_limit, class: 'form-control', min: 0
%span.form-text.text-muted
= _('Includes repository storage, wiki storage, LFS objects, build artifacts and packages. 0 for unlimited.')
= link_to _('More information'), help_page_path('user/admin_area/settings/account_and_limit_settings', anchor: 'maximum-namespace-storage-size'), target: '_blank'
.form-group
= f.label :default_projects_limit, _('Default projects limit'), class: 'label-bold'
= f.number_field :default_projects_limit, class: 'form-control', title: _('Maximum number of projects.'), data: { toggle: 'tooltip', container: 'body' }
......
---
title: Remove namespace storage limit setting
merge_request: 38108
author:
type: removed
......@@ -29,20 +29,6 @@ If you choose a size larger than what is currently configured for the web server
you will likely get errors. See the [troubleshooting section](#troubleshooting) for more
details.
## Maximum namespace storage size
This sets a maximum size limit on each namespace. The following are included in the namespace size:
- Repository
- Wiki
- LFS objects
- Build artifacts
- Packages
- Snippets
NOTE: **Note:**
This limit is not currently enforced but will be in a future release.
## Repository size limit **(STARTER ONLY)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/740) in [GitLab Enterprise Edition 8.12](https://about.gitlab.com/releases/2016/09/22/gitlab-8-12-released/#limit-project-size-ee).
......
......@@ -14,8 +14,6 @@ RSpec.describe Namespace::RootStorageSize, type: :model do
before do
create_statistics
stub_application_setting(namespace_storage_size_limit: limit)
end
describe '#above_size_limit?' do
......
......@@ -12827,9 +12827,6 @@ msgstr ""
msgid "Includes an MVC structure, mvnw and pom.xml to help you get started."
msgstr ""
msgid "Includes repository storage, wiki storage, LFS objects, build artifacts and packages. 0 for unlimited."
msgstr ""
msgid "Incoming email"
msgstr ""
......@@ -14645,9 +14642,6 @@ msgstr ""
msgid "Maximum lifetime allowable for Personal Access Tokens is active, your expire date must be set before %{maximum_allowable_date}."
msgstr ""
msgid "Maximum namespace storage (MB)"
msgstr ""
msgid "Maximum number of %{name} (%{count}) exceeded"
msgstr ""
......
......@@ -105,22 +105,6 @@ RSpec.describe Admin::ApplicationSettingsController do
expect(ApplicationSetting.current.minimum_password_length).to eq(10)
end
it 'updates namespace_storage_size_limit setting' do
put :update, params: { application_setting: { namespace_storage_size_limit: '100' } }
expect(response).to redirect_to(general_admin_application_settings_path)
expect(response).to set_flash[:notice].to('Application settings saved successfully')
expect(ApplicationSetting.current.namespace_storage_size_limit).to eq(100)
end
it 'does not accept an invalid namespace_storage_size_limit' do
put :update, params: { application_setting: { namespace_storage_size_limit: '-100' } }
expect(response).to render_template(:general)
expect(assigns(:application_setting).errors[:namespace_storage_size_limit]).to be_present
expect(ApplicationSetting.current.namespace_storage_size_limit).not_to eq(-100)
end
it 'updates repository_storages_weighted setting' do
put :update, params: { application_setting: { repository_storages_weighted_default: 75 } }
......
......@@ -87,11 +87,6 @@ RSpec.describe ApplicationSetting do
it { is_expected.not_to allow_value('abc').for(:minimum_password_length) }
it { is_expected.to allow_value(10).for(:minimum_password_length) }
it { is_expected.to allow_value(0).for(:namespace_storage_size_limit) }
it { is_expected.to allow_value(1).for(:namespace_storage_size_limit) }
it { is_expected.not_to allow_value(nil).for(:namespace_storage_size_limit) }
it { is_expected.not_to allow_value(-1).for(:namespace_storage_size_limit) }
it { is_expected.to allow_value(300).for(:issues_create_limit) }
it { is_expected.not_to allow_value('three').for(:issues_create_limit) }
it { is_expected.not_to allow_value(nil).for(:issues_create_limit) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment