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
use :pagination
end
get 'deploy_tokens' do
service_unavailable! unless Feature.enabled?(:deploy_tokens_api, default_enabled: true)
authenticated_as_admin!
present paginate(DeployToken.all), with: Entities::DeployToken
......@@ -39,10 +37,6 @@ module API
requires :id, type: String, desc: 'The ID of a project'
end
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
use :pagination
end
......@@ -102,10 +96,6 @@ module API
requires :id, type: String, desc: 'The ID of a group'
end
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
use :pagination
end
......
......@@ -10,24 +10,12 @@ RSpec.describe API::DeployTokens do
let!(:deploy_token) { create(:deploy_token, projects: [project]) }
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
subject do
get api('/deploy_tokens', user)
response
end
it_behaves_like 'with feature flag disabled'
context 'when unauthenticated' do
let(:user) { nil }
......@@ -81,8 +69,6 @@ RSpec.describe API::DeployTokens do
project.add_maintainer(user)
end
it_behaves_like 'with feature flag disabled'
it { is_expected.to have_gitlab_http_status(:ok) }
it 'returns all deploy tokens for the project' do
......@@ -128,8 +114,6 @@ RSpec.describe API::DeployTokens do
group.add_maintainer(user)
end
it_behaves_like 'with feature flag disabled'
it { is_expected.to have_gitlab_http_status(:ok) }
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