Commit 4ec3d797 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'remove-generic_alert_endpoint-feature-flag' into 'master'

Remove generic alert endpoint feature flag

See merge request gitlab-org/gitlab!18570
parents 3b148b3e bfbb9661
......@@ -9,7 +9,6 @@ module Projects
skip_before_action :project
prepend_before_action :repository, :project_without_auth
before_action :check_generic_alert_endpoint_feature_flag!
def create
token = extract_alert_manager_token(request)
......@@ -25,10 +24,6 @@ module Projects
.find_by_full_path("#{params[:namespace_id]}/#{params[:project_id]}")
end
def check_generic_alert_endpoint_feature_flag!
render_404 unless Feature.enabled?(:generic_alert_endpoint, @project)
end
def extract_alert_manager_token(request)
Doorkeeper::OAuth::Token.from_bearer_authorization(request)
end
......
......@@ -639,7 +639,6 @@ module EE
end
def alerts_service_available?
::Feature.enabled?(:generic_alert_endpoint, self) &&
feature_available?(:incident_management)
end
......
......@@ -20,17 +20,12 @@ module Projects
delegate :alerts_service, to: :project
def generic_alert_endpoint_enabled?
Feature.enabled?(:generic_alert_endpoint, project)
end
def incident_management_available?
project.feature_available?(:incident_management)
end
def alerts_service_activated?
incident_management_available? &&
generic_alert_endpoint_enabled? &&
alerts_service.try(:active?)
end
......
---
title: Adds a generic alert integration which can accept alerts from any source via a generic webhook receiver.
merge_request:
author:
type: added
......@@ -22,11 +22,6 @@ describe Projects::Alerting::NotificationsController do
post :create, params: project_params, body: body.to_json, as: :json
end
context 'when feature flag is on' do
before do
stub_feature_flags(generic_alert_endpoint: true)
end
context 'when notification service succeeds' do
let(:payload) do
{
......@@ -91,19 +86,6 @@ describe Projects::Alerting::NotificationsController do
end
end
context 'when feature flag is off' do
before do
stub_feature_flags(generic_alert_endpoint: false)
end
it 'responds with not_found' do
make_request
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
def project_params(opts = {})
opts.reverse_merge(namespace_id: project.namespace, project_id: project)
end
......
......@@ -25,7 +25,6 @@ describe 'User activates Alerts' do
context 'when feature available', :js do
before do
stub_licensed_features(incident_management: true)
stub_feature_flags(generic_alert_endpoint: true)
end
context 'when service is deactivated' do
......@@ -60,14 +59,6 @@ describe 'User activates Alerts' do
expect(reset_key.value).to be_present
end
end
context 'when feature flag `generic_alert_endpoint` disabled' do
before do
stub_feature_flags(generic_alert_endpoint: false)
end
it_behaves_like 'no service'
end
end
context 'when feature unavailable' do
......
......@@ -1135,20 +1135,6 @@ describe Project do
it { is_expected.to include(*disabled_services) }
end
end
context 'when incident_management is available' do
before do
stub_licensed_features(incident_management: true)
end
context 'when feature flag generic_alert_endpoint is disabled' do
before do
stub_feature_flags(generic_alert_endpoint: false)
end
it { is_expected.to include('alerts') }
end
end
end
describe '#pull_mirror_available?' do
......
......@@ -54,11 +54,6 @@ describe Projects::Alerting::NotifyService do
stub_licensed_features(incident_management: true)
end
context 'with Generic Alert Endpoint feature enabled' do
before do
stub_feature_flags(generic_alert_endpoint: true)
end
context 'with activated Alerts Service' do
let!(:alerts_service) { create(:alerts_service, project: project) }
......@@ -92,15 +87,6 @@ describe Projects::Alerting::NotifyService do
end
end
context 'with Generic Alert Endpoint feature disabled' do
before do
stub_feature_flags(generic_alert_endpoint: false)
end
it_behaves_like 'does not process incident issues', http_status: 403
end
end
context 'without license' do
before do
stub_licensed_features(incident_management: false)
......
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