Commit e6e97c19 authored by Tristan Read's avatar Tristan Read Committed by James Lopez

Remove grafana integration feature flag

parent 98d75c2e
...@@ -6,8 +6,6 @@ import initSettingsPanels from '~/settings_panels'; ...@@ -6,8 +6,6 @@ import initSettingsPanels from '~/settings_panels';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
mountErrorTrackingForm(); mountErrorTrackingForm();
mountOperationSettings(); mountOperationSettings();
if (gon.features.gfmGrafanaIntegration) { mountGrafanaIntegration();
mountGrafanaIntegration();
}
initSettingsPanels(); initSettingsPanels();
}); });
...@@ -4,8 +4,6 @@ class Projects::GrafanaApiController < Projects::ApplicationController ...@@ -4,8 +4,6 @@ class Projects::GrafanaApiController < Projects::ApplicationController
include RenderServiceResults include RenderServiceResults
include MetricsDashboard include MetricsDashboard
before_action :validate_feature_enabled!, only: [:metrics_dashboard]
def proxy def proxy
result = ::Grafana::ProxyService.new( result = ::Grafana::ProxyService.new(
project, project,
...@@ -26,10 +24,6 @@ class Projects::GrafanaApiController < Projects::ApplicationController ...@@ -26,10 +24,6 @@ class Projects::GrafanaApiController < Projects::ApplicationController
params.permit(:embedded, :grafana_url) params.permit(:embedded, :grafana_url)
end end
def validate_feature_enabled!
render_403 unless Feature.enabled?(:gfm_grafana_integration)
end
def query_params def query_params
params.permit(:query, :start, :end, :step) params.permit(:query, :start, :end, :step)
end end
......
---
title: Allow Grafana charts to be embedded in Gitlab Flavored Markdown
merge_request: 18486
author:
type: added
...@@ -18,8 +18,6 @@ module Banzai ...@@ -18,8 +18,6 @@ module Banzai
end end
def embed_params(node) def embed_params(node)
return unless Feature.enabled?(:gfm_grafana_integration)
query_params = Gitlab::Metrics::Dashboard::Url.parse_query(node['href']) query_params = Gitlab::Metrics::Dashboard::Url.parse_query(node['href'])
return unless [:panelId, :from, :to].all? do |param| return unless [:panelId, :from, :to].all? do |param|
query_params.include?(param) query_params.include?(param)
......
...@@ -42,9 +42,6 @@ module Gitlab ...@@ -42,9 +42,6 @@ module Gitlab
# Initialize gon.features with any flags that should be # Initialize gon.features with any flags that should be
# made globally available to the frontend # made globally available to the frontend
push_frontend_feature_flag(:suppress_ajax_navigation_errors, default_enabled: true) push_frontend_feature_flag(:suppress_ajax_navigation_errors, default_enabled: true)
# Flag controls a GFM feature used across many routes.
push_frontend_feature_flag(:gfm_grafana_integration)
end end
# Exposes the state of a feature flag to the frontend code. # Exposes the state of a feature flag to the frontend code.
......
...@@ -164,17 +164,5 @@ describe Projects::GrafanaApiController do ...@@ -164,17 +164,5 @@ describe Projects::GrafanaApiController do
it_behaves_like 'error response', :bad_request it_behaves_like 'error response', :bad_request
end end
end end
context 'when grafana embeds are not enabled' do
before do
stub_feature_flags(gfm_grafana_integration: false)
end
it 'returns 403 immediately' do
get :metrics_dashboard, params: params
expect(response).to have_gitlab_http_status(:forbidden)
end
end
end end
end end
...@@ -104,17 +104,7 @@ describe 'Projects > Settings > For a forked project', :js do ...@@ -104,17 +104,7 @@ describe 'Projects > Settings > For a forked project', :js do
end end
context 'grafana integration settings form' do context 'grafana integration settings form' do
it 'is not present when the feature flag is disabled' do it 'successfully fills and completes the form' do
stub_feature_flags(gfm_grafana_integration: false)
visit project_settings_operations_path(project)
wait_for_requests
expect(page).to have_no_css('.js-grafana-integration')
end
it 'is present when the feature flag is enabled' do
visit project_settings_operations_path(project) visit project_settings_operations_path(project)
wait_for_requests wait_for_requests
......
...@@ -18,16 +18,6 @@ describe Banzai::Filter::InlineGrafanaMetricsFilter do ...@@ -18,16 +18,6 @@ describe Banzai::Filter::InlineGrafanaMetricsFilter do
'&var-instance=All&panelId=14' '&var-instance=All&panelId=14'
end end
context 'when feature flag is disabled' do
before do
stub_feature_flags(gfm_grafana_integration: false)
end
it 'leaves the markdown unchanged' do
expect(unescape(doc.to_s)).to eq(input)
end
end
it 'appends a metrics charts placeholder with dashboard url after metrics links' do it 'appends a metrics charts placeholder with dashboard url after metrics links' do
node = doc.at_css('.js-render-metrics') node = doc.at_css('.js-render-metrics')
expect(node).to be_present expect(node).to be_present
......
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