Commit d4dd2606 authored by Mark Chao's avatar Mark Chao

Merge branch 'remove_deploy_token_api_feature_flag' into 'master'

Remove deploy_tokens_api feature flag

See merge request gitlab-org/gitlab!52950
parents 48de6d11 71f77182
---
name: deploy_tokens_api
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25219
rollout_issue_url:
milestone: '12.9'
type: development
group: group::package
default_enabled: true
...@@ -28,8 +28,6 @@ module API ...@@ -28,8 +28,6 @@ module API
use :pagination use :pagination
end end
get 'deploy_tokens' do get 'deploy_tokens' do
service_unavailable! unless Feature.enabled?(:deploy_tokens_api, default_enabled: true)
authenticated_as_admin! authenticated_as_admin!
present paginate(DeployToken.all), with: Entities::DeployToken present paginate(DeployToken.all), with: Entities::DeployToken
...@@ -39,10 +37,6 @@ module API ...@@ -39,10 +37,6 @@ module API
requires :id, type: String, desc: 'The ID of a project' requires :id, type: String, desc: 'The ID of a project'
end end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
before do
service_unavailable! unless Feature.enabled?(:deploy_tokens_api, user_project, default_enabled: true)
end
params do params do
use :pagination use :pagination
end end
...@@ -102,10 +96,6 @@ module API ...@@ -102,10 +96,6 @@ module API
requires :id, type: String, desc: 'The ID of a group' requires :id, type: String, desc: 'The ID of a group'
end end
resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
before do
service_unavailable! unless Feature.enabled?(:deploy_tokens_api, user_group, default_enabled: true)
end
params do params do
use :pagination use :pagination
end end
......
...@@ -10,24 +10,12 @@ RSpec.describe API::DeployTokens do ...@@ -10,24 +10,12 @@ RSpec.describe API::DeployTokens do
let!(:deploy_token) { create(:deploy_token, projects: [project]) } let!(:deploy_token) { create(:deploy_token, projects: [project]) }
let!(:group_deploy_token) { create(:deploy_token, :group, groups: [group]) } let!(:group_deploy_token) { create(:deploy_token, :group, groups: [group]) }
shared_examples 'with feature flag disabled' do
context 'disabled feature flag' do
before do
stub_feature_flags(deploy_tokens_api: false)
end
it { is_expected.to have_gitlab_http_status(:service_unavailable) }
end
end
describe 'GET /deploy_tokens' do describe 'GET /deploy_tokens' do
subject do subject do
get api('/deploy_tokens', user) get api('/deploy_tokens', user)
response response
end end
it_behaves_like 'with feature flag disabled'
context 'when unauthenticated' do context 'when unauthenticated' do
let(:user) { nil } let(:user) { nil }
...@@ -81,8 +69,6 @@ RSpec.describe API::DeployTokens do ...@@ -81,8 +69,6 @@ RSpec.describe API::DeployTokens do
project.add_maintainer(user) project.add_maintainer(user)
end end
it_behaves_like 'with feature flag disabled'
it { is_expected.to have_gitlab_http_status(:ok) } it { is_expected.to have_gitlab_http_status(:ok) }
it 'returns all deploy tokens for the project' do it 'returns all deploy tokens for the project' do
...@@ -128,8 +114,6 @@ RSpec.describe API::DeployTokens do ...@@ -128,8 +114,6 @@ RSpec.describe API::DeployTokens do
group.add_maintainer(user) group.add_maintainer(user)
end end
it_behaves_like 'with feature flag disabled'
it { is_expected.to have_gitlab_http_status(:ok) } it { is_expected.to have_gitlab_http_status(:ok) }
it 'returns all deploy tokens for the group' do it 'returns all deploy tokens for the group' 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