Skip to content

Commit

Permalink
API-34203: Remove Unused Appeals API Routes (#16226)
Browse files Browse the repository at this point in the history
* API-34203: Remove unused Appeals API routes

* API-34203: Remove specs for endpoints healthcheck routes that were removed

* API-34203: Add comments to routes to explain their purpose and reduce confusion

* API-34203: Update Appeals Status v1 specs to use the correct appeals-status endpoint
  • Loading branch information
kristen-brown authored Apr 10, 2024
1 parent 8b6ace6 commit 095e43f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
27 changes: 7 additions & 20 deletions modules/appeals_api/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
AppealsApi::Engine.routes.draw do
get '/appeals_status/metadata', to: 'metadata#appeals_status'
get '/decision_reviews/metadata', to: 'metadata#decision_reviews'
get '/v0/healthcheck', to: 'metadata#healthcheck'
get '/v1/healthcheck', to: 'metadata#healthcheck_s3'
get '/v2/healthcheck', to: 'metadata#healthcheck_s3'
get '/v1/appeals_healthcheck', to: 'metadata#healthcheck'
get '/v1/appeals_upstream_healthcheck', to: 'metadata#appeals_status_upstream_healthcheck'
get '/v0/upstream_healthcheck', to: 'metadata#appeals_status_upstream_healthcheck'
get '/v1/upstream_healthcheck', to: 'metadata#decision_reviews_upstream_healthcheck'
get '/v2/upstream_healthcheck', to: 'metadata#decision_reviews_upstream_healthcheck'
get '/v0/appeals', to: 'v0/appeals#index'
get '/v1/appeals', to: 'v1/appeals#index'
get '/v0/healthcheck', to: 'metadata#healthcheck' # Appeals Status v0
get '/v1/healthcheck', to: 'metadata#healthcheck_s3' # Decision Reviews v1
get '/v2/healthcheck', to: 'metadata#healthcheck_s3' # Decision Reviews v2
get '/v0/upstream_healthcheck', to: 'metadata#appeals_status_upstream_healthcheck' # Appeals Status v0
get '/v1/upstream_healthcheck', to: 'metadata#decision_reviews_upstream_healthcheck' # Decision Reviews v1
get '/v2/upstream_healthcheck', to: 'metadata#decision_reviews_upstream_healthcheck' # Decision Reviews v2
get '/v0/appeals', to: 'v0/appeals#index' # Appeals Status v0

namespace :v1, defaults: { format: 'json' } do
namespace :decision_reviews do
Expand Down Expand Up @@ -76,20 +73,10 @@
namespace :docs do
namespace :v0, defaults: { format: 'json' } do
resources :api, only: [:index]

# Routes below are deprecated - they can be removed once they are no longer used:
docs_controller = '/appeals_api/docs/v2/docs'
get 'hlr', to: "#{docs_controller}#hlr"
get 'nod', to: "#{docs_controller}#nod"
get 'sc', to: "#{docs_controller}#sc"
get 'ci', to: "#{docs_controller}#ci"
get 'la', to: "#{docs_controller}#la"
# ...end of deprecated routes
end

namespace :v1, defaults: { format: 'json' } do
get 'decision_reviews', to: 'docs#decision_reviews'
get 'appeals', to: 'docs#appeals_status'
end

namespace :v2, defaults: { format: 'json' } do
Expand Down
3 changes: 0 additions & 3 deletions modules/appeals_api/spec/requests/metadata_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@

context 'v1' do
it_behaves_like 'a healthcheck', '/services/appeals/v1/healthcheck'
it_behaves_like 'a healthcheck', '/services/appeals/v1/appeals_healthcheck'
end

context 'segmented APIs' do
Expand Down Expand Up @@ -210,8 +209,6 @@
end

context 'v1' do
it_behaves_like 'an upstream healthcheck (caseflow)', '/services/appeals/v1/appeals_upstream_healthcheck'

it 'checks the status of both services individually' do
VCR.use_cassette('caseflow/health-check') do
allow(CentralMail::Service).to receive(:current_breaker_outage?).and_return(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
include SchemaMatchers

describe '#index' do
let(:path) { '/services/appeals/v1/appeals' }
let(:path) { '/services/appeals/appeals-status/v1/appeals' }
let(:caseflow_cassette_name) { 'caseflow/appeals' }
let(:mpi_cassette_name) { 'mpi/find_candidate/valid' }
let(:va_user) { '[email protected]' }
Expand All @@ -20,7 +20,7 @@
'GET endpoint with optional Veteran ICN parameter',
{
cassette: 'caseflow/appeals',
path: '/services/appeals/v1/appeals',
path: '/services/appeals/appeals-status/v1/appeals',
scope_base: 'AppealsStatus',
headers: { 'X-VA-User' => '[email protected]' }
}
Expand Down

0 comments on commit 095e43f

Please sign in to comment.