Commit 60e89c48 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '287676-remove-threat-monitoring-alert-ff' into 'master'

Remove threat_monitoring_alerts feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!62148
parents 191769a1 2efff769
......@@ -165,7 +165,8 @@ button at the bottom of the editor.
### Configuring Network Policy Alerts
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3438) and [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/287676) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.9.
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3438) and [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/287676) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.9.
> - The feature flag was removed and the Threat Monitoring Alerts Project was [made generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/287676) in GitLab 14.0.
You can use policy alerts to track your policy's impact. Alerts are only available if you've
[installed](../../clusters/agent/repository.md)
......@@ -186,25 +187,6 @@ There are two ways to create policy alerts:
Once added, the UI updates and displays a warning about the dangers of too many alerts.
#### Enable or disable Policy Alerts **(ULTIMATE)**
Policy Alerts is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can opt to disable it.
To enable it:
```ruby
Feature.enable(:threat_monitoring_alerts)
```
To disable it:
```ruby
Feature.disable(:threat_monitoring_alerts)
```
### Container Network Policy Alert list
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3438) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.9.
......
......@@ -2,7 +2,6 @@
import { GlIcon, GlLink, GlPopover, GlTabs, GlTab } from '@gitlab/ui';
import { mapActions } from 'vuex';
import { s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import Alerts from './alerts/alerts.vue';
import NetworkPolicyList from './network_policy_list.vue';
import NoEnvironmentEmptyState from './no_environment_empty_state.vue';
......@@ -23,7 +22,6 @@ export default {
NetworkPolicyList,
NoEnvironmentEmptyState,
},
mixins: [glFeatureFlagsMixin()],
inject: ['documentationPath'],
props: {
defaultEnvironmentId: {
......@@ -52,11 +50,6 @@ export default {
isSetUpMaybe: this.isValidEnvironmentId(this.defaultEnvironmentId),
};
},
computed: {
showAlertsTab() {
return this.glFeatures.threatMonitoringAlerts;
},
},
created() {
if (this.isSetUpMaybe) {
this.setCurrentEnvironmentId(this.defaultEnvironmentId);
......@@ -106,11 +99,7 @@ export default {
</header>
<gl-tabs content-class="gl-pt-0">
<gl-tab
v-if="showAlertsTab"
:title="s__('ThreatMonitoring|Alerts')"
data-testid="threat-monitoring-alerts-tab"
>
<gl-tab :title="s__('ThreatMonitoring|Alerts')" data-testid="threat-monitoring-alerts-tab">
<alerts />
</gl-tab>
<gl-tab ref="networkPolicyTab" :title="s__('ThreatMonitoring|Policies')">
......
......@@ -6,12 +6,6 @@ module Projects
before_action :authorize_read_threat_monitoring!
before_action do
push_frontend_feature_flag(:threat_monitoring_alerts, project, default_enabled: :yaml)
end
before_action :threat_monitoring_ff_enabled, only: [:alert_details]
feature_category :web_firewall
# rubocop: disable CodeReuse/ActiveRecord
......@@ -35,11 +29,5 @@ module Projects
render_404
end
end
private
def threat_monitoring_ff_enabled
render_404 unless Feature.enabled?(:threat_monitoring_alerts, project, default_enabled: :yaml)
end
end
end
---
title: Remove threat_monitoring_alerts feature flag
merge_request: 62148
author:
type: other
---
name: threat_monitoring_alerts
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48400
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/287676
milestone: '13.7'
type: development
group: group::container security
default_enabled: true
......@@ -249,29 +249,6 @@ RSpec.describe Projects::ThreatMonitoringController do
sign_in(user)
end
context 'with threat_monitoring feature and threat_monitoring_alerts feature flag' do
using RSpec::Parameterized::TableSyntax
where(:feature_flag, :feature, :http_status) do
false | false | :not_found
false | true | :not_found
true | false | :not_found
true | true | :ok
end
with_them do
before do
stub_licensed_features(threat_monitoring: feature)
stub_feature_flags(threat_monitoring_alerts: feature_flag)
end
specify do
subject
expect(response).to have_gitlab_http_status(http_status)
end
end
end
context 'when feature is available' do
before do
stub_licensed_features(threat_monitoring: true)
......@@ -301,6 +278,18 @@ RSpec.describe Projects::ThreatMonitoringController do
end
end
end
context 'when feature is not available' do
before do
stub_licensed_features(threat_monitoring: false)
end
it 'returns 404' do
subject
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
context 'with unauthorized user' do
......
......@@ -45,7 +45,6 @@ describe('ThreatMonitoringApp component', () => {
},
provide: {
documentationPath,
glFeatures: { threatMonitoringAlerts: false },
...provide,
},
store,
......@@ -131,15 +130,11 @@ describe('ThreatMonitoringApp component', () => {
it('renders the network policy tab', () => {
expect(findNetworkPolicyTab().element).toMatchSnapshot();
});
it('does not show the alert tab', () => {
expect(findAlertTab().exists()).toBe(false);
});
});
describe('alerts tab', () => {
beforeEach(() => {
factory({ provide: { glFeatures: { threatMonitoringAlerts: true } } });
factory();
});
it('shows the alerts tab', () => {
expect(findAlertTab().exists()).toBe(true);
......
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