Commit 95356c57 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo Committed by Brandon Labuschagne

Remove the multiple value streams feature flag

Removes the value_stream_analytics_create_multiple_value_streams
feature flag
parent f6f171cb
...@@ -316,15 +316,6 @@ To delete a custom value stream: ...@@ -316,15 +316,6 @@ To delete a custom value stream:
![Delete value stream](img/delete_value_stream_v13.4.png "Deleting a custom value stream") ![Delete value stream](img/delete_value_stream_v13.4.png "Deleting a custom value stream")
### Disabling custom value streams
Custom value streams are enabled by default. If you have a self-managed instance, an
administrator can open a Rails console and disable them with the following command:
```ruby
Feature.disable(:value_stream_analytics_create_multiple_value_streams)
```
## Days to completion chart ## Days to completion chart
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21631) in GitLab 12.6. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21631) in GitLab 12.6.
......
...@@ -96,9 +96,7 @@ export default { ...@@ -96,9 +96,7 @@ export default {
return this.featureFlags.hasPathNavigation && !this.hasNoAccessError && this.selectedStage; return this.featureFlags.hasPathNavigation && !this.hasNoAccessError && this.selectedStage;
}, },
shouldDisplayCreateMultipleValueStreams() { shouldDisplayCreateMultipleValueStreams() {
return Boolean( return Boolean(!this.shouldRenderEmptyState && !this.isLoadingValueStreams);
this.featureFlags.hasCreateMultipleValueStreams && !this.isLoadingValueStreams,
);
}, },
hasDateRangeSet() { hasDateRangeSet() {
return this.startDate && this.endDate; return this.startDate && this.endDate;
......
...@@ -22,7 +22,6 @@ export default () => { ...@@ -22,7 +22,6 @@ export default () => {
const { const {
cycleAnalyticsScatterplotEnabled: hasDurationChart = false, cycleAnalyticsScatterplotEnabled: hasDurationChart = false,
valueStreamAnalyticsPathNavigation: hasPathNavigation = false, valueStreamAnalyticsPathNavigation: hasPathNavigation = false,
valueStreamAnalyticsCreateMultipleValueStreams: hasCreateMultipleValueStreams = false,
valueStreamAnalyticsExtendedForm: hasExtendedFormFields = false, valueStreamAnalyticsExtendedForm: hasExtendedFormFields = false,
} = gon?.features; } = gon?.features;
...@@ -42,7 +41,6 @@ export default () => { ...@@ -42,7 +41,6 @@ export default () => {
featureFlags: { featureFlags: {
hasDurationChart, hasDurationChart,
hasPathNavigation, hasPathNavigation,
hasCreateMultipleValueStreams,
hasExtendedFormFields, hasExtendedFormFields,
}, },
}); });
......
...@@ -154,6 +154,7 @@ export const receiveGroupStagesError = ({ commit }, error) => { ...@@ -154,6 +154,7 @@ export const receiveGroupStagesError = ({ commit }, error) => {
export const setDefaultSelectedStage = ({ dispatch, getters }) => { export const setDefaultSelectedStage = ({ dispatch, getters }) => {
const { activeStages = [] } = getters; const { activeStages = [] } = getters;
if (activeStages?.length) { if (activeStages?.length) {
const [firstActiveStage] = activeStages; const [firstActiveStage] = activeStages;
return Promise.all([ return Promise.all([
...@@ -168,6 +169,7 @@ export const setDefaultSelectedStage = ({ dispatch, getters }) => { ...@@ -168,6 +169,7 @@ export const setDefaultSelectedStage = ({ dispatch, getters }) => {
export const receiveGroupStagesSuccess = ({ commit, dispatch }, stages) => { export const receiveGroupStagesSuccess = ({ commit, dispatch }, stages) => {
commit(types.RECEIVE_GROUP_STAGES_SUCCESS, stages); commit(types.RECEIVE_GROUP_STAGES_SUCCESS, stages);
return dispatch('setDefaultSelectedStage'); return dispatch('setDefaultSelectedStage');
}; };
...@@ -389,26 +391,20 @@ export const receiveValueStreamsSuccess = ( ...@@ -389,26 +391,20 @@ export const receiveValueStreamsSuccess = (
return dispatch(FETCH_VALUE_STREAM_DATA); return dispatch(FETCH_VALUE_STREAM_DATA);
}; };
export const fetchValueStreams = ({ commit, dispatch, getters, state }) => { export const fetchValueStreams = ({ commit, dispatch, getters }) => {
const {
featureFlags: { hasCreateMultipleValueStreams = false },
} = state;
const { currentGroupPath } = getters; const { currentGroupPath } = getters;
if (hasCreateMultipleValueStreams) { commit(types.REQUEST_VALUE_STREAMS);
commit(types.REQUEST_VALUE_STREAMS);
return Api.cycleAnalyticsValueStreams(currentGroupPath)
return Api.cycleAnalyticsValueStreams(currentGroupPath) .then(({ data }) => dispatch('receiveValueStreamsSuccess', data))
.then(({ data }) => dispatch('receiveValueStreamsSuccess', data)) .catch((error) => {
.catch((error) => { const {
const { response: { status },
response: { status }, } = error;
} = error; commit(types.RECEIVE_VALUE_STREAMS_ERROR, status);
commit(types.RECEIVE_VALUE_STREAMS_ERROR, status); throw error;
throw error; });
});
}
return dispatch(FETCH_VALUE_STREAM_DATA);
}; };
export const setFilters = ({ dispatch }) => { export const setFilters = ({ dispatch }) => {
......
...@@ -15,7 +15,6 @@ class Groups::Analytics::CycleAnalyticsController < Groups::Analytics::Applicati ...@@ -15,7 +15,6 @@ class Groups::Analytics::CycleAnalyticsController < Groups::Analytics::Applicati
before_action do before_action do
push_frontend_feature_flag(:cycle_analytics_scatterplot_enabled, default_enabled: true) push_frontend_feature_flag(:cycle_analytics_scatterplot_enabled, default_enabled: true)
push_frontend_feature_flag(:value_stream_analytics_path_navigation, @group) push_frontend_feature_flag(:value_stream_analytics_path_navigation, @group)
push_frontend_feature_flag(:value_stream_analytics_create_multiple_value_streams, default_enabled: true)
push_frontend_feature_flag(:value_stream_analytics_extended_form, @group) push_frontend_feature_flag(:value_stream_analytics_extended_form, @group)
render_403 unless can?(current_user, :read_group_cycle_analytics, @group) render_403 unless can?(current_user, :read_group_cycle_analytics, @group)
end end
......
---
name: value_stream_analytics_create_multiple_value_streams
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35822
rollout_issue_url:
milestone: '13.2'
type: development
group: group::analytics
default_enabled: true
...@@ -47,16 +47,4 @@ RSpec.describe 'Group value stream analytics' do ...@@ -47,16 +47,4 @@ RSpec.describe 'Group value stream analytics' do
expect(page).to have_pushed_frontend_feature_flags(valueStreamAnalyticsExtendedForm: false) expect(page).to have_pushed_frontend_feature_flags(valueStreamAnalyticsExtendedForm: false)
end end
end end
context 'when `value_stream_analytics_create_multiple_value_streams` is disabled for a group' do
before do
stub_feature_flags(value_stream_analytics_create_multiple_value_streams: false, thing: group)
end
it 'pushes disabled feature flag to the frontend' do
visit group_analytics_cycle_analytics_path(group)
expect(page).to have_pushed_frontend_feature_flags(valueStreamAnalyticsCreateMultipleValueStreams: false)
end
end
end end
...@@ -11,8 +11,6 @@ RSpec.describe 'Multiple value streams', :js do ...@@ -11,8 +11,6 @@ RSpec.describe 'Multiple value streams', :js do
end end
end end
stage_nav_selector = '.stage-nav'
duration_stage_selector = '.js-dropdown-stages'
value_stream_selector = '[data-testid="dropdown-value-streams"]' value_stream_selector = '[data-testid="dropdown-value-streams"]'
let(:value_stream_dropdown) { page.find(value_stream_selector) } let(:value_stream_dropdown) { page.find(value_stream_selector) }
...@@ -34,21 +32,6 @@ RSpec.describe 'Multiple value streams', :js do ...@@ -34,21 +32,6 @@ RSpec.describe 'Multiple value streams', :js do
sign_in(user) sign_in(user)
end end
# Adding this context as part of a fix for https://gitlab.com/gitlab-org/gitlab/-/issues/233439
# This can be removed when the feature flag is removed
context 'create multiple value streams disabled' do
before do
stub_feature_flags(value_stream_analytics_create_multiple_value_streams: false)
select_group
end
it 'displays the list of stages and duration chart' do
expect(page).to have_selector(stage_nav_selector, visible: true)
expect(page).to have_selector(duration_stage_selector, visible: true)
end
end
def toggle_value_stream_dropdown def toggle_value_stream_dropdown
value_stream_dropdown.click value_stream_dropdown.click
end end
......
...@@ -50,7 +50,6 @@ const defaultStubs = { ...@@ -50,7 +50,6 @@ const defaultStubs = {
const defaultFeatureFlags = { const defaultFeatureFlags = {
hasDurationChart: true, hasDurationChart: true,
hasPathNavigation: false, hasPathNavigation: false,
hasCreateMultipleValueStreams: false,
}; };
const [selectedValueStream] = mockData.valueStreams; const [selectedValueStream] = mockData.valueStreams;
...@@ -88,6 +87,9 @@ function mockRequiredRoutes(mockAdapter) { ...@@ -88,6 +87,9 @@ function mockRequiredRoutes(mockAdapter) {
.onGet(mockData.endpoints.durationData) .onGet(mockData.endpoints.durationData)
.reply(httpStatusCodes.OK, mockData.customizableStagesAndEvents.stages); .reply(httpStatusCodes.OK, mockData.customizableStagesAndEvents.stages);
mockAdapter.onGet(mockData.endpoints.stageMedian).reply(httpStatusCodes.OK, { value: null }); mockAdapter.onGet(mockData.endpoints.stageMedian).reply(httpStatusCodes.OK, { value: null });
mockAdapter
.onGet(mockData.endpoints.valueStreamData)
.reply(httpStatusCodes.OK, mockData.valueStreams);
} }
async function shouldMergeUrlParams(wrapper, result) { async function shouldMergeUrlParams(wrapper, result) {
...@@ -110,7 +112,6 @@ describe('Value Stream Analytics component', () => { ...@@ -110,7 +112,6 @@ describe('Value Stream Analytics component', () => {
}, },
shallow = true, shallow = true,
withStageSelected = false, withStageSelected = false,
withValueStreamSelected = true,
featureFlags = {}, featureFlags = {},
initialState = initialCycleAnalyticsState, initialState = initialCycleAnalyticsState,
props = {}, props = {},
...@@ -139,10 +140,6 @@ describe('Value Stream Analytics component', () => { ...@@ -139,10 +140,6 @@ describe('Value Stream Analytics component', () => {
...opts, ...opts,
}); });
if (withValueStreamSelected) {
await store.dispatch('receiveValueStreamsSuccess', mockData.valueStreams);
}
if (withStageSelected) { if (withStageSelected) {
await Promise.all([ await Promise.all([
store.dispatch('receiveGroupStagesSuccess', mockData.customizableStagesAndEvents.stages), store.dispatch('receiveGroupStagesSuccess', mockData.customizableStagesAndEvents.stages),
...@@ -316,7 +313,6 @@ describe('Value Stream Analytics component', () => { ...@@ -316,7 +313,6 @@ describe('Value Stream Analytics component', () => {
describe('enabled', () => { describe('enabled', () => {
beforeEach(async () => { beforeEach(async () => {
wrapper = await createComponent({ wrapper = await createComponent({
withValueStreamSelected: false,
withStageSelected: true, withStageSelected: true,
pathNavigationEnabled: true, pathNavigationEnabled: true,
}); });
...@@ -372,25 +368,8 @@ describe('Value Stream Analytics component', () => { ...@@ -372,25 +368,8 @@ describe('Value Stream Analytics component', () => {
); );
}); });
describe('hasCreateMultipleValueStreams = true', () => { it('displays the value stream select component', () => {
beforeEach(() => { displaysValueStreamSelect(true);
mock = new MockAdapter(axios);
mockRequiredRoutes(mock);
});
it('hides the value stream select component', () => {
displaysValueStreamSelect(false);
});
it('displays the value stream select component', async () => {
wrapper = await createComponent({
featureFlags: {
hasCreateMultipleValueStreams: true,
},
});
displaysValueStreamSelect(true);
});
}); });
it('displays the date range picker', () => { it('displays the date range picker', () => {
...@@ -480,7 +459,6 @@ describe('Value Stream Analytics component', () => { ...@@ -480,7 +459,6 @@ describe('Value Stream Analytics component', () => {
StageNavItem, StageNavItem,
}, },
}, },
withValueStreamSelected: false,
withStageSelected: true, withStageSelected: true,
}); });
}); });
......
...@@ -1020,7 +1020,6 @@ describe('Value Stream Analytics actions', () => { ...@@ -1020,7 +1020,6 @@ describe('Value Stream Analytics actions', () => {
currentGroup, currentGroup,
featureFlags: { featureFlags: {
...state.featureFlags, ...state.featureFlags,
hasCreateMultipleValueStreams: true,
}, },
}; };
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
...@@ -1102,21 +1101,6 @@ describe('Value Stream Analytics actions', () => { ...@@ -1102,21 +1101,6 @@ describe('Value Stream Analytics actions', () => {
); );
}); });
}); });
describe('with hasCreateMultipleValueStreams disabled', () => {
beforeEach(() => {
state = {
...state,
featureFlags: {
...state.featureFlags,
hasCreateMultipleValueStreams: false,
},
};
});
it(`will dispatch the 'fetchGroupStagesAndEvents' request`, () =>
testAction(actions.fetchValueStreams, null, state, [], [{ type: 'fetchValueStreamData' }]));
});
}); });
describe('fetchValueStreamData', () => { describe('fetchValueStreamData', () => {
...@@ -1127,7 +1111,6 @@ describe('Value Stream Analytics actions', () => { ...@@ -1127,7 +1111,6 @@ describe('Value Stream Analytics actions', () => {
currentGroup, currentGroup,
featureFlags: { featureFlags: {
...state.featureFlags, ...state.featureFlags,
hasCreateMultipleValueStreams: true,
}, },
}; };
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
......
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