Skip to content

Commit

Permalink
Revert "Remove VVA service tile from monitor application (#154)"
Browse files Browse the repository at this point in the history
This reverts commit ba9d049.
  • Loading branch information
ThorntonMatthew authored Jul 18, 2024
1 parent ba9d049 commit 2318811
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@

# Ignore bundle gems and assets
vendor/*
public/*

Makefile
public/*
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ end

group :production do
gem 'connect_vbms', git: "https://github.com/department-of-veterans-affairs/connect_vbms.git", branch: 'master'
gem 'connect_vva', git: "https://github.com/department-of-veterans-affairs/connect_vva.git", branch: 'master'
gem 'bgs', git: "https://github.com/department-of-veterans-affairs/ruby-bgs.git", branch: 'master'
gem 'activerecord-oracle_enhanced-adapter', '~> 5.2.0'
gem 'ruby-oci8'
Expand Down
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ GIT
xmldsig (~> 0.3.1)
xmlenc

GIT
remote: https://github.com/department-of-veterans-affairs/connect_vva.git
revision: dfd1aeb2605c1f237f520bcdc41b059202e8944d
branch: master
specs:
connect_vva (0.1)
savon (~> 2.11, >= 2.11.0)

GIT
remote: https://github.com/department-of-veterans-affairs/ruby-bgs.git
revision: 98547485d863f2f0d3bb9a1b9ec92a8fe21ba306
Expand Down Expand Up @@ -294,6 +302,7 @@ DEPENDENCIES
caseflow!
coffee-rails (~> 4.2, >= 4.2.1)
connect_vbms!
connect_vva!
dogapi
dotenv-rails (>= 2.1.2)
jbuilder (~> 2.5)
Expand Down
2 changes: 2 additions & 0 deletions app/jobs/monitor_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def setup_services
Fakes::BGSVeteranService,
Fakes::VacolsService,
Fakes::VBMSServiceFindDocumentVersionReference,
Fakes::VVAService,
Fakes::LaggyService,
Fakes::UnreliableService,
Fakes::AlwaysDownService,
Expand All @@ -73,6 +74,7 @@ def setup_services
BGSVeteranService,
VacolsService,
VBMSServiceFindDocumentVersionReference,
VVAService,
TraceRouteService
]
end
Expand Down
51 changes: 51 additions & 0 deletions app/services/vva_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
require "vva"

class VVAService < MonitorService
@@service_name = "VVA"

def initialize

@client = init_client

@name = @@service_name
@service = "DocumentList"
@env = ENV['VVA_ENV']
@api = "GetDocumentList"
super
end

def query_service
# All failures in the call to get_by_claim_number (invalid login credentials, file number too short)
# should raise a VVA::SOAPError. If the call to get_by_claim_number succeeds then @pass will be true,
# even if there are no documents.

# Use ENV variable directly here instead of Rails.application.secrets because ERB.new() is converting input numbers
# with leading zeroes to integers and changing their value as a result. Our current production VVA_FILE_NUM starts
# with a zero, so VVA status checks were failing.
#
# Reference: https://github.com/rails/rails/blob/5-2-stable/railties/lib/rails/secrets.rb#L29
# Example failure: YAML.load(ERB.new("example: 012345").result) # => {"example"=>5349}
@client.document_list.get_by_claim_number(ENV["VVA_FILE_NUM"])
@pass = true
end


def self.service_name
@@service_name
end

def self.prevalidate
return ENV.key?("VVA_WSDL")
end

private

def init_client
VVA::Services.new(
wsdl: ENV['VVA_WSDL'],
username: ENV["VVA_USERNAME"],
password: ENV["VVA_PASSWORD"],
forward_proxy_url: ENV["CONNECT_VVA_PROXY_BASE_URL"]
)
end
end
23 changes: 23 additions & 0 deletions lib/fakes/vva_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class Fakes::VVAService < MonitorService
@@service_name = "VVA"

def initialize
@name = @@service_name
@service = "DocumentList"
@env = "dev"
@api = "GetDocumentList"
super
end

def self.service_name
@@service_name
end

def query_service
@pass = true
end

def self.prevalidate
true
end
end

0 comments on commit 2318811

Please sign in to comment.