From acd7892092b032eb8765abca9ed777215ee0eb03 Mon Sep 17 00:00:00 2001 From: jvcAdHoc <144135615+jvcAdHoc@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:15:38 -0400 Subject: [PATCH 1/6] add alpha character to accredited org model spec (#19086) --- spec/models/accredited_organization_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/accredited_organization_spec.rb b/spec/models/accredited_organization_spec.rb index c908011ccd8..449497b2438 100644 --- a/spec/models/accredited_organization_spec.rb +++ b/spec/models/accredited_organization_spec.rb @@ -4,7 +4,7 @@ RSpec.describe AccreditedOrganization, type: :model do describe 'validations' do - subject { build(:accredited_organization) } + subject { build(:accredited_organization, poa_code: 'A12') } it { is_expected.to have_many(:accredited_individuals).through(:accreditations) } From ededfe71556463ca33f38a032c1b601bb786dcb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:23:52 -0400 Subject: [PATCH 2/6] Bump pg from 1.5.8 to 1.5.9 (#19084) Bumps [pg](https://github.com/ged/ruby-pg) from 1.5.8 to 1.5.9. - [Changelog](https://github.com/ged/ruby-pg/blob/master/History.md) - [Commits](https://github.com/ged/ruby-pg/compare/v1.5.8...v1.5.9) --- updated-dependencies: - dependency-name: pg dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 50a0ccff90c..1aa0a1d30dc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -748,7 +748,7 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.5.8) + pg (1.5.9) pg_query (5.1.0) google-protobuf (>= 3.22.3) pg_search (2.3.7) From 4edfb4f0e1812541373c28f7b4ed032830a1630f Mon Sep 17 00:00:00 2001 From: Molly Trombley-McCann Date: Fri, 25 Oct 2024 09:43:12 -0700 Subject: [PATCH 3/6] Make association two-way (#19057) - Previously added a belongs_to to SecondaryAppealForm, needed the has_many on AppealSubmission - optional, dependent: destroy --- app/models/appeal_submission.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/appeal_submission.rb b/app/models/appeal_submission.rb index 9ffffcabab1..ad2c91539fb 100644 --- a/app/models/appeal_submission.rb +++ b/app/models/appeal_submission.rb @@ -14,6 +14,7 @@ class AppealSubmission < ApplicationRecord has_encrypted :upload_metadata, key: :kms_key, **lockbox_options has_many :appeal_submission_uploads, dependent: :destroy + has_many :secondary_appeal_forms, dependent: :destroy scope :failure_not_sent, -> { where(failure_notification_sent_at: nil).order(id: :asc) } From 5cb03e95319dc74f34f2a0e23a95b25cac6b438b Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Fri, 25 Oct 2024 11:55:22 -0500 Subject: [PATCH 4/6] Add Supplemental Claim updates feature toggle (#19068) --- config/features.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/features.yml b/config/features.yml index 21fa6dd3475..04a32ab7c2b 100644 --- a/config/features.yml +++ b/config/features.yml @@ -1610,6 +1610,10 @@ features: actor_type: user description: HLR show form content updates enable_in_development: true + sc_new_form: + actor_type: user + description: Supplemental Claim new form updates + enable_in_development: true pension_ipf_callbacks_endpoint: actor_type: user description: Pension IPF VANotify notification callbacks endpoint From 9f75c440baff897b8e781b5cac3a1e0476b651a0 Mon Sep 17 00:00:00 2001 From: Nathan Burgess Date: Fri, 25 Oct 2024 12:58:58 -0400 Subject: [PATCH 5/6] Fix status update bug when polling multiple Lighthouse document records (#19065) * Fix status update bug when polling multiple Lighthouse document records Removes a service object instantiation in a memoized method within a loop that parses document statuses from the Lighthouse uploads/status endpoint. This service class loops through a chunk of Lighthouse document statuses, it should be instantiating the UploadStatusUpdater for each status, not creating a memoized version on the first status that will be called over and over instead of updating the other statuses * fix linting error --- .../update_documents_status_service.rb | 18 +++----- .../update_documents_status_service_spec.rb | 43 +++++++++++++++++++ 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/lib/lighthouse/benefits_documents/form526/update_documents_status_service.rb b/lib/lighthouse/benefits_documents/form526/update_documents_status_service.rb index d04aae030c3..a490fa60b19 100644 --- a/lib/lighthouse/benefits_documents/form526/update_documents_status_service.rb +++ b/lib/lighthouse/benefits_documents/form526/update_documents_status_service.rb @@ -39,6 +39,7 @@ def self.call(*) # @param lighthouse526_document_uploads [Lighthouse526DocumentUpload] a collection of # Lighthouse526DocumentUpload records polled for status updates on Lighthouse's '/uploads/status' endpoint + # @param lighthouse_status_response [Hash] the parsed JSON response body from the endpoint def initialize(lighthouse526_document_uploads, lighthouse_status_response) @lighthouse526_document_uploads = lighthouse526_document_uploads @lighthouse_status_response = lighthouse_status_response @@ -66,34 +67,29 @@ def update_document_status(status) document_upload = @lighthouse526_document_uploads.find_by!(lighthouse_document_request_id: status['requestId']) statsd_document_base_key(STATSD_DOCUMENT_TYPE_KEY_MAP[document_upload.document_type]) - status_updater(status, document_upload) - @status_updater.update_status + status_updater = BenefitsDocuments::Form526::UploadStatusUpdater.new(status, document_upload) + status_updater.update_status if document_upload.completed? # ex. 'api.form526.lighthouse_document_upload_processing_status.bdd_instructions.complete' StatsD.increment("#{@statsd_document_base_key}.#{STATSD_DOCUMENT_COMPLETE_KEY}") elsif document_upload.failed? - log_failure(document_upload) - elsif @status_updater.processing_timeout? + log_failure(status_updater, document_upload) + elsif status_updater.processing_timeout? # Triggered when a document is still pending more than 24 hours after processing began # ex. 'api.form526.lighthouse_document_upload_processing_status.bdd_instructions.processing_timeout' StatsD.increment("#{@statsd_document_base_key}.#{STATSD_PROCESSING_TIMEOUT_KEY}") end end - def status_updater(status, document_upload) - # UploadStatusUpdater encapsulates all parsing of a status response from Lighthouse - @status_updater ||= BenefitsDocuments::Form526::UploadStatusUpdater.new(status, document_upload) - end - def statsd_document_base_key(statsd_document_type_key) @statsd_document_base_key ||= "#{STATSD_BASE_KEY}.#{statsd_document_type_key}" end - def log_failure(document_upload) + def log_failure(status_updater, document_upload) # Because Lighthouse's processing steps are subject to change, these metrics must be dynamic. # Currently, this should return either CLAIMS_EVIDENCE or BENEFITS_GATEWAY_SERVICE - failure_step = @status_updater.get_failure_step + failure_step = status_updater.get_failure_step # ex. 'api.form526.lighthouse_document_upload_processing_status.bdd_instructions.failed.claims_evidence' StatsD.increment("#{@statsd_document_base_key}.#{STATSD_DOCUMENT_FAILED_KEY}.#{failure_step.downcase}") diff --git a/spec/lib/lighthouse/benefits_documents/form526/update_documents_status_service_spec.rb b/spec/lib/lighthouse/benefits_documents/form526/update_documents_status_service_spec.rb index 9393768e590..25aae3a52dc 100644 --- a/spec/lib/lighthouse/benefits_documents/form526/update_documents_status_service_spec.rb +++ b/spec/lib/lighthouse/benefits_documents/form526/update_documents_status_service_spec.rb @@ -103,6 +103,49 @@ end end end + + context 'when updating multiple records' do + let!(:first_pending_polling_document) { create(:lighthouse526_document_upload, aasm_state: 'pending') } + let!(:second_pending_polling_document) { create(:lighthouse526_document_upload, aasm_state: 'pending') } + + let(:status_response) do + { + 'data' => { + 'statuses' => [ + { + 'requestId' => first_pending_polling_document.lighthouse_document_request_id, + 'time' => { + 'startTime' => start_time_in_unix_milliseconds, + 'endTime' => end_time_in_unix_milliseconds + }, + 'status' => 'SUCCESS' + }, { + 'requestId' => second_pending_polling_document.lighthouse_document_request_id, + 'time' => { + 'startTime' => start_time_in_unix_milliseconds, + 'endTime' => end_time_in_unix_milliseconds + }, + 'status' => 'FAILED', + 'error' => { + 'detail' => 'Something went wrong', + 'step' => 'BENEFITS_GATEWAY_SERVICE' + } + } + ], + 'requestIdsNotFound' => [ + 0 + ] + } + } + end + + it 'updates each record status properly' do + described_class.call(Lighthouse526DocumentUpload.all, status_response) + + expect(first_pending_polling_document.reload.aasm_state).to eq('completed') + expect(second_pending_polling_document.reload.aasm_state).to eq('failed') + end + end end describe 'document type in statsd metrics' do From a90afb5f35c3cb971eb6c847a6459170b1d9a763 Mon Sep 17 00:00:00 2001 From: stevenjcumming <134282106+stevenjcumming@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:59:56 -0400 Subject: [PATCH 6/6] Bump googleauth from 1.11.1 to 1.11.2 (#19052) * bump googleauth 1.11.2 * fix faraday updates * remove google-protobuf (4.28.3-java) --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1aa0a1d30dc..56b9b292215 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -528,7 +528,7 @@ GEM google-protobuf (4.28.3) bigdecimal rake (>= 13) - googleauth (1.11.1) + googleauth (1.11.2) faraday (>= 1.0, < 3.a) google-cloud-env (~> 2.1) jwt (>= 1.4, < 3.0)