Commit 7b3af19b authored by David Barr's avatar David Barr

Remove release_show_page feature flag

This feature flag was introduced in:

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23792

and enabled by default in:

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26502

It is now safe to remove.
parent fabb8afb
......@@ -13,9 +13,6 @@ export default () => {
modules: {
detail: createDetailModule(el.dataset),
},
featureFlags: {
releaseShowPage: Boolean(gon.features?.releaseShowPage),
},
});
return new Vue({
......
......@@ -13,9 +13,6 @@ export default () => {
modules: {
detail: createDetailModule(el.dataset),
},
featureFlags: {
releaseShowPage: Boolean(gon.features?.releaseShowPage),
},
});
return new Vue({
......
......@@ -68,9 +68,9 @@ export const removeAssetLink = ({ commit }, linkIdToRemove) => {
commit(types.REMOVE_ASSET_LINK, linkIdToRemove);
};
export const receiveSaveReleaseSuccess = ({ commit, state, rootState }, release) => {
export const receiveSaveReleaseSuccess = ({ commit }, release) => {
commit(types.RECEIVE_SAVE_RELEASE_SUCCESS);
redirectTo(rootState.featureFlags.releaseShowPage ? release._links.self : state.releasesPagePath);
redirectTo(release._links.self);
};
export const saveRelease = ({ commit, dispatch, getters }) => {
......
......@@ -8,7 +8,6 @@ class Projects::ReleasesController < Projects::ApplicationController
before_action do
push_frontend_feature_flag(:release_issue_summary, project, default_enabled: true)
push_frontend_feature_flag(:release_evidence_collection, project, default_enabled: true)
push_frontend_feature_flag(:release_show_page, project, default_enabled: true)
push_frontend_feature_flag(:release_asset_link_editing, project, default_enabled: true)
push_frontend_feature_flag(:release_asset_link_type, project, default_enabled: true)
push_frontend_feature_flag(:graphql_release_data, project, default_enabled: true)
......@@ -27,10 +26,6 @@ class Projects::ReleasesController < Projects::ApplicationController
end
end
def show
return render_404 unless Feature.enabled?(:release_show_page, project, default_enabled: true)
end
def new
unless Feature.enabled?(:new_release_page, project, default_enabled: true)
redirect_to(new_project_tag_path(@project))
......
......@@ -20,8 +20,6 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
end
def self_url
return unless ::Feature.enabled?(:release_show_page, project, default_enabled: true)
project_release_url(project, release)
end
......
......@@ -194,14 +194,6 @@ RSpec.describe Projects::ReleasesController do
end
end
context 'when feature flag `release_show_page` is disabled' do
before do
stub_feature_flags(release_show_page: false)
end
it_behaves_like 'not found'
end
context 'when release does not exist' do
let(:tag) { 'non-existent-tag' }
......
......@@ -11,11 +11,8 @@ RSpec.describe 'User creates release', :js do
let_it_be(:user) { create(:user) }
let(:new_page_url) { new_project_release_path(project) }
let(:show_feature_flag) { true }
before do
stub_feature_flags(release_show_page: show_feature_flag)
project.add_developer(user)
sign_in(user)
......@@ -75,14 +72,6 @@ RSpec.describe 'User creates release', :js do
expect(page).to have_current_path(project_release_path(project, release))
end
context 'when the release_show_page feature flag is disabled' do
let(:show_feature_flag) { false }
it 'redirects to the main "Releases" page' do
expect(page).to have_current_path(project_releases_path(project))
end
end
end
context 'when the "Cancel" button is clicked' do
......
......@@ -6,11 +6,8 @@ RSpec.describe 'User edits Release', :js do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:release) { create(:release, project: project, name: 'The first release' ) }
let_it_be(:user) { create(:user) }
let(:show_feature_flag) { true }
before do
stub_feature_flags(release_show_page: show_feature_flag)
project.add_developer(user)
sign_in(user)
......@@ -71,42 +68,24 @@ RSpec.describe 'User edits Release', :js do
expect(release.description).to eq('Updated Release notes')
end
context 'when the release_show_page feature flag is disabled' do
let(:show_feature_flag) { false }
it 'redirects to the main Releases page when "Cancel" is clicked' do
fill_out_form_and_click 'Cancel'
expect(page).to have_current_path(project_releases_path(project))
end
it 'redirects to the previous page when "Cancel" is clicked when the url includes a back_url query parameter' do
back_path = project_releases_path(project, params: { page: 2 })
visit edit_project_release_path(project, release, params: { back_url: back_path })
it 'redirects to the main Releases page when "Save changes" is clicked' do
fill_out_form_and_click 'Save changes'
fill_out_form_and_click 'Cancel'
expect(page).to have_current_path(project_releases_path(project))
end
expect(page).to have_current_path(back_path)
end
context 'when the release_show_page feature flag is enabled' do
it 'redirects to the previous page when "Cancel" is clicked when the url includes a back_url query parameter' do
back_path = project_releases_path(project, params: { page: 2 })
visit edit_project_release_path(project, release, params: { back_url: back_path })
fill_out_form_and_click 'Cancel'
expect(page).to have_current_path(back_path)
end
it 'redirects to the main Releases page when "Cancel" is clicked when the url does not include a back_url query parameter' do
fill_out_form_and_click 'Cancel'
it 'redirects to the main Releases page when "Cancel" is clicked when the url does not include a back_url query parameter' do
fill_out_form_and_click 'Cancel'
expect(page).to have_current_path(project_releases_path(project))
end
expect(page).to have_current_path(project_releases_path(project))
end
it 'redirects to the dedicated Release page when "Save changes" is clicked' do
fill_out_form_and_click 'Save changes'
it 'redirects to the dedicated Release page when "Save changes" is clicked' do
fill_out_form_and_click 'Save changes'
expect(page).to have_current_path(project_release_path(project, release))
end
expect(page).to have_current_path(project_release_path(project, release))
end
end
......@@ -276,32 +276,14 @@ describe('Release detail actions', () => {
describe('receiveSaveReleaseSuccess', () => {
it(`commits ${types.RECEIVE_SAVE_RELEASE_SUCCESS}`, () =>
testAction(actions.receiveSaveReleaseSuccess, undefined, { ...state, featureFlags: {} }, [
testAction(actions.receiveSaveReleaseSuccess, release, state, [
{ type: types.RECEIVE_SAVE_RELEASE_SUCCESS },
]));
describe('when the releaseShowPage feature flag is enabled', () => {
beforeEach(() => {
const rootState = { featureFlags: { releaseShowPage: true } };
actions.receiveSaveReleaseSuccess({ commit: jest.fn(), state, rootState }, release);
});
it("redirects to the release's dedicated page", () => {
expect(redirectTo).toHaveBeenCalledTimes(1);
expect(redirectTo).toHaveBeenCalledWith(release._links.self);
});
});
describe('when the releaseShowPage feature flag is disabled', () => {
beforeEach(() => {
const rootState = { featureFlags: { releaseShowPage: false } };
actions.receiveSaveReleaseSuccess({ commit: jest.fn(), state, rootState }, release);
});
it("redirects to the project's main Releases page", () => {
expect(redirectTo).toHaveBeenCalledTimes(1);
expect(redirectTo).toHaveBeenCalledWith(state.releasesPagePath);
});
it("redirects to the release's dedicated page", () => {
actions.receiveSaveReleaseSuccess({ commit: jest.fn(), state }, release);
expect(redirectTo).toHaveBeenCalledTimes(1);
expect(redirectTo).toHaveBeenCalledWith(release._links.self);
});
});
......
......@@ -57,14 +57,6 @@ RSpec.describe ReleasePresenter do
it 'returns its own url' do
is_expected.to match /#{project_release_url(project, release)}/
end
context 'when release_show_page feature flag is disabled' do
before do
stub_feature_flags(release_show_page: false)
end
it { is_expected.to be_nil }
end
end
describe '#merge_requests_url' 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