Commit c47966ab authored by Max Woolf's avatar Max Woolf

Merge branch '334889-clean-up-project-storage-feature-flag' into 'master'

Cleanup project_storage_ui feature flag

See merge request gitlab-org/gitlab!71270
parents 34b451be 0438d9d7
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
class Projects::UsageQuotasController < Projects::ApplicationController class Projects::UsageQuotasController < Projects::ApplicationController
before_action :authorize_admin_project! before_action :authorize_admin_project!
before_action :verify_usage_quotas_enabled!
layout "project_settings" layout "project_settings"
...@@ -20,10 +19,4 @@ class Projects::UsageQuotasController < Projects::ApplicationController ...@@ -20,10 +19,4 @@ class Projects::UsageQuotasController < Projects::ApplicationController
wiki_help_page_path: help_page_path('administration/wikis/index.md', anchor: 'reduce-wiki-repository-size') wiki_help_page_path: help_page_path('administration/wikis/index.md', anchor: 'reduce-wiki-repository-size')
} }
end end
private
def verify_usage_quotas_enabled!
render_404 unless Feature.enabled?(:project_storage_ui, project&.group, default_enabled: :yaml)
end
end end
---
name: project_storage_ui
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68289
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334889
milestone: '14.2'
type: development
group: group::utilization
default_enabled: false
...@@ -36,9 +36,8 @@ namespace to recalculate the storage. ...@@ -36,9 +36,8 @@ namespace to recalculate the storage.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68898) project-level graph in GitLab 14.4 [with a flag](../administration/feature_flags.md) named `project_storage_ui`. Disabled by default. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68898) project-level graph in GitLab 14.4 [with a flag](../administration/feature_flags.md) named `project_storage_ui`. Disabled by default.
> - Enabled on GitLab.com in GitLab 14.4. > - Enabled on GitLab.com in GitLab 14.4.
> - Enabled on self-managed in GitLab 14.5.
FLAG: > - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71270) in GitLab 14.5.
On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag](../administration/feature_flags.md) named `project_storage_ui`. On GitLab.com, this feature is available.
The following storage usage statistics are available to an owner: The following storage usage statistics are available to an owner:
......
...@@ -144,10 +144,6 @@ module Sidebars ...@@ -144,10 +144,6 @@ module Sidebars
end end
def usage_quotas_menu_item def usage_quotas_menu_item
unless Feature.enabled?(:project_storage_ui, context.project&.group, default_enabled: :yaml)
return ::Sidebars::NilMenuItem.new(item_id: :usage_quotas)
end
::Sidebars::MenuItem.new( ::Sidebars::MenuItem.new(
title: s_('UsageQuota|Usage Quotas'), title: s_('UsageQuota|Usage Quotas'),
link: project_usage_quotas_path(context.project), link: project_usage_quotas_path(context.project),
......
...@@ -162,24 +162,10 @@ RSpec.describe Sidebars::Projects::Menus::SettingsMenu do ...@@ -162,24 +162,10 @@ RSpec.describe Sidebars::Projects::Menus::SettingsMenu do
describe 'Usage Quotas' do describe 'Usage Quotas' do
let(:item_id) { :usage_quotas } let(:item_id) { :usage_quotas }
describe 'with project_storage_ui feature flag enabled' do specify { is_expected.not_to be_nil }
before do
stub_feature_flags(project_storage_ui: true)
end
specify { is_expected.not_to be_nil }
describe 'when the user does not have access' do
let(:user) { nil }
specify { is_expected.to be_nil }
end
end
describe 'with project_storage_ui feature flag disabled' do describe 'when the user does not have access' do
before do let(:user) { nil }
stub_feature_flags(project_storage_ui: false)
end
specify { is_expected.to be_nil } specify { is_expected.to be_nil }
end end
......
...@@ -22,40 +22,26 @@ RSpec.describe 'Project Usage Quotas' do ...@@ -22,40 +22,26 @@ RSpec.describe 'Project Usage Quotas' do
end end
describe 'GET /:namespace/:project/usage_quotas' do describe 'GET /:namespace/:project/usage_quotas' do
context 'with project_storage_ui feature flag enabled' do it 'renders usage quotas path' do
before do mock_storage_app_data = {
stub_feature_flags(project_storage_ui: true) project_path: project.full_path,
end usage_quotas_help_page_path: help_page_path('user/usage_quotas'),
build_artifacts_help_page_path: help_page_path('ci/pipelines/job_artifacts', anchor: 'when-job-artifacts-are-deleted'),
it 'renders usage quotas path' do packages_help_page_path: help_page_path('user/packages/package_registry/index.md', anchor: 'delete-a-package'),
mock_storage_app_data = { repository_help_page_path: help_page_path('user/project/repository/reducing_the_repo_size_using_git'),
project_path: project.full_path, snippets_help_page_path: help_page_path('user/snippets', anchor: 'reduce-snippets-repository-size'),
usage_quotas_help_page_path: help_page_path('user/usage_quotas'), wiki_help_page_path: help_page_path('administration/wikis/index.md', anchor: 'reduce-wiki-repository-size')
build_artifacts_help_page_path: help_page_path('ci/pipelines/job_artifacts', anchor: 'when-job-artifacts-are-deleted'), }
packages_help_page_path: help_page_path('user/packages/package_registry/index.md', anchor: 'delete-a-package'), get project_usage_quotas_path(project)
repository_help_page_path: help_page_path('user/project/repository/reducing_the_repo_size_using_git'),
snippets_help_page_path: help_page_path('user/snippets', anchor: 'reduce-snippets-repository-size'), expect(response).to have_gitlab_http_status(:ok)
wiki_help_page_path: help_page_path('administration/wikis/index.md', anchor: 'reduce-wiki-repository-size') expect(response.body).to include(project_usage_quotas_path(project))
} expect(assigns[:storage_app_data]).to eq(mock_storage_app_data)
get project_usage_quotas_path(project) expect(response.body).to include("Usage of project resources across the <strong>#{project.name}</strong> project")
expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to include(project_usage_quotas_path(project))
expect(assigns[:storage_app_data]).to eq(mock_storage_app_data)
expect(response.body).to include("Usage of project resources across the <strong>#{project.name}</strong> project")
end
context 'renders :not_found for user without permission' do
let(:role) { :developer }
it_behaves_like 'response with 404 status'
end
end end
context 'with project_storage_ui feature flag disabled' do context 'renders :not_found for user without permission' do
before do let(:role) { :developer }
stub_feature_flags(project_storage_ui: false)
end
it_behaves_like 'response with 404 status' it_behaves_like 'response with 404 status'
end end
......
...@@ -119,7 +119,7 @@ RSpec.shared_context 'project navbar structure' do ...@@ -119,7 +119,7 @@ RSpec.shared_context 'project navbar structure' do
_('Repository'), _('Repository'),
_('CI/CD'), _('CI/CD'),
_('Monitor'), _('Monitor'),
(s_('UsageQuota|Usage Quotas') if Feature.enabled?(:project_storage_ui, default_enabled: :yaml)) s_('UsageQuota|Usage Quotas')
] ]
} }
].compact ].compact
......
...@@ -987,28 +987,10 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -987,28 +987,10 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end end
describe 'Usage Quotas' do describe 'Usage Quotas' do
context 'with project_storage_ui feature flag enabled' do it 'has a link to Usage Quotas' do
before do render
stub_feature_flags(project_storage_ui: true)
end
it 'has a link to Usage Quotas' do
render
expect(rendered).to have_link('Usage Quotas', href: project_usage_quotas_path(project))
end
end
context 'with project_storage_ui feature flag disabled' do
before do
stub_feature_flags(project_storage_ui: false)
end
it 'does not have a link to Usage Quotas' do
render
expect(rendered).not_to have_link('Usage Quotas', href: project_usage_quotas_path(project)) expect(rendered).to have_link('Usage Quotas', href: project_usage_quotas_path(project))
end
end end
end end
end 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