Commit 5ba226ce authored by Anna Vovchenko's avatar Anna Vovchenko Committed by Vitali Tatarintev

Remove feature flag infrastructure_registry_page

parent 8263433e
......@@ -3,19 +3,14 @@
module Projects
module Packages
class InfrastructureRegistryController < Projects::ApplicationController
before_action :verify_feature_enabled!
include PackagesAccess
feature_category :infrastructure_as_code
def show
@package = project.packages.find(params[:id])
@package_files = @package.package_files.recent
end
private
def verify_feature_enabled!
render_404 unless Feature.enabled?(:infrastructure_registry_page, default_enabled: :yaml)
end
end
end
end
---
name: infrastructure_registry_page
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57338
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326460
milestone: '13.11'
type: development
group: group::package
default_enabled: true
......@@ -58,7 +58,7 @@ module Sidebars
end
def infrastructure_registry_menu_item
if Feature.disabled?(:infrastructure_registry_page, context.current_user, default_enabled: :yaml) || packages_registry_disabled?
if packages_registry_disabled?
return ::Sidebars::NilMenuItem.new(item_id: :infrastructure_registry)
end
......
......@@ -18,9 +18,9 @@ RSpec.describe Projects::Packages::InfrastructureRegistryController do
it_behaves_like 'returning response status', :ok
context 'when the feature is disabled' do
context 'when the packages registry is not available' do
before do
stub_feature_flags(infrastructure_registry_page: false)
stub_config(packages: { enabled: false })
end
it_behaves_like 'returning response status', :not_found
......@@ -34,9 +34,9 @@ RSpec.describe Projects::Packages::InfrastructureRegistryController do
it_behaves_like 'returning response status', :ok
context 'when the feature is disabled' do
context 'when the packages registry is not available' do
before do
stub_feature_flags(infrastructure_registry_page: false)
stub_config(packages: { enabled: false })
end
it_behaves_like 'returning response status', :not_found
......
......@@ -11,9 +11,9 @@ RSpec.describe 'Infrastructure Registry' do
project.add_maintainer(user)
end
context 'when feature is not available' do
context 'when packages registry is not enabled' do
before do
stub_feature_flags(infrastructure_registry_page: false)
stub_config(packages: { enabled: false })
end
it 'gives 404' do
......@@ -23,7 +23,7 @@ RSpec.describe 'Infrastructure Registry' do
end
end
context 'when feature is available', :js do
context 'when packages registry is enabled', :js do
before do
visit_project_infrastructure_registry
end
......
......@@ -124,34 +124,22 @@ RSpec.describe Sidebars::Projects::Menus::PackagesRegistriesMenu do
describe 'Infrastructure Registry' do
let(:item_id) { :infrastructure_registry }
context 'when feature flag :infrastructure_registry_page is enabled' do
it 'the menu item is added to list of menu items' do
stub_feature_flags(infrastructure_registry_page: true)
is_expected.not_to be_nil
end
context 'when config package setting is disabled' do
it 'does not add the menu item to the list' do
stub_config(packages: { enabled: false })
is_expected.to be_nil
end
end
it 'the menu item is added to list of menu items' do
is_expected.not_to be_nil
end
context 'when user cannot read packages' do
let(:user) { nil }
context 'when config package setting is disabled' do
it 'does not add the menu item to the list' do
stub_config(packages: { enabled: false })
it 'does not add the menu item to the list' do
is_expected.to be_nil
end
is_expected.to be_nil
end
end
context 'when feature flag :infrastructure_registry_page is disabled' do
it 'does not add the menu item to the list' do
stub_feature_flags(infrastructure_registry_page: false)
context 'when user cannot read packages' do
let(:user) { nil }
it 'does not add the menu item to the list' do
is_expected.to be_nil
end
end
......
......@@ -640,9 +640,9 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
expect(rendered).to have_link('Infrastructure Registry', href: project_infrastructure_registry_index_path(project))
end
context 'when feature flag :infrastructure_registry_page is disabled' do
context 'when package registry config is disabled' do
it 'does not show link to package registry page' do
stub_feature_flags(infrastructure_registry_page: false)
stub_config(packages: { enabled: false })
render
......
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