diff --git a/changelogs/unreleased/chore-remove-circuit-breaker-api.yml b/changelogs/unreleased/chore-remove-circuit-breaker-api.yml new file mode 100644 index 0000000000000000000000000000000000000000..f9532be04c8349438b340bb19da24d4cd3d537be --- /dev/null +++ b/changelogs/unreleased/chore-remove-circuit-breaker-api.yml @@ -0,0 +1,5 @@ +--- +title: Remove the circuit breaker API +merge_request: 28669 +author: +type: removed diff --git a/doc/api/repository_storage_health.md b/doc/api/repository_storage_health.md deleted file mode 100644 index edf4b04acea6fdc4c2364243df797505d89314a4..0000000000000000000000000000000000000000 --- a/doc/api/repository_storage_health.md +++ /dev/null @@ -1,5 +0,0 @@ -# Circuitbreaker API - -NOTE: **Deprecated:** -Support of the circuit breaker is removed, as Gitaly can be configured to -to work without NFS and [communicate solely over HTTP](../administration/gitaly/index.md). diff --git a/lib/api/api.rb b/lib/api/api.rb index f4a96b9711bbbc2ff7b9e28e43bb8c667adb5439..20f8c6372740b0e58e9bf910af5d4aff89e857dd 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -98,7 +98,6 @@ module API mount ::API::Boards mount ::API::Branches mount ::API::BroadcastMessages - mount ::API::CircuitBreakers mount ::API::Commits mount ::API::CommitStatuses mount ::API::ContainerRegistry diff --git a/lib/api/circuit_breakers.rb b/lib/api/circuit_breakers.rb deleted file mode 100644 index da756daadcc43becd62b12b897633ea762786363..0000000000000000000000000000000000000000 --- a/lib/api/circuit_breakers.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -module API - class CircuitBreakers < Grape::API - before { authenticated_as_admin! } - - resource :circuit_breakers do - params do - requires :type, - type: String, - desc: "The type of circuitbreaker", - values: ['repository_storage'] - end - resource ':type' do - namespace '', requirements: { type: 'repository_storage' } do - desc 'Get all git storages' do - detail 'This feature was introduced in GitLab 9.5' - end - get do - present [] - end - - desc 'Get all failing git storages' do - detail 'This feature was introduced in GitLab 9.5' - end - get 'failing' do - present [] - end - - desc 'Reset all storage failures and open circuitbreaker' do - detail 'This feature was introduced in GitLab 9.5' - end - delete do - end - end - end - end - end -end diff --git a/spec/requests/api/circuit_breakers_spec.rb b/spec/requests/api/circuit_breakers_spec.rb deleted file mode 100644 index 6c7cb151c743674e8cad53f832e41a17c9c5e630..0000000000000000000000000000000000000000 --- a/spec/requests/api/circuit_breakers_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -require 'spec_helper' - -describe API::CircuitBreakers do - set(:user) { create(:user) } - set(:admin) { create(:admin) } - - describe 'GET circuit_breakers/repository_storage' do - it 'returns a 401 for anonymous users' do - get api('/circuit_breakers/repository_storage') - - expect(response).to have_gitlab_http_status(401) - end - - it 'returns a 403 for users' do - get api('/circuit_breakers/repository_storage', user) - - expect(response).to have_gitlab_http_status(403) - end - - it 'returns an Array of storages' do - get api('/circuit_breakers/repository_storage', admin) - - expect(response).to have_gitlab_http_status(200) - expect(json_response).to be_kind_of(Array) - expect(json_response).to be_empty - end - - describe 'GET circuit_breakers/repository_storage/failing' do - it 'returns an array of failing storages' do - get api('/circuit_breakers/repository_storage/failing', admin) - - expect(response).to have_gitlab_http_status(200) - expect(json_response).to be_kind_of(Array) - expect(json_response).to be_empty - end - end - end - - describe 'DELETE circuit_breakers/repository_storage' do - it 'clears all circuit_breakers' do - delete api('/circuit_breakers/repository_storage', admin) - - expect(response).to have_gitlab_http_status(204) - end - end -end