From 1b1a960bf3e86d946f24ecb5de5b2f011c0d3846 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Thu, 23 May 2019 16:45:39 +0200 Subject: [PATCH] Remove the circuit breaker API The circuit breaker itself was removed in 11.5, this removes the corresponding API endpoints which returned empty data since then. --- .../chore-remove-circuit-breaker-api.yml | 5 ++ doc/api/repository_storage_health.md | 5 -- lib/api/api.rb | 1 - lib/api/circuit_breakers.rb | 39 ---------------- spec/requests/api/circuit_breakers_spec.rb | 46 ------------------- 5 files changed, 5 insertions(+), 91 deletions(-) create mode 100644 changelogs/unreleased/chore-remove-circuit-breaker-api.yml delete mode 100644 doc/api/repository_storage_health.md delete mode 100644 lib/api/circuit_breakers.rb delete mode 100644 spec/requests/api/circuit_breakers_spec.rb 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 00000000000..f9532be04c8 --- /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 edf4b04acea..00000000000 --- 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 f4a96b9711b..20f8c637274 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 da756daadcc..00000000000 --- 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 6c7cb151c74..00000000000 --- 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 -- GitLab