Skip to content

Commit

Permalink
Merging lastest changes from outside APPEALS-31792 (#21680)
Browse files Browse the repository at this point in the history
* added saftey opperator and removed outdated date check

* removed leftover method that was breaking and unused.

* removed legacy appeal date check for MST on special issue list

* updated mst and pact badges to check decisions in flight (if any) then appeal model.

* removed bypass for special issue list for pact toggle for AMA.

* updated rake and seed comments

* allowed special issues page tracking for AMA MST issues when pact is enabled

* remove code changes causing cancel to progress forward

* Update scheduled jobs key and move job to different folder

* Update job to set user manually and pass in updated_by

* moved method definition validate_claim_code into ClaimLabelChange class

* fixed spacing issue

* msteele/APPEALS-45182 Fix transcription_files relationships on Hearings/LegacyHearings (#21492)

* APPEALS-45182 Reinforce has_many relationships

* APPEALS-45182 Add missing comma

* Resolve lint issue

---------

Co-authored-by: Matthew Thornton <ThorntonMatthew@users.noreply.github.com>

* fixed linting error

* fixed linting issue

* draft pr

* Hotfix/APPEALS-45218 (#21503)

* APPEALS-45218 reverted webex config arguments

* APPEALS-45218 reverted webex config arguments

* APPEALS-25218 Update WebexService to remove config in favor of individual arguments

* APPEALS-45218 Format comment

---------

Co-authored-by: msteele <Marc.Steele@va.gov>

* Wmedders21/appeals 44873 (#21469)

* add rubyzip gem

* Test: Hearings::ZipAndUploadTranscriptionFilesJob

* Feature: Hearings::ZipAndUploadTranscriptionFilesJob

* Add zip subfolder to tmp/transcription_files

* Move new gem to proper alphabetical position in list

* revert gem file changes

* update gem file with feature branch

* refactor #perform method parameters

* update parameter name

* Piedram/appeals 44897 (#21519)

* Create new Workflow transcription_packages: Step One

* add some changes

* Modified the parameters for ZipAndUploadTranscriptionFilesJob

* Modified spec test

* Update transcription_packages.rb

* remove extra blank line

---------

Co-authored-by: piedram <maite.piedrayera@va.gov>

* Wmedders21/appeals 44874 (#21512)

* add rubyzip gem

* Test: Hearings::ZipAndUploadTranscriptionFilesJob

* Feature: Hearings::ZipAndUploadTranscriptionFilesJob

* Add zip subfolder to tmp/transcription_files

* Move new gem to proper alphabetical position in list

* revert gem file changes

* update gem file with feature branch

* refactor #perform method parameters

* update parameter name

* add zip extension to valid file types

* Test: transcription file creation and upload to s3

* Hearings::ZipAndUploadTranscriptionFilesJob updates db and uploads to s3

* resolve merge conflict

* APPEALS-44876 Work order job file (#21504)

* APPEALS-44876 Work order job file

* Updated filename with work order name

* Refactored create table method and updated spec

---------

Co-authored-by: Jim Foley <james.foley4@va.gov>

* Completing AC for ticketing for styling and error portion of page. Now doing feature test

* B_reed/hotfix_APPEALS-45285 (#21531)

* APPEALS-45285 Bug Fix

* APPEALS-45285 update pexip_service_spec

* APPEALS-45285 remove white space

* Hotfix/APPEALS-45218-v2 (#21522)

* APPEALS-45218 reverted webex config arguments

* APPEALS-45218 reverted webex config arguments

* APPEALS-45218 added query argument to webex conference link

* APPEALS-45218: webex recordings endpoint correction

* APPEALS-45218 adjusted arguments during inititalizing of refresh tokens

* APPEALS-45218 fixed rspec

* APPEALS-45218: added error catching on webex service response

* APPEALS-45218: remove tested code

* APPEALS-45218 Go back to leveraging HTTPI response inherited methods

---------

Co-authored-by: Ariana Konhilas <konhilas_ariana@bah.com>
Co-authored-by: msteele <Marc.Steele@va.gov>

* added ability for user to search by css id

* added feature tests for using search bar

* reverted changes in package.json

* removed added file

* removed linting error

* msteele/APPEALS-45349 (#21539)

* APPEALS-45349 Check for error on HTTPI object, then create Webex response object and fail with specific error

* APPEALS-45349 Flip conditionals

* APPEALS-45349 Fix linting errors

* searchable by 2 characters instead of 1

* hotfix/APPEALS-45399-45401-45472 (#21555)

* APPEALS-45399-45401 Update fetch webex list and details to retrieve apikey from cred stash

* APPEALS-45399-45401 Remove CGI escape from fetch webex list job

* APPEALS-445399-45401 Update spec files for webex list and details job

* APPEALS-45399-45401 Include error handling for transcription issue mailer failed delivery

* Revert "APPEALS-45399-45401 Include error handling for transcription issue mailer failed delivery"

This reverts commit d9ce585.

* ccc

* gggg

* gggg

* Create new Workflow transcription_packages: Step Two (#21570)

* Add call function to the new job, and modified spec files

* call the jobs

* feature/APPEALS-44188-44282 - Deprecation fixes for Rails 6.1 (release) (#21614)

* 🔀 Squash merge jcroteau/APPEALS-44188-fix-deprecation-warning-class-level-methods-will-no-longer-inherit-scoping

* 🔀 Squash merge jcroteau/APPEALS-44282-fix-deprecation-not-conditions-will-no-longer-behave-as-nor

* Work order file upload to AWS s3 (#21582)

* Work order file upload to AWS s3

* refactor code for upload to AWS

* refactor code for instance variables

* Revert "refactor code for instance variables"

This reverts commit b61c72a.

* code refactor for work order file

* APPEALS-44877 refactor for work order

* APPEALS-44310: add notification for unexpected task trees and update tests (#21474)

* add notification for unexpected task trees and update tests

* add slack notification to distribution errors, set default slack url in SlackService

* add tests for distributions to validate handling of errors in the ama_statistics method

* fix bad check for allowable tasks

* fix tests which were expecting a url as arg to new slack service

* fix codeclimate warning

* APPEALS-45199: Update Quality Review selection probabilities #21518

* APPEALS-44423: Remove therubyracer and jshint gems (#21443)

* APPEALS-42941 copied over Matt's work (#21624)

* APPEALS-43190 (#21448)

* APPEALS-43190 initial migration file

* APPEALS-43190 add seed data

* APPEALS-43190 add magic comment

* APPEALS-43190 move seed command

* APPEALS-43190 add bang!

* APPEALS-43190 update migration file

* APPEALS-43190 attribute name fix and updates

* APPEALS-43190 fix seed attribute

* APPEALS-43190 stubbed more seed data

* APPEALS-43190 remove seed comment

* APPEALS-43190 remove comment

* APPEALS-43190 add magic comment

* APPEALS-43190 update comments

* Wmedders21/appeals 44875 (#21605)

* Add retry logic for upload failure

* fix indentation rubocop warning

* Refactor zip job

* remove blank line

---------

Co-authored-by: Jim Foley <james.foley4@va.gov>

* akonhilas/APPEALS-43193 (#21581)

* APPEALS-43193: Add new columns and indexes to transcriptions table

* APPEALS-43193: Add new columns and indexes to transcriptions table

* APPEALS-43193: move index to own file

* APPEALS-43193: Update transcription contractor id to bigint

* APPEALS-43193: bigint

* APPEALS-43193: add fk after trancription_contractors table added

* lint error resolution (#21631)

* hotfix/APPEALS-45472 (#21562)

* APPEALS-45472 Refactor error handling for transcription

* APPEALS-45472 Include missing provider in error details for fetch recording list job and update comment for mailer

* Hotfix/APPEALS-45818 (#21632)

* APPEALS-45818: parsing fix, remove topic param, fix response

* APPEALS-45818: revert list and details job back to original state, update tests

---------

Co-authored-by: Marc Steele <71673522+msteele96@users.noreply.github.com>

* APPEALS-44878 refactor for retry and upon success kickoff  zip file job (#21652)

* APPEALS-44878 refactor for retry and upon success kickoff  zip file job

* APPEALS-44878 refactor code

* APPEALS-44878 refactor xls path

* lint error fix

* msteele/APPEALS-45285-v2 Fix delete_conference in PexipService (#21634)

* APPEALS-45285 update ExternalApi::PexipService#delete_conference to accept virtual_hearing as the only argument

* APPEALS-45285 Update spec to use virtual_hearing

* APPEALS-45285 Linting fixes

* Piedram/appeals 45696 (#21655)

* Create new Workflow Error handling transcription_packages: Step Three related to appeals-31793

* MOdified spec file

* fix lint error

* APPEALS-45696 refactor for work_order_params

---------

Co-authored-by: Kamala Madamanchi <kamala.madamanchi@va.gov>
Co-authored-by: Jim Foley <james.foley4@va.gov>

* hotfix/APPEALS-45828 (#21625)

* APPEALS-45828 Include call to create webex conference links in base hearing update form

* APPEALS-45828 Update details feature spec to expect webex link creation on conversion from virtual

* Fix needing to reload to display co host link on details page

* Fix incorrect method name

* Remove temporary rendering of default pexip link for webex hearings after conversion

* APPEALS-45828 Fix hearing mailer spec context issues and null check for BAD_VIRTUAL_LINK_TEXT

* APPEALS-45828 Remove file name argument from fetch details job spec

* APPEALS-45828 Fail on bad hearing link if link nil or legacy link

* APPEALS-45828 Sanitize url string

* APPEALS-45828 Undo url sanitize

* Remove unused styles after merge

* Fix lint warnings

---------

Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>
Co-authored-by: HunJerBAH <99915461+HunJerBAH@users.noreply.github.com>
Co-authored-by: msteele <Marc.Steele@va.gov>
Co-authored-by: Andrew Hadley <hadley_andrew@bah.com>
Co-authored-by: Marc Steele <71673522+msteele96@users.noreply.github.com>
Co-authored-by: Matthew Thornton <ThorntonMatthew@users.noreply.github.com>
Co-authored-by: IsaiahBar <isaiah.barnett@va.gov>
Co-authored-by: minhazur9 <65432922+minhazur9@users.noreply.github.com>
Co-authored-by: Will Medders <93014155+wmedders21@users.noreply.github.com>
Co-authored-by: Jim Foley <james.foley4@va.gov>
Co-authored-by: piedram <maite.piedrayera@va.gov>
Co-authored-by: Kamala Madamanchi <110078646+kamala-07@users.noreply.github.com>
Co-authored-by: breedbah <123968373+breedbah@users.noreply.github.com>
Co-authored-by: Ariana Konhilas <konhilas_ariana@bah.com>
Co-authored-by: raymond-hughes <raymond.hughes2@va.gov>
Co-authored-by: Jeff Marks <106996298+jefftmarks@users.noreply.github.com>
Co-authored-by: piedram <110848569+piedram@users.noreply.github.com>
Co-authored-by: Jeremy Croteau <jcroteau@users.noreply.github.com>
Co-authored-by: Craig Reese <109101548+craigrva@users.noreply.github.com>
Co-authored-by: cacevesva <109166981+cacevesva@users.noreply.github.com>
Co-authored-by: Amy Detwiler <133032208+amybids@users.noreply.github.com>
Co-authored-by: Ariana Konhilas <109693628+konhilas-ariana@users.noreply.github.com>
Co-authored-by: mikefinneran <110622959+mikefinneran@users.noreply.github.com>
Co-authored-by: Kamala Madamanchi <kamala.madamanchi@va.gov>
  • Loading branch information
25 people authored May 20, 2024
1 parent 7d0f06e commit ba45953
Show file tree
Hide file tree
Showing 94 changed files with 1,315 additions and 444 deletions.
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ gem "sass-rails", "~> 5.0"
# Error reporting to Sentry
gem "sentry-raven"
gem "shoryuken", "3.1.11"
gem "spreadsheet", "~> 1.3"
gem "statsd-instrument"
gem "stringex", require: false
# catch problematic migrations at development/test time
gem "strong_migrations"
# execjs runtime
gem "therubyracer", platforms: :ruby
# print trees
gem "tty-tree"
gem "tzinfo", "1.2.10"
Expand Down Expand Up @@ -108,16 +107,15 @@ group :test, :development, :demo do
gem "guard-rspec"
gem "immigrant"
# Linters
gem "jshint", platforms: :ruby
gem "pluck_to_hash"
gem "pry", "~> 0.13.0"
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem "pry-byebug", "~> 3.9"
gem "rails-erd"
gem "rb-readline"
gem "rspec"
gem "rspec-rails"
# For CircleCI test metadata analysis
gem "rspec-rails"
gem "rspec_junit_formatter"
gem "rubocop", "= 0.83", require: false
gem "rubocop-performance"
Expand Down
18 changes: 7 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,7 @@ GEM
aws-eventstream (~> 1, >= 1.0.2)
backport (1.2.0)
benchmark-ips (2.7.2)
bigdecimal (3.1.7)
bootsnap (1.7.5)
msgpack (~> 1.0)
bourbon (4.2.7)
Expand Down Expand Up @@ -1796,10 +1797,6 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jshint (1.5.0)
execjs (>= 1.4.0)
multi_json (~> 1.0)
therubyracer (~> 0.12.1)
json (2.3.0)
json_schemer (0.2.16)
ecma-re-validator (~> 0.2)
Expand Down Expand Up @@ -1860,7 +1857,6 @@ GEM
momentjs-rails (2.29.4.1)
railties (>= 3.1)
msgpack (1.4.2)
multi_json (1.12.2)
multipart-post (2.1.1)
multiverse (0.2.2)
activerecord (>= 4.2)
Expand Down Expand Up @@ -1998,7 +1994,6 @@ GEM
redis-store (>= 1.2, < 2)
redis-store (1.4.1)
redis (>= 2.2, < 5)
ref (2.0.0)
regexp_parser (1.6.0)
request_store (1.4.1)
rack (>= 1.4)
Expand Down Expand Up @@ -2053,6 +2048,7 @@ GEM
rake (>= 0.8.1)
ruby-graphviz (1.2.4)
ruby-oci8 (2.2.7)
ruby-ole (1.2.13.1)
ruby-plsql (0.8.0)
ruby-prof (1.4.1)
ruby-progressbar (1.13.0)
Expand Down Expand Up @@ -2116,6 +2112,9 @@ GEM
thor (~> 0.19, >= 0.19.4)
tilt (~> 2.0)
yard (~> 0.9)
spreadsheet (1.3.1)
bigdecimal
ruby-ole
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand All @@ -2131,9 +2130,6 @@ GEM
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
test-prof (0.10.1)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.8)
Expand Down Expand Up @@ -2185,6 +2181,7 @@ GEM
ziptz (2.1.6)

PLATFORMS
x86_64-darwin-21
x86_64-darwin-22
x86_64-darwin-23
x86_64-linux
Expand Down Expand Up @@ -2230,7 +2227,6 @@ DEPENDENCIES
holidays (~> 6.4)
icalendar
immigrant
jshint
json_schemer (~> 0.2.16)
kaminari
knapsack_pro (~> 3.8)
Expand Down Expand Up @@ -2284,12 +2280,12 @@ DEPENDENCIES
single_cov
sniffybara!
solargraph
spreadsheet (~> 1.3)
sql_tracker
statsd-instrument
stringex
strong_migrations
test-prof
therubyracer
timecop
tty-tree
tzinfo (= 1.2.10)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/hearings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def virtual_hearing_job_status
alias_with_host: hearing.virtual_hearing&.formatted_alias_or_alias_with_host,
guest_link: hearing.virtual_hearing&.guest_link,
host_link: hearing.virtual_hearing&.host_link,
co_host_link: hearing.virtual_hearing&.co_host_hearing_link,
guest_pin: hearing.virtual_hearing&.guest_pin,
host_pin: hearing.virtual_hearing&.host_pin
}
Expand Down
6 changes: 1 addition & 5 deletions app/jobs/caseflow_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ def metrics_service_report_time_segment(segment:, start_time:)
)
end

def slack_url
ENV["SLACK_DISPATCH_ALERT_URL"]
end

def slack_service
@slack_service ||= SlackService.new(url: slack_url)
@slack_service ||= SlackService.new
end

def log_error(error, extra: {})
Expand Down
11 changes: 6 additions & 5 deletions app/jobs/hearings/create_non_virtual_conference_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
# This job creates a Webex conference & link for a non virtual hearing

class Hearings::CreateNonVirtualConferenceJob < CaseflowJob
include Hearings::EnsureCurrentUserIsSet
# We are not using ensure_current_user_is_set because of some
# potential for rollbacks if the set user is not the system user

queue_with_priority :high_priority
application_attr :hearing_schedule

attr_reader :hearing

# Retry if Webex returns an invalid response.
Expand All @@ -15,12 +17,11 @@ class Hearings::CreateNonVirtualConferenceJob < CaseflowJob
end

def perform(hearing:)
ensure_current_user_is_set
RequestStore.store[:current_user] = User.system_user
WebexConferenceLink.find_or_create_by!(
hearing_id: hearing.id,
hearing_type: hearing.readable_request_type,
hearing: hearing,
created_by: hearing.created_by
created_by: hearing.created_by,
updated_by: hearing.created_by
)
end
end
24 changes: 12 additions & 12 deletions app/jobs/hearings/download_transcription_file_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

class Hearings::DownloadTranscriptionFileJob < CaseflowJob
include Hearings::EnsureCurrentUserIsSet
include Hearings::SendTranscriptionIssuesEmail

queue_with_priority :low_priority
application_attr :hearing_schedule
Expand All @@ -25,25 +26,24 @@ class HearingAssociationError < StandardError; end
provider: "webex"
}
error_details = job.build_error_details(exception, details_hash)
TranscriptionFileIssuesMailer.issue_notification(error_details)
job.log_error(exception)
job.log_download_error(exception)
job.send_transcription_issues_email(error_details)
end

retry_on(TranscriptionFileUpload::FileUploadError, wait: :exponentially_longer) do |job, exception|
details_hash = { error: { type: "upload" }, provider: "S3" }
error_details = job.build_error_details(exception, details_hash)
TranscriptionFileIssuesMailer.issue_notification(error_details)
job.transcription_file.clean_up_tmp_location
job.log_error(exception)
job.log_download_error(exception)
job.send_transcription_issues_email(error_details)
end

retry_on(TranscriptionTransformer::FileConversionError, wait: 10.seconds) do |job, exception|
job.transcription_file.clean_up_tmp_location
details_hash = { error: { type: "conversion" }, conversion_type: "rtf" }
error_details = job.build_error_details(exception, details_hash)

TranscriptionFileIssuesMailer.issue_notification(error_details)
job.log_error(exception)
job.log_download_error(exception)
job.send_transcription_issues_email(error_details)
end

discard_on(FileNameError) do |job, exception|
Expand All @@ -54,8 +54,8 @@ class HearingAssociationError < StandardError; end
expected_file_name_format: "[docket_number]_[internal_id]_[hearing_type].[file_type]"
}
error_details = job.build_error_details(exception, details_hash)
TranscriptionFileIssuesMailer.issue_notification(error_details)
Rails.logger.error("#{job.class.name} (#{job.job_id}) discarded with error: #{exception}")
job.log_download_error(exception)
job.send_transcription_issues_email(error_details)
end

# Purpose: Downloads audio (mp3), video (mp4), or transcript (vtt) file from Webex temporary download link and
Expand Down Expand Up @@ -96,14 +96,14 @@ def build_error_details(error, details_hash)
# Note: Public method to provide access during job retry
#
# Params: error - Error object
def log_error(error)
def log_download_error(error)
extra = {
application: self.class.name,
hearing_id: hearing.id,
hearing_id: !error.is_a?(FileNameError) ? hearing.id : nil,
file_name: file_name,
job_id: job_id
}
super(error, extra: extra)
log_error(error, extra: extra)
end

private
Expand Down
23 changes: 13 additions & 10 deletions app/jobs/hearings/fetch_webex_recordings_details_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

class Hearings::FetchWebexRecordingsDetailsJob < CaseflowJob
include Hearings::EnsureCurrentUserIsSet
include Hearings::SendTranscriptionIssuesEmail

queue_with_priority :low_priority
application_attr :hearing_schedule
Expand All @@ -20,13 +21,12 @@ class Hearings::FetchWebexRecordingsDetailsJob < CaseflowJob
response: { status: exception.code, message: exception.message }.to_json,
docket_number: nil
}
TranscriptionFileIssuesMailer.issue_notification(error_details)
job.log_error(exception)
job.send_transcription_issues_email(error_details)
end

def perform(id:, file_name:)
def perform(id:)
ensure_current_user_is_set
@file_name ||= file_name
data = fetch_recording_details(id)
topic = data.topic

Expand All @@ -51,21 +51,24 @@ def log_error(error)
private

def fetch_recording_details(id)
config = {
WebexService.new(
host: ENV["WEBEX_HOST_MAIN"],
port: ENV["WEBEX_PORT"],
aud: ENV["WEBEX_ORGANIZATION"],
apikey: ENV["WEBEX_BOTTOKEN"],
apikey: CredStash.get("webex_#{Rails.deploy_env}_access_token"),
domain: ENV["WEBEX_DOMAIN_MAIN"],
api_endpoint: ENV["WEBEX_API_MAIN"],
query: { "id": id }
}

WebexService.new(config: config).fetch_recording_details
query: nil
).fetch_recording_details(id)
end

def create_file_name(topic, extension)
subject = topic.split("-").second.lstrip
type = topic.scan(/[A-Za-z]+?(?=-)/).first
subject = if type == "Hearing"
topic.scan(/\d*-\d*_\d*_[A-Za-z]+?(?=-)/).first
else
topic.split("-").second.lstrip
end
counter = topic.split("-").last
"#{subject}-#{counter}.#{extension}"
end
Expand Down
18 changes: 8 additions & 10 deletions app/jobs/hearings/fetch_webex_recordings_list_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

class Hearings::FetchWebexRecordingsListJob < CaseflowJob
include Hearings::EnsureCurrentUserIsSet
include Hearings::SendTranscriptionIssuesEmail

queue_with_priority :low_priority
application_attr :hearing_schedule
Expand All @@ -15,23 +16,20 @@ class Hearings::FetchWebexRecordingsListJob < CaseflowJob
query = "?max=#{max}?from=#{CGI.escape(from.iso8601)}?to=#{CGI.escape(to.iso8601)}"
error_details = {
error: { type: "retrieval", explanation: "retrieve a list of recordings from Webex" },
provider: "webex",
api_call: "GET #{ENV['WEBEX_HOST_MAIN']}#{ENV['WEBEX_DOMAIN_MAIN']}#{ENV['WEBEX_API_MAIN']}#{query}",
response: { status: exception.code, message: exception.message }.to_json,
times: { from: from, to: to },
docket_number: nil
}
TranscriptionFileIssuesMailer.issue_notification(error_details)
job.log_error(exception)
job.send_transcription_issues_email(error_details)
end

def perform
ensure_current_user_is_set
response = fetch_recordings_list
topics = response.topics
topic_num = 0
response.ids.each do |id|
Hearings::FetchWebexRecordingsDetailsJob.perform_later(id: id, topic: topics[topic_num])
topic_num += 1
fetch_recordings_list.ids.each do |n|
Hearings::FetchWebexRecordingsDetailsJob.perform_later(id: n)
end
end

Expand All @@ -42,16 +40,16 @@ def log_error(error)
private

def fetch_recordings_list
from = CGI.escape(2.hours.ago.in_time_zone("America/New_York").beginning_of_hour.iso8601)
to = CGI.escape(1.hour.ago.in_time_zone("America/New_York").beginning_of_hour.iso8601)
from = 2.hours.ago.in_time_zone("America/New_York").beginning_of_hour.iso8601
to = 1.hour.ago.in_time_zone("America/New_York").beginning_of_hour.iso8601
max = 100
query = { "from": from, "to": to, "max": max }

WebexService.new(
host: ENV["WEBEX_HOST_MAIN"],
port: ENV["WEBEX_PORT"],
aud: ENV["WEBEX_ORGANIZATION"],
apikey: ENV["WEBEX_BOTTOKEN"],
apikey: CredStash.get("webex_#{Rails.deploy_env}_access_token"),
domain: ENV["WEBEX_DOMAIN_MAIN"],
api_endpoint: ENV["WEBEX_API_MAIN"],
query: query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
# This job is queued with low priority, indicating that it does not need to be run immediately
# and can wait until the system is less busy.

class VirtualHearings::RefreshWebexAccessTokenJob < CaseflowJob
class Hearings::RefreshWebexAccessTokenJob < CaseflowJob
queue_with_priority :low_priority

def perform
webex_service = WebexService.new(
host: nil,
host: ENV["WEBEX_HOST_MAIN"],
port: nil,
aud: nil,
apikey: nil,
domain: nil,
api_endpoint: nil,
domain: ENV["WEBEX_DOMAIN_MAIN"],
api_endpoint: ENV["WEBEX_API_MAIN"],
query: nil
)
response = webex_service.refresh_access_token
Expand Down
10 changes: 10 additions & 0 deletions app/jobs/hearings/send_transcription_issues_email.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

module Hearings::SendTranscriptionIssuesEmail
def send_transcription_issues_email(error_details)
TranscriptionFileIssuesMailer.issue_notification(error_details).deliver_now!
rescue StandardError, Savon::Error, BGS::ShareError => error
# Savon::Error and BGS::ShareError are sometimes thrown when making requests to BGS endpoints
log_error(error)
end
end
Loading

0 comments on commit ba45953

Please sign in to comment.