Skip to content

LG-9272: Record in-person enrollment status check completion time#8136

Merged
NavaTim merged 3 commits intomainfrom
tbradley/lg-9272-successful-check-late-alert
Apr 5, 2023
Merged

LG-9272: Record in-person enrollment status check completion time#8136
NavaTim merged 3 commits intomainfrom
tbradley/lg-9272-successful-check-late-alert

Conversation

@NavaTim
Copy link
Contributor

@NavaTim NavaTim commented Apr 5, 2023

🎫 Ticket

LG-9272

🛠 Summary of changes

  • Create DateTime database field in_person_enrollments.status_check_completed_at
  • Create method InPersonEnrollment.minutes_since_last_status_check_completed
  • Set status_check_completed_at after GetUspsProofingResultsJob checks the enrollment status successfully
    • Includes:
      • Specific 4xx Bad Request errors:
        • Enrollment incomplete
        • Enrollment expired
      • Unsupported ID type
      • Enrollment failed
      • Enrollment success
    • Excludes (except where mentioned above):
      • Unsupported status
      • Non-hash response
      • Standard error
      • Faraday error
      • Client error
      • Server error
      • Specific 4xx Bad Request errors:
        • Invalid enrollment code
        • Invalid applicant
  • Log minutes_since_last_status_check_completed while running GetUspsProofingResultsJob

This is intended to be merged and deployed prior to other monitoring-related changes for this story.

📜 Testing Plan

  • Complete the in-person enrollment process
    • USPS API or mock API must treat enrollment as valid
  • Trigger/wait for USPS proofing results job to process the enrollment at least twice
    • May require more than two job executions depending on environment config
    • You can run the following to trigger the job:
      $ rails c
      Loading development environment (Rails 7.0.4.3)
      [1] pry(main)> GetUspsProofingResultsJob.perform_now(Time.zone.now)
      
  • Wait a few minutes for the logs to propagate to CloudWatch
    • (Local dev only) Use the logs/event.log file instead of CloudWatch
  • Verify that the logs for the first status check include do not have a time set for minutes_since_last_status_check_completed on the enrollment
  • Verify that the logs from the second status check include minutes_since_last_status_check_completed that correctly indicates the first time the enrollment status check completed
  • Update the enrollment record or USPS/mock API so that the API will respond with an error while attempting to check the enrollment record
  • Trigger/wait for USPS proofing results job twice and for logs to sync
  • Verify that the logs from the most recent status check include minutes_since_last_status_check_completed that predates the two most enrollment status checks

@NavaTim NavaTim requested review from a team and tomas-nava April 5, 2023 00:08
Copy link
Contributor

@tomas-nava tomas-nava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve!

@NavaTim NavaTim merged commit 69071c2 into main Apr 5, 2023
@NavaTim NavaTim deleted the tbradley/lg-9272-successful-check-late-alert branch April 5, 2023 21:43
mitchellhenke pushed a commit that referenced this pull request Apr 7, 2023
)

* LG-9272: Record in-person enrollment status check completion time

changelog: Internal, In-Person Proofing, Record in-person enrollment status check completion time

* LG-9272: Update enrollment status check completed field

* LG-9272: Test status completed timestamp field setting
jc-gsa pushed a commit that referenced this pull request Apr 19, 2023
)

* LG-9272: Record in-person enrollment status check completion time

changelog: Internal, In-Person Proofing, Record in-person enrollment status check completion time

* LG-9272: Update enrollment status check completed field

* LG-9272: Test status completed timestamp field setting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants