Commit a141b520 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'remove-instance_security_dashboard-ff' into 'master'

Remove instance_security_dashboard feature flag

See merge request gitlab-org/gitlab!79187
parents 18e9e74f eb53bce4
...@@ -4,9 +4,7 @@ module Security ...@@ -4,9 +4,7 @@ module Security
class ApplicationController < ::ApplicationController class ApplicationController < ::ApplicationController
include SecurityDashboardsPermissions include SecurityDashboardsPermissions
before_action :check_feature_enabled!
before_action do before_action do
push_frontend_feature_flag(:instance_security_dashboard, default_enabled: true)
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml) push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
end end
...@@ -14,10 +12,6 @@ module Security ...@@ -14,10 +12,6 @@ module Security
protected protected
def check_feature_enabled!
render_404 unless Feature.enabled?(:instance_security_dashboard, default_enabled: true)
end
def vulnerable def vulnerable
@vulnerable ||= InstanceSecurityDashboard.new( @vulnerable ||= InstanceSecurityDashboard.new(
current_user, current_user,
......
...@@ -50,8 +50,7 @@ module EE ...@@ -50,8 +50,7 @@ module EE
def security_dashboard_available? def security_dashboard_available?
security_dashboard = InstanceSecurityDashboard.new(current_user) security_dashboard = InstanceSecurityDashboard.new(current_user)
::Feature.enabled?(:instance_security_dashboard, default_enabled: true) && security_dashboard.feature_available?(:security_dashboard) &&
security_dashboard.feature_available?(:security_dashboard) &&
can?(current_user, :read_instance_security_dashboard, security_dashboard) can?(current_user, :read_instance_security_dashboard, security_dashboard)
end end
end end
......
---
name: instance_security_dashboard
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24505
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/259285
milestone: '12.8'
type: development
group: group::threat insights
default_enabled: true
...@@ -153,16 +153,6 @@ RSpec.describe Security::ProjectsController do ...@@ -153,16 +153,6 @@ RSpec.describe Security::ProjectsController do
end end
end end
context 'and the security dashboard feature is disabled' do
it '404s' do
stub_feature_flags(instance_security_dashboard: false)
subject
expect(response).to have_gitlab_http_status(:not_found)
end
end
it "removes the project from the current user's security dashboard" do it "removes the project from the current user's security dashboard" do
subject subject
......
...@@ -79,41 +79,24 @@ RSpec.describe DashboardHelper, type: :helper do ...@@ -79,41 +79,24 @@ RSpec.describe DashboardHelper, type: :helper do
end end
describe 'security dashboard link' do describe 'security dashboard link' do
context 'when the feature is enabled' do context 'and the feature is available on the license' do
before do before do
stub_feature_flags(instance_security_dashboard: true) stub_licensed_features(security_dashboard: true)
end end
context 'and the feature is available on the license' do context 'and the user is authenticated' do
before do before do
stub_licensed_features(security_dashboard: true) stub_user_permissions_for(:security, true)
end
context 'and the user is authenticated' do
before do
stub_user_permissions_for(:security, true)
end
it 'is included in the nav' do
expect(helper.dashboard_nav_links).to include(:security)
end
end end
context 'and the user is not authenticated' do it 'is included in the nav' do
before do expect(helper.dashboard_nav_links).to include(:security)
stub_user_permissions_for(:security, false)
end
it 'is not included in the nav' do
expect(helper.dashboard_nav_links).not_to include(:security)
end
end end
end end
context 'when the feature is not available on the license' do context 'and the user is not authenticated' do
before do before do
stub_licensed_features(security_dashboard: false) stub_user_permissions_for(:security, false)
stub_user_permissions_for(:security, true)
end end
it 'is not included in the nav' do it 'is not included in the nav' do
...@@ -122,10 +105,9 @@ RSpec.describe DashboardHelper, type: :helper do ...@@ -122,10 +105,9 @@ RSpec.describe DashboardHelper, type: :helper do
end end
end end
context 'when the feature is not enabled' do context 'when the feature is not available on the license' do
before do before do
stub_feature_flags(instance_security_dashboard: false) stub_licensed_features(security_dashboard: false)
stub_licensed_features(security_dashboard: true)
stub_user_permissions_for(:security, true) stub_user_permissions_for(:security, true)
end end
......
...@@ -24,16 +24,6 @@ RSpec.shared_examples Security::ApplicationController do ...@@ -24,16 +24,6 @@ RSpec.shared_examples Security::ApplicationController do
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
context 'and the security dashboard feature is disabled' do
it '404s' do
stub_feature_flags(instance_security_dashboard: false)
security_application_controller_child_action
expect(response).to have_gitlab_http_status(:not_found)
end
end
end end
context 'when the user is not authenticated' do context 'when the user is not authenticated' do
......
...@@ -25,16 +25,6 @@ RSpec.shared_examples 'security dashboard JSON endpoint' do ...@@ -25,16 +25,6 @@ RSpec.shared_examples 'security dashboard JSON endpoint' do
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
context 'and the security dashboard feature is disabled' do
it '404s' do
stub_feature_flags(instance_security_dashboard: false)
security_dashboard_request
expect(response).to have_gitlab_http_status(:not_found)
end
end
end end
context 'when the user is not authenticated' do context 'when the user is not authenticated' do
......
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