summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Koller <mkoller@gitlab.com>2019-05-23 16:45:39 +0200
committerMarkus Koller <mkoller@gitlab.com>2019-05-24 17:17:14 +0200
commit1b1a960bf3e86d946f24ecb5de5b2f011c0d3846 (patch)
tree80ab4e6614106be8214be2a00b3b2c7f3dfb517b
parentc0ea4164cdc21e831fbbfa9dee48a6fa2766d9fc (diff)
downloadgitlab-ce-chore/remove-circuit-breaker-api.tar.gz
Remove the circuit breaker APIchore/remove-circuit-breaker-api
The circuit breaker itself was removed in 11.5, this removes the corresponding API endpoints which returned empty data since then.
-rw-r--r--changelogs/unreleased/chore-remove-circuit-breaker-api.yml5
-rw-r--r--doc/api/repository_storage_health.md5
-rw-r--r--lib/api/api.rb1
-rw-r--r--lib/api/circuit_breakers.rb39
-rw-r--r--spec/requests/api/circuit_breakers_spec.rb46
5 files changed, 5 insertions, 91 deletions
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