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 ...@@ -44,7 +44,7 @@ module EE
strong_memoize(:redirect_show_path) do strong_memoize(:redirect_show_path) do
case group_view case group_view
when 'security_dashboard' when 'security_dashboard'
helpers.group_security_dashboard_path(group) if ::Feature.enabled?(:group_overview_security_dashboard) helpers.group_security_dashboard_path(group)
else else
nil nil
end end
......
...@@ -27,7 +27,7 @@ module EE ...@@ -27,7 +27,7 @@ module EE
private private
def group_view_security_dashboard_enabled? 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 end
end end
...@@ -101,14 +101,12 @@ module EE ...@@ -101,14 +101,12 @@ module EE
override :user_preferences_usage override :user_preferences_usage
def user_preferences_usage def user_preferences_usage
super.tap do |user_prefs_usage| super.tap do |user_prefs_usage|
if ::Feature.enabled?(:group_overview_security_dashboard)
user_prefs_usage.merge!( user_prefs_usage.merge!(
group_overview_details: count(::User.active.group_view_details), group_overview_details: count(::User.active.group_view_details),
group_overview_security_dashboard: count(::User.active.group_view_security_dashboard) group_overview_security_dashboard: count(::User.active.group_view_security_dashboard)
) )
end end
end end
end
def operations_dashboard_usage def operations_dashboard_usage
users_with_ops_dashboard_as_default = count(::User.active.with_dashboard('operations')) users_with_ops_dashboard_as_default = count(::User.active.with_dashboard('operations'))
......
...@@ -140,42 +140,6 @@ describe GroupsController do ...@@ -140,42 +140,6 @@ describe GroupsController do
expect(subject).to render_template('groups/show') expect(subject).to render_template('groups/show')
end end
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 end
end end
...@@ -194,16 +158,6 @@ describe GroupsController do ...@@ -194,16 +158,6 @@ describe GroupsController do
it 'does not redirect to the security dashboard' do it 'does not redirect to the security dashboard' do
expect(subject).not_to redirect_to(group_security_dashboard_url(group)) expect(subject).not_to redirect_to(group_security_dashboard_url(group))
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
end end
end end
......
...@@ -40,14 +40,6 @@ describe PreferencesHelper do ...@@ -40,14 +40,6 @@ describe PreferencesHelper do
end end
it { is_expected.to include(['Security dashboard', :security_dashboard]) } 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 end
context 'when security dashboard feature is disabled' do context 'when security dashboard feature is disabled' do
...@@ -64,14 +56,6 @@ describe PreferencesHelper do ...@@ -64,14 +56,6 @@ describe PreferencesHelper do
end end
it { is_expected.to eq(true) } 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 end
context 'when security dashboard feature is disabled' do context 'when security dashboard feature is disabled' do
......
...@@ -112,11 +112,6 @@ describe Gitlab::UsageData do ...@@ -112,11 +112,6 @@ describe Gitlab::UsageData do
group_overview_security_dashboard: 2 group_overview_security_dashboard: 2
) )
end 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 end
describe '#features_usage_data_ee' do describe '#features_usage_data_ee' do
......
...@@ -100,11 +100,9 @@ module Gitlab ...@@ -100,11 +100,9 @@ module Gitlab
.merge(services_usage) .merge(services_usage)
.merge(approximate_counts) .merge(approximate_counts)
}.tap do |data| }.tap do |data|
if Feature.enabled?(:group_overview_security_dashboard)
data[:counts][:user_preferences] = user_preferences_usage data[:counts][:user_preferences] = user_preferences_usage
end end
end end
end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
def cycle_analytics_usage_data def cycle_analytics_usage_data
......
...@@ -154,11 +154,6 @@ describe Gitlab::UsageData do ...@@ -154,11 +154,6 @@ describe Gitlab::UsageData do
expect(expected_keys - count_data.keys).to be_empty expect(expected_keys - count_data.keys).to be_empty
end 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 it 'gathers projects data correctly' do
count_data = subject[:counts] 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