Commit a18b7e7e authored by Nick Thomas's avatar Nick Thomas

Merge branch '62091-remove-time-windows-flag' into 'master'

Remove metrics_time_window feature flag

Closes #62091

See merge request gitlab-org/gitlab-ce!28670
parents d842d80e 3f5447db
...@@ -106,10 +106,6 @@ export default { ...@@ -106,10 +106,6 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
showTimeWindowDropdown: {
type: Boolean,
required: true,
},
customMetricsAvailable: { customMetricsAvailable: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -248,7 +244,7 @@ export default { ...@@ -248,7 +244,7 @@ export default {
> >
</gl-dropdown> </gl-dropdown>
</div> </div>
<div v-if="showTimeWindowDropdown" class="d-flex align-items-center prepend-left-8"> <div class="d-flex align-items-center prepend-left-8">
<strong>{{ s__('Metrics|Show last') }}</strong> <strong>{{ s__('Metrics|Show last') }}</strong>
<gl-dropdown <gl-dropdown
class="prepend-left-10 js-time-window-dropdown" class="prepend-left-10 js-time-window-dropdown"
......
...@@ -16,7 +16,6 @@ export default (props = {}) => { ...@@ -16,7 +16,6 @@ export default (props = {}) => {
props: { props: {
...el.dataset, ...el.dataset,
hasMetrics: parseBoolean(el.dataset.hasMetrics), hasMetrics: parseBoolean(el.dataset.hasMetrics),
showTimeWindowDropdown: gon.features.metricsTimeWindow,
...props, ...props,
}, },
}); });
......
...@@ -12,9 +12,6 @@ class Clusters::ClustersController < Clusters::BaseController ...@@ -12,9 +12,6 @@ class Clusters::ClustersController < Clusters::BaseController
before_action :authorize_update_cluster!, only: [:update] before_action :authorize_update_cluster!, only: [:update]
before_action :authorize_admin_cluster!, only: [:destroy] before_action :authorize_admin_cluster!, only: [:destroy]
before_action :update_applications_status, only: [:cluster_status] before_action :update_applications_status, only: [:cluster_status]
before_action only: [:show] do
push_frontend_feature_flag(:metrics_time_window)
end
helper_method :token_in_session helper_method :token_in_session
......
...@@ -11,7 +11,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -11,7 +11,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
before_action :verify_api_request!, only: :terminal_websocket_authorize before_action :verify_api_request!, only: :terminal_websocket_authorize
before_action :expire_etag_cache, only: [:index] before_action :expire_etag_cache, only: [:index]
before_action only: [:metrics, :additional_metrics, :metrics_dashboard] do before_action only: [:metrics, :additional_metrics, :metrics_dashboard] do
push_frontend_feature_flag(:metrics_time_window)
push_frontend_feature_flag(:environment_metrics_use_prometheus_endpoint) push_frontend_feature_flag(:environment_metrics_use_prometheus_endpoint)
push_frontend_feature_flag(:environment_metrics_show_multiple_dashboards) push_frontend_feature_flag(:environment_metrics_show_multiple_dashboards)
push_frontend_feature_flag(:grafana_dashboard_link) push_frontend_feature_flag(:grafana_dashboard_link)
...@@ -221,8 +220,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -221,8 +220,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end end
def metrics_params def metrics_params
return unless Feature.enabled?(:metrics_time_window, project)
params.require([:start, :end]) params.require([:start, :end])
end end
......
---
title: Allow users to specify a time range on metrics dashboard
merge_request: 28670
author:
type: added
...@@ -433,20 +433,6 @@ describe Projects::EnvironmentsController do ...@@ -433,20 +433,6 @@ describe Projects::EnvironmentsController do
end end
context 'when only one time param is provided' do context 'when only one time param is provided' do
context 'when :metrics_time_window feature flag is disabled' do
before do
stub_feature_flags(metrics_time_window: false)
expect(environment).to receive(:additional_metrics).with(no_args).and_return(nil)
end
it 'returns a time-window agnostic response' do
additional_metrics(start: '1552647300.651094')
expect(response).to have_gitlab_http_status(204)
expect(json_response).to eq({})
end
end
it 'raises an error when start is missing' do it 'raises an error when start is missing' do
expect { additional_metrics(end: '1552647300.651094') } expect { additional_metrics(end: '1552647300.651094') }
.to raise_error(ActionController::ParameterMissing) .to raise_error(ActionController::ParameterMissing)
......
...@@ -68,7 +68,7 @@ describe('Dashboard', () => { ...@@ -68,7 +68,7 @@ describe('Dashboard', () => {
it('shows a getting started empty state when no metrics are present', () => { it('shows a getting started empty state when no metrics are present', () => {
component = new DashboardComponent({ component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'), el: document.querySelector('.prometheus-graphs'),
propsData: { ...propsData, showTimeWindowDropdown: false }, propsData: { ...propsData },
store, store,
}); });
...@@ -85,7 +85,7 @@ describe('Dashboard', () => { ...@@ -85,7 +85,7 @@ describe('Dashboard', () => {
it('shows up a loading state', done => { it('shows up a loading state', done => {
component = new DashboardComponent({ component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'), el: document.querySelector('.prometheus-graphs'),
propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: false }, propsData: { ...propsData, hasMetrics: true },
store, store,
}); });
...@@ -102,7 +102,6 @@ describe('Dashboard', () => { ...@@ -102,7 +102,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showLegend: false, showLegend: false,
showTimeWindowDropdown: false,
}, },
store, store,
}); });
...@@ -122,7 +121,6 @@ describe('Dashboard', () => { ...@@ -122,7 +121,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
showTimeWindowDropdown: false,
}, },
store, store,
}); });
...@@ -142,7 +140,6 @@ describe('Dashboard', () => { ...@@ -142,7 +140,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
showTimeWindowDropdown: false,
}, },
store, store,
}); });
...@@ -173,7 +170,6 @@ describe('Dashboard', () => { ...@@ -173,7 +170,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
showTimeWindowDropdown: false,
}, },
store, store,
}); });
...@@ -203,7 +199,6 @@ describe('Dashboard', () => { ...@@ -203,7 +199,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
showTimeWindowDropdown: false,
}, },
store, store,
}); });
...@@ -237,7 +232,6 @@ describe('Dashboard', () => { ...@@ -237,7 +232,6 @@ describe('Dashboard', () => {
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
environmentsEndpoint: '', environmentsEndpoint: '',
showTimeWindowDropdown: false,
}, },
store, store,
}); });
...@@ -250,27 +244,6 @@ describe('Dashboard', () => { ...@@ -250,27 +244,6 @@ describe('Dashboard', () => {
}); });
}); });
it('does not show the time window dropdown when the feature flag is not set', done => {
component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
propsData: {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: false,
},
store,
});
setTimeout(() => {
const timeWindowDropdown = component.$el.querySelector('.js-time-window-dropdown');
expect(timeWindowDropdown).toBeNull();
done();
});
});
it('renders the time window dropdown with a set of options', done => { it('renders the time window dropdown with a set of options', done => {
component = new DashboardComponent({ component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'), el: document.querySelector('.prometheus-graphs'),
...@@ -278,7 +251,6 @@ describe('Dashboard', () => { ...@@ -278,7 +251,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
showTimeWindowDropdown: true,
}, },
store, store,
}); });
...@@ -304,7 +276,6 @@ describe('Dashboard', () => { ...@@ -304,7 +276,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
showTimeWindowDropdown: true,
}, },
store, store,
}); });
...@@ -338,7 +309,7 @@ describe('Dashboard', () => { ...@@ -338,7 +309,7 @@ describe('Dashboard', () => {
component = new DashboardComponent({ component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'), el: document.querySelector('.prometheus-graphs'),
propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: true }, propsData: { ...propsData, hasMetrics: true },
store, store,
}); });
...@@ -359,7 +330,7 @@ describe('Dashboard', () => { ...@@ -359,7 +330,7 @@ describe('Dashboard', () => {
component = new DashboardComponent({ component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'), el: document.querySelector('.prometheus-graphs'),
propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: true }, propsData: { ...propsData, hasMetrics: true },
store, store,
}); });
...@@ -388,7 +359,6 @@ describe('Dashboard', () => { ...@@ -388,7 +359,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
showTimeWindowDropdown: false,
}, },
store, store,
}); });
...@@ -424,7 +394,6 @@ describe('Dashboard', () => { ...@@ -424,7 +394,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
showTimeWindowDropdown: false,
externalDashboardUrl: '/mockUrl', externalDashboardUrl: '/mockUrl',
}, },
store, store,
...@@ -450,7 +419,6 @@ describe('Dashboard', () => { ...@@ -450,7 +419,6 @@ describe('Dashboard', () => {
...propsData, ...propsData,
hasMetrics: true, hasMetrics: true,
showPanels: false, showPanels: false,
showTimeWindowDropdown: false,
externalDashboardUrl: '', externalDashboardUrl: '',
}, },
store, store,
......
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