Commit 6d9099bf authored by Imre Farkas's avatar Imre Farkas

Merge branch 'remove-self-monitoring-feature-flag' into 'master'

Remove self monitoring feature flag

See merge request gitlab-org/gitlab!23631
parents c37e7abd b247145a
...@@ -3,9 +3,7 @@ import projectSelect from '~/project_select'; ...@@ -3,9 +3,7 @@ import projectSelect from '~/project_select';
import selfMonitor from '~/self_monitor'; import selfMonitor from '~/self_monitor';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
if (gon.features && gon.features.selfMonitoringProject) { selfMonitor();
selfMonitor();
}
// Initialize expandable settings panels // Initialize expandable settings panels
initSettingsPanels(); initSettingsPanels();
projectSelect(); projectSelect();
......
...@@ -11,16 +11,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -11,16 +11,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
before_action :set_application_setting before_action :set_application_setting
before_action :whitelist_query_limiting, only: [:usage_data] before_action :whitelist_query_limiting, only: [:usage_data]
before_action :validate_self_monitoring_feature_flag_enabled, only: [
:create_self_monitoring_project,
:status_create_self_monitoring_project,
:delete_self_monitoring_project,
:status_delete_self_monitoring_project
]
before_action do
push_frontend_feature_flag(:self_monitoring_project)
end
VALID_SETTING_PANELS = %w(general integrations repository VALID_SETTING_PANELS = %w(general integrations repository
ci_cd reporting metrics_and_profiling ci_cd reporting metrics_and_profiling
...@@ -163,10 +153,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -163,10 +153,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
private private
def validate_self_monitoring_feature_flag_enabled
self_monitoring_project_not_implemented unless Feature.enabled?(:self_monitoring_project)
end
def self_monitoring_data def self_monitoring_data
{ {
project_id: @application_setting.self_monitoring_project_id, project_id: @application_setting.self_monitoring_project_id,
...@@ -174,16 +160,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -174,16 +160,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
} }
end end
def self_monitoring_project_not_implemented
render(
status: :not_implemented,
json: {
message: _('Self-monitoring is not enabled on this GitLab server, contact your administrator.'),
documentation_url: help_page_path('administration/monitoring/gitlab_self_monitoring_project/index')
}
)
end
def set_application_setting def set_application_setting
@application_setting = ApplicationSetting.current_without_cache @application_setting = ApplicationSetting.current_without_cache
end end
......
...@@ -47,8 +47,7 @@ ...@@ -47,8 +47,7 @@
.settings-content .settings-content
= render 'performance_bar' = render 'performance_bar'
- if Feature.enabled?(:self_monitoring_project) .js-self-monitoring-settings{ data: self_monitoring_project_data }
.js-self-monitoring-settings{ data: self_monitoring_project_data }
%section.settings.as-usage.no-animate#js-usage-settings{ class: ('expanded' if expanded_by_default?) } %section.settings.as-usage.no-animate#js-usage-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header#usage-statistics .settings-header#usage-statistics
......
---
title: Remove self monitoring feature flag
merge_request: 23631
author:
type: other
...@@ -17112,9 +17112,6 @@ msgstr "" ...@@ -17112,9 +17112,6 @@ msgstr ""
msgid "Self monitoring project does not exist" msgid "Self monitoring project does not exist"
msgstr "" msgstr ""
msgid "Self-monitoring is not enabled on this GitLab server, contact your administrator."
msgstr ""
msgid "Self-monitoring project does not exist. Please check logs for any error messages" msgid "Self-monitoring project does not exist. Please check logs for any error messages"
msgstr "" msgstr ""
......
...@@ -17,11 +17,7 @@ describe 'Self-Monitoring project requests' do ...@@ -17,11 +17,7 @@ describe 'Self-Monitoring project requests' do
login_as(admin) login_as(admin)
end end
context 'with feature flag disabled' do context 'when the self monitoring project is created' do
it_behaves_like 'not accessible if feature flag is disabled'
end
context 'with feature flag enabled' do
let(:status_api) { status_create_self_monitoring_project_admin_application_settings_path } let(:status_api) { status_create_self_monitoring_project_admin_application_settings_path }
it_behaves_like 'triggers async worker, returns sidekiq job_id with response accepted' it_behaves_like 'triggers async worker, returns sidekiq job_id with response accepted'
...@@ -45,11 +41,7 @@ describe 'Self-Monitoring project requests' do ...@@ -45,11 +41,7 @@ describe 'Self-Monitoring project requests' do
login_as(admin) login_as(admin)
end end
context 'with feature flag disabled' do context 'when the self monitoring project is being created' do
it_behaves_like 'not accessible if feature flag is disabled'
end
context 'with feature flag enabled' do
it_behaves_like 'handles invalid job_id' it_behaves_like 'handles invalid job_id'
context 'when job is in progress' do context 'when job is in progress' do
...@@ -129,11 +121,7 @@ describe 'Self-Monitoring project requests' do ...@@ -129,11 +121,7 @@ describe 'Self-Monitoring project requests' do
login_as(admin) login_as(admin)
end end
context 'with feature flag disabled' do context 'when the self monitoring project is deleted' do
it_behaves_like 'not accessible if feature flag is disabled'
end
context 'with feature flag enabled' do
let(:status_api) { status_delete_self_monitoring_project_admin_application_settings_path } let(:status_api) { status_delete_self_monitoring_project_admin_application_settings_path }
it_behaves_like 'triggers async worker, returns sidekiq job_id with response accepted' it_behaves_like 'triggers async worker, returns sidekiq job_id with response accepted'
...@@ -157,11 +145,7 @@ describe 'Self-Monitoring project requests' do ...@@ -157,11 +145,7 @@ describe 'Self-Monitoring project requests' do
login_as(admin) login_as(admin)
end end
context 'with feature flag disabled' do context 'when the self monitoring project is being deleted' do
it_behaves_like 'not accessible if feature flag is disabled'
end
context 'with feature flag enabled' do
it_behaves_like 'handles invalid job_id' it_behaves_like 'handles invalid job_id'
context 'when job is in progress' do context 'when job is in progress' do
......
# frozen_string_literal: true # frozen_string_literal: true
RSpec.shared_examples 'not accessible if feature flag is disabled' do
before do
stub_feature_flags(self_monitoring_project: false)
end
it 'returns not_implemented' do
subject
aggregate_failures do
expect(response).to have_gitlab_http_status(:not_implemented)
expect(json_response).to eq(
'message' => _('Self-monitoring is not enabled on this GitLab server, contact your administrator.'),
'documentation_url' => help_page_path('administration/monitoring/gitlab_self_monitoring_project/index')
)
end
end
end
RSpec.shared_examples 'not accessible to non-admin users' do RSpec.shared_examples 'not accessible to non-admin users' do
context 'with unauthenticated user' do context 'with unauthenticated user' do
it 'redirects to signin page' do it 'redirects to signin page' 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