-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR #5 for silent failure work - Add files to create a job to poll the upload status from lighthouse and to create a cron job to send emails for failed uploads #20637
base: master
Are you sure you want to change the base?
Conversation
Generated by 🚫 Danger |
…te sidekiq retries from false to 0 for failure_notification_email_job
# For lighthouse uploads if the response is successful then we leave the upload_status as PENDING | ||
# and the polling job in Lighthouse::EvidenceSubmissions::EvidenceSubmissionDocumentUploadPollingJob | ||
# will then make a call to lighthouse later to check on the status of the upload and update accordingly | ||
def update_evidence_submission_for_in_progress(job_id, response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call
…updated upload_status_updater_spec.rb to use the factory bd_evidence_submission_pending
Summary
This pr is the third pr to merge some of the work from #20105. The first pr that included the db changes was previously merged #20318. The second pr that added the model, factory, constants, helpers and vcr cassettes was also previously merged #20346. The third pr added evss files and changes for document upload and was also previously merged #20380. The fourth pr added lighthouse files and changes for document upload and was also previously merged #20453.
PR Changes for the poll job:
benefits_documents_use_lighthouse
is enabledcst_synchronous_evidence_uploads
is disabledcst_send_evidence_failure_emails
can be disabled or enabledcst_send_evidence_submission_failure_emails
is enabledsettings.local.yml
has a vanotify section -> hereEvidenceSubmissions
upload_status_updater
for updating the status and failure dates, acknowledgment dates, and deletion datesupload_status_updater
,update_documents_status_service
anddocument_status_polling_service
acknowledgement_date
,failed_date
, anderror_message
toEvidenceSubmissions
modeldocument_status_polling_service
update_documents_status_service
to handle document batches and send them toupload_status_updater
EvidenceSubmissions
testsapp/sidekiq/lighthouse/evidence_submissions/document_upload.rb
so that when an upload is successful we keep the upload_status asPENDING
(minor bug existed where we were setting this toSUCCESS
)spec/sidekiq/lighthouse/evidence_submissions/document_upload_spec.rb
for regarding the upload_statusPR Changes for the cron job:
benefits_documents_use_lighthouse
is enabledcst_synchronous_evidence_uploads
is disabledcst_send_evidence_failure_emails
can be disabled or enabledcst_send_evidence_submission_failure_emails
is enabledsettings.local.yml
has a vanotify section -> hereLighthouse::EvidenceSubmissions::FailureNotificationEmailJob
tolib/periodic_jobs.rb
app/sidekiq/lighthouse/evidence_submissions/failure_notification_email_job.rb
that is used to run the cron job to send emails for failed uploadsspec/sidekiq/lighthouse/evidence_submissions/failure_notification_email_job_spec.rb
to test itRelated issue(s)
Testing done
How to test Polling Job
src/applications/claims-status/constants.js
and setshouldUseMocks= false
benefits_documents_use_lighthouse
is enabledcst_synchronous_evidence_uploads
is disabledcst_send_evidence_failure_emails
can be disabled or enabledcst_send_evidence_submission_failure_emails
is enabledsettings.local.yml
has a vanotify sectionlib/lighthouse/benefits_claims/service.rb
with an icn of a user in staging EX:@icn = '1012830712V627751' # icn for user 19
lib/lighthouse/benefits_documents/configuration.rb
to the participantId of the staging user that you are using ( you can get this from argo or ask someone with argo access to get this for you) EX: participantId: 600_073_191,Lighthouse::EvidenceSubmissions::EvidenceSubmissionDocumentUploadPollingJob.perform_async
How to test Cron Job
benefits_documents_use_lighthouse
is enabledcst_synchronous_evidence_uploads
is disabledcst_send_evidence_failure_emails
can be disabled or enabledcst_send_evidence_submission_failure_emails
is enabledsettings.local.yml
has a vanotify sectionlib/lighthouse/benefits_claims/service.rb
with an icn of a user in staging EX:@icn = '1012830712V627751' # icn for user 19
lib/lighthouse/benefits_documents/configuration.rb
to the participantId is not being set to a specific staging user (only needed if you were testing previous scenario) --> this is how we will generate an errorapp/sidekiq/lighthouse/evidence_submissions/failure_notification_email_job.rb
so that wherenotify_client.send_email()
is called we replacerecipient_identifier: { id_value: icn, id_type: 'ICN' }
withemail_address: 'YOUR_EMAIL',
Lighthouse::EvidenceSubmissions::FailureNotificationEmailJob.perform_async
Screenshots for Testing Cron Job
**Ensure that
benefits_documents_use_lighthouse
is enabled,cst_send_evidence_failure_emails
is enabled or disabled,cst_synchronous_evidence_uploads
is disabled, andcst_send_evidence_submission_failure_emails
is enabled. Follow above instruction to make the file upload fail. When you upload a file, an evidence submission record is added and updated (it will have a FAILED upload_status and a date_failed). **** Test that once you run the cron job in rails console an email is sent for failed upload and the evidence submission record is updated to have a va_notify_id and va_notify_date **
Screenshots for Testing Poll Job
Ensure that
benefits_documents_use_lighthouse
is enabled,cst_send_evidence_failure_emails
is enabled or disabled,cst_synchronous_evidence_uploads
is disabled, andcst_send_evidence_submission_failure_emails
is enabled. Follow above instruction to make the file upload be successful. When you upload a file, an evidence submission record is added and updated (it will have a PENDING upload_status).** Test that once you run the polling job in rails console an evidence submission record is updated to have a SUCCESS upload status and a delete_date **
What areas of the site does it impact?
Claim Status Tool
Acceptance criteria
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?