Commit 935ed217 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '255166-remove-ff-additional-repo-storage-by-namespace' into 'master'

Remove the additional_repo_storage_by_namespace FF

See merge request gitlab-org/gitlab!49055
parents 2ff3cfd7 d9915e28
<script>
/**
* project_with_excess_storage.vue component is rendered behind
* `additional_repo_storage_by_namespace` feature flag. The component
* looks similar to project.vue component so that once the flag is
* lifted this component could replace and be used mainstream.
*/
import { GlLink, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { s__, sprintf } from '~/locale';
import ProjectAvatar from '~/vue_shared/components/project_avatar/default.vue';
......
......@@ -367,7 +367,6 @@ module EE
def additional_repo_storage_by_namespace_enabled?
!::Feature.enabled?(:namespace_storage_limit, self) &&
::Feature.enabled?(:additional_repo_storage_by_namespace, self) &&
::Gitlab::CurrentSettings.automatic_purchased_storage_allocation?
end
......
---
title: Remove the additional_repo_storage_by_namespace feature flag
merge_request: 49055
author:
type: other
---
name: additional_repo_storage_by_namespace
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/43188
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/255166
milestone: '13.5'
type: development
group: group::fulfillment
default_enabled: false
......@@ -21,32 +21,39 @@ RSpec.describe ProjectsController do
subject { get :show, params: { namespace_id: public_project.namespace.path, id: public_project.path } }
context 'additional repo storage by namespace' do
using RSpec::Parameterized::TableSyntax
let(:namespace) { public_project.namespace }
where(:automatic_purchased_storage_allocation, :additional_repo_storage_by_namespace, :expected_to_render) do
true | true | true
true | false | false
false | true | false
false | false | false
before do
allow_next_instance_of(EE::Namespace::RootExcessStorageSize) do |root_storage|
allow(root_storage).to receive(:usage_ratio).and_return(0.5)
allow(root_storage).to receive(:above_size_limit?).and_return(true)
end
stub_feature_flags(namespace_storage_limit: false)
namespace.add_owner(user)
end
with_them do
context 'when automatic_purchased_storage_allocation setting is enabled' do
before do
allow_next_instance_of(EE::Namespace::RootExcessStorageSize) do |root_storage|
allow(root_storage).to receive(:usage_ratio).and_return(0.5)
allow(root_storage).to receive(:above_size_limit?).and_return(true)
end
stub_application_setting(automatic_purchased_storage_allocation: automatic_purchased_storage_allocation)
stub_feature_flags(additional_repo_storage_by_namespace: additional_repo_storage_by_namespace, namespace_storage_limit: false)
stub_application_setting(automatic_purchased_storage_allocation: true)
end
namespace.add_owner(user)
it 'includes the CTA for additional purchased storage' do
subject
expect(response.body).to match(/Please purchase additional storage/)
end
end
context 'when automatic_purchased_storage_allocation setting is disabled' do
before do
stub_application_setting(automatic_purchased_storage_allocation: false)
end
it do
it 'does not include the CTA for additional purchased storage' do
subject
expect(response.body.include?("Please purchase additional storage")).to eq(expected_to_render)
expect(response.body).not_to match(/Please purchase additional storage/)
end
end
end
......
......@@ -111,8 +111,8 @@ describe('Storage counter app', () => {
});
});
describe('with additional_repo_storage_by_namespace feature flag', () => {
it('usage_graph component hidden is when flag is false', async () => {
describe('with additional_repo_storage_by_namespace feature', () => {
it('usage_graph component hidden is when feature is false', async () => {
wrapper.setData({
namespace: withRootStorageStatistics,
});
......@@ -124,7 +124,7 @@ describe('Storage counter app', () => {
expect(findStorageInlineAlert().exists()).toBe(false);
});
it('usage_statistics component is rendered when flag is true', async () => {
it('usage_statistics component is rendered when feature is true', async () => {
createComponent({
additionalRepoStorageByNamespace: true,
namespace: withRootStorageStatistics,
......
......@@ -1723,23 +1723,16 @@ RSpec.describe Namespace do
subject { namespace.additional_repo_storage_by_namespace_enabled? }
where(:namespace_storage_limit, :additional_repo_storage_by_namespace, :automatic_purchased_storage_allocation, :result) do
false | false | false | false
false | false | true | false
false | true | false | false
true | false | false | false
false | true | true | true
true | true | false | false
true | false | true | false
true | true | true | false
where(:namespace_storage_limit, :automatic_purchased_storage_allocation, :result) do
false | false | false
false | true | true
true | false | false
true | true | false
end
with_them do
before do
stub_feature_flags(
namespace_storage_limit: namespace_storage_limit,
additional_repo_storage_by_namespace: additional_repo_storage_by_namespace
)
stub_feature_flags(namespace_storage_limit: namespace_storage_limit)
stub_application_setting(automatic_purchased_storage_allocation: automatic_purchased_storage_allocation)
end
......
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