Commit 49b9200f authored by Stan Hu's avatar Stan Hu

Merge branch 'rf-remove-group-overview-security-dashboard-feature-flag' into 'master'

Remove Security Dashboard feature flag

See merge request gitlab-org/gitlab-ee!15176
parents 366fdfb5 de93a930
---
title: Remove Security Dashboard feature flag
merge_request: 31820
author:
type: other
......@@ -44,7 +44,7 @@ module EE
strong_memoize(:redirect_show_path) do
case group_view
when 'security_dashboard'
helpers.group_security_dashboard_path(group) if ::Feature.enabled?(:group_overview_security_dashboard)
helpers.group_security_dashboard_path(group)
else
nil
end
......
......@@ -27,7 +27,7 @@ module EE
private
def group_view_security_dashboard_enabled?
License.feature_available?(:security_dashboard) && ::Feature.enabled?(:group_overview_security_dashboard)
License.feature_available?(:security_dashboard)
end
end
end
......@@ -101,12 +101,10 @@ module EE
override :user_preferences_usage
def user_preferences_usage
super.tap do |user_prefs_usage|
if ::Feature.enabled?(:group_overview_security_dashboard)
user_prefs_usage.merge!(
group_overview_details: count(::User.active.group_view_details),
group_overview_security_dashboard: count(::User.active.group_view_security_dashboard)
)
end
user_prefs_usage.merge!(
group_overview_details: count(::User.active.group_view_details),
group_overview_security_dashboard: count(::User.active.group_view_security_dashboard)
)
end
end
......
......@@ -140,42 +140,6 @@ describe GroupsController do
expect(subject).to render_template('groups/show')
end
end
context 'and the feature flag is disabled' do
before do
stub_feature_flags(group_overview_security_dashboard: false)
end
it 'renders the expected template' do
expect(subject).to render_template('groups/show')
end
end
end
end
context 'when feature flag is disabled' do
before do
stub_feature_flags(group_overview_security_dashboard: false)
end
let(:user) { create(:user, group_view: :security_dashboard) } # not a member of a group
context 'when security dashboard feature is enabled' do
before do
stub_licensed_features(security_dashboard: true)
end
context 'when user is not allowed to access group security dashboard' do
it 'works because security dashboard is not rendered' do
expect(subject).to have_gitlab_http_status(200)
end
end
end
context 'when security dashboard feature is disabled' do
it 'works because security dashboard is not rendered' do
expect(subject).to have_gitlab_http_status(200)
end
end
end
end
......@@ -194,16 +158,6 @@ describe GroupsController do
it 'does not redirect to the security dashboard' do
expect(subject).not_to redirect_to(group_security_dashboard_url(group))
end
context 'and the feature flag is disabled' do
before do
stub_feature_flags(group_overview_security_dashboard: false)
end
it 'renders the expected template' do
expect(subject).to render_template('groups/show')
end
end
end
end
end
......
......@@ -40,14 +40,6 @@ describe PreferencesHelper do
end
it { is_expected.to include(['Security dashboard', :security_dashboard]) }
context 'but feature flag is disabled' do
before do
stub_feature_flags(group_overview_security_dashboard: false)
end
it { is_expected.not_to include(['Security dashboard', :security_dashboard]) }
end
end
context 'when security dashboard feature is disabled' do
......@@ -64,14 +56,6 @@ describe PreferencesHelper do
end
it { is_expected.to eq(true) }
context 'but feature flag is disabled' do
before do
stub_feature_flags(group_overview_security_dashboard: false)
end
it { is_expected.to eq(false) }
end
end
context 'when security dashboard feature is disabled' do
......
......@@ -112,11 +112,6 @@ describe Gitlab::UsageData do
group_overview_security_dashboard: 2
)
end
it 'does not gather group overview preferences usage data when the feature is disabled' do
stub_feature_flags(group_overview_security_dashboard: false)
expect(subject[:counts].keys).not_to include(:user_preferences)
end
end
describe '#features_usage_data_ee' do
......
......@@ -100,9 +100,7 @@ module Gitlab
.merge(services_usage)
.merge(approximate_counts)
}.tap do |data|
if Feature.enabled?(:group_overview_security_dashboard)
data[:counts][:user_preferences] = user_preferences_usage
end
data[:counts][:user_preferences] = user_preferences_usage
end
end
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -154,11 +154,6 @@ describe Gitlab::UsageData do
expect(expected_keys - count_data.keys).to be_empty
end
it 'does not gather user preferences usage data when the feature is disabled' do
stub_feature_flags(group_overview_security_dashboard: false)
expect(subject[:counts].keys).not_to include(:user_preferences)
end
it 'gathers projects data correctly' do
count_data = subject[:counts]
......
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