Merge branch 'remove-releases_page-feature-flag' into 'master'
Remove `releases_page` feature flag Closes #56072 See merge request gitlab-org/gitlab-ce!24215
This commit is contained in:
commit
b682a6f898
8 changed files with 4 additions and 169 deletions
|
@ -4,16 +4,7 @@ class Projects::ReleasesController < Projects::ApplicationController
|
|||
# Authorize
|
||||
before_action :require_non_empty_project
|
||||
before_action :authorize_read_release!
|
||||
before_action :check_releases_page_feature_flag
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def check_releases_page_feature_flag
|
||||
return render_404 unless Feature.enabled?(:releases_page, @project)
|
||||
|
||||
push_frontend_feature_flag(:releases_page, @project)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
= link_to activity_project_path(@project), title: _('Activity'), class: 'shortcuts-project-activity' do
|
||||
%span= _('Activity')
|
||||
|
||||
- if project_nav_tab?(:releases) && Feature.enabled?(:releases_page, @project)
|
||||
- if project_nav_tab?(:releases)
|
||||
= nav_link(controller: :releases) do
|
||||
= link_to project_releases_path(@project), title: _('Releases'), class: 'shortcuts-project-releases' do
|
||||
%span= _('Releases')
|
||||
|
|
|
@ -8,8 +8,6 @@ module API
|
|||
RELEASE_ENDPOINT_REQUIREMETS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS
|
||||
.merge(tag_name: API::NO_SLASH_URL_PART_REGEX)
|
||||
|
||||
before { error!('404 Not Found', 404) unless Feature.enabled?(:releases_page, user_project) }
|
||||
|
||||
params do
|
||||
requires :id, type: String, desc: 'The ID of a project'
|
||||
end
|
||||
|
|
|
@ -7,7 +7,6 @@ module API
|
|||
RELEASE_ENDPOINT_REQUIREMETS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS
|
||||
.merge(tag_name: API::NO_SLASH_URL_PART_REGEX)
|
||||
|
||||
before { error!('404 Not Found', 404) unless Feature.enabled?(:releases_page, user_project) }
|
||||
before { authorize_read_releases! }
|
||||
|
||||
params do
|
||||
|
|
|
@ -6,10 +6,6 @@ describe Projects::ReleasesController do
|
|||
let!(:project) { create(:project, :repository, :public) }
|
||||
let!(:user) { create(:user) }
|
||||
|
||||
before do
|
||||
stub_feature_flags(releases_page: true)
|
||||
end
|
||||
|
||||
describe 'GET #index' do
|
||||
it 'renders a 200' do
|
||||
get_index
|
||||
|
@ -43,18 +39,6 @@ describe Projects::ReleasesController do
|
|||
expect(response.status).to eq(404)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when releases_page feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it 'renders a 404' do
|
||||
get_index
|
||||
|
||||
expect(response.status).to eq(404)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -74,16 +74,6 @@ describe API::Release::Links do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it_behaves_like '404 response' do
|
||||
let(:request) { get api("/projects/#{project.id}/releases/v0.1/assets/links", maintainer) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET /projects/:id/releases/:tag_name/assets/links/:link_id' do
|
||||
|
@ -129,16 +119,6 @@ describe API::Release::Links do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it_behaves_like '404 response' do
|
||||
let(:request) { get api("/projects/#{project.id}/releases/non_existing_tag/assets/links/#{release_link.id}", maintainer) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST /projects/:id/releases/:tag_name/assets/links' do
|
||||
|
@ -231,19 +211,6 @@ describe API::Release::Links do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it_behaves_like '404 response' do
|
||||
let(:request) do
|
||||
post api("/projects/#{project.id}/releases/v0.1/assets/links", maintainer),
|
||||
params: params
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'PUT /projects/:id/releases/:tag_name/assets/links/:link_id' do
|
||||
|
@ -328,19 +295,6 @@ describe API::Release::Links do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it_behaves_like '404 response' do
|
||||
let(:request) do
|
||||
put api("/projects/#{project.id}/releases/v0.1/assets/links/#{release_link.id}", maintainer),
|
||||
params: params
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'DELETE /projects/:id/releases/:tag_name/assets/links/:link_id' do
|
||||
|
@ -401,17 +355,5 @@ describe API::Release::Links do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it_behaves_like '404 response' do
|
||||
let(:request) do
|
||||
delete api("/projects/#{project.id}/releases/v0.1/assets/links/#{release_link.id}", maintainer)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -83,18 +83,6 @@ describe API::Releases do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it 'cannot find the API' do
|
||||
get api("/projects/#{project.id}/releases", maintainer)
|
||||
|
||||
expect(response).to have_gitlab_http_status(:not_found)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET /projects/:id/releases/:tag_name' do
|
||||
|
@ -205,18 +193,6 @@ describe API::Releases do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it 'cannot find the API' do
|
||||
get api("/projects/#{project.id}/releases/v0.1", maintainer)
|
||||
|
||||
expect(response).to have_gitlab_http_status(:not_found)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST /projects/:id/releases' do
|
||||
|
@ -458,18 +434,6 @@ describe API::Releases do
|
|||
expect(response).to have_gitlab_http_status(:conflict)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it 'cannot find the API' do
|
||||
post api("/projects/#{project.id}/releases", maintainer), params: params
|
||||
|
||||
expect(response).to have_gitlab_http_status(:not_found)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'PUT /projects/:id/releases/:tag_name' do
|
||||
|
@ -565,19 +529,6 @@ describe API::Releases do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it 'cannot find the API' do
|
||||
put api("/projects/#{project.id}/releases/v0.1", non_project_member),
|
||||
params: params
|
||||
|
||||
expect(response).to have_gitlab_http_status(:not_found)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'DELETE /projects/:id/releases/:tag_name' do
|
||||
|
@ -648,17 +599,5 @@ describe API::Releases do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
|
||||
it 'cannot find the API' do
|
||||
delete api("/projects/#{project.id}/releases/v0.1", non_project_member)
|
||||
|
||||
expect(response).to have_gitlab_http_status(:not_found)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,28 +51,10 @@ describe 'layouts/nav/sidebar/_project' do
|
|||
end
|
||||
|
||||
describe 'releases entry' do
|
||||
describe 'when releases feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: false)
|
||||
end
|
||||
it 'renders releases link' do
|
||||
render
|
||||
|
||||
it 'does not render releases link' do
|
||||
render
|
||||
|
||||
expect(rendered).not_to have_link('Releases', href: project_releases_path(project))
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when releases feature flags is enabled' do
|
||||
before do
|
||||
stub_feature_flags(releases_page: true)
|
||||
end
|
||||
|
||||
it 'renders releases link' do
|
||||
render
|
||||
|
||||
expect(rendered).to have_link('Releases', href: project_releases_path(project))
|
||||
end
|
||||
expect(rendered).to have_link('Releases', href: project_releases_path(project))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue