-
Notifications
You must be signed in to change notification settings - Fork 166
LG-6293 Add more DOCUMENT_FAIL conditions to verification failures report #6382
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
Merged
stevegsa
merged 6 commits into
main
from
stevegsa-add-more-doc-failures-to-verification-failures-reports.rb
May 20, 2022
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a90887e
LG-6293 Add more conditions considered DOCUMENT_FAIL to verification …
stevegsa 03e80d6
Name change request from jeff
stevegsa 29ccf10
Fix spec
stevegsa 8d8bf31
changelog: Internal, Reporting, Add more DOCUMENT_FAIL conditions to …
stevegsa b7ebf20
Read from cron config and offset by 1hr
stevegsa f9490f1
changelog: Internal, Reporting, Add more DOCUMENT_FAIL conditions to …
stevegsa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
app/services/verification_errors_report.rb → app/services/verification_failures_report.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
db/primary_migrate/20220517103312_add_back_image_submit_at_to_doc_auth_logs.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| class AddBackImageSubmitAtToDocAuthLogs < ActiveRecord::Migration[6.1] | ||
| def change | ||
| add_column :doc_auth_logs, :back_image_submit_at, :datetime | ||
| add_column :doc_auth_logs, :capture_mobile_back_image_submit_at, :datetime | ||
| add_column :doc_auth_logs, :mobile_back_image_submit_at, :datetime | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||||||||||||||||
| require 'rails_helper' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| describe Reports::VerificationErrorsReport do | ||||||||||||||||||||
| describe Reports::VerificationFailuresReport do | ||||||||||||||||||||
| let(:issuer) { 'urn:gov:gsa:openidconnect:sp:sinatra' } | ||||||||||||||||||||
| let(:email) { 'foo@bar.com' } | ||||||||||||||||||||
| let(:name) { 'An SP' } | ||||||||||||||||||||
|
|
@@ -64,6 +64,54 @@ | |||||||||||||||||||
| expect(csv[1]).to eq([uuid, now.to_time.utc.iso8601, 'DOCUMENT_FAIL']) | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| it 'sends out a document error if the user submits desktop back image and fails' do | ||||||||||||||||||||
| DocAuthLog.create( | ||||||||||||||||||||
| user_id: user.id, | ||||||||||||||||||||
| welcome_view_at: now, | ||||||||||||||||||||
| back_image_submit_at: now + 1.second, | ||||||||||||||||||||
| issuer: issuer, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| reports = run_reports | ||||||||||||||||||||
| expect(reports.length).to eq(1) | ||||||||||||||||||||
| csv = CSV.parse(reports[0]) | ||||||||||||||||||||
| expect(csv.length).to eq(2) | ||||||||||||||||||||
| expect(csv.first).to eq(['uuid', 'welcome_view_at', 'error_code']) | ||||||||||||||||||||
| expect(csv[1]).to eq([uuid, now.to_time.utc.iso8601, 'DOCUMENT_FAIL']) | ||||||||||||||||||||
|
Comment on lines
+77
to
+80
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we parse the CSV with
Suggested change
|
||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| it 'sends out a document error if the user submits hybrid back image and fails' do | ||||||||||||||||||||
| DocAuthLog.create( | ||||||||||||||||||||
| user_id: user.id, | ||||||||||||||||||||
| welcome_view_at: now, | ||||||||||||||||||||
| capture_mobile_back_image_submit_at: now + 1.second, | ||||||||||||||||||||
| issuer: issuer, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| reports = run_reports | ||||||||||||||||||||
| expect(reports.length).to eq(1) | ||||||||||||||||||||
| csv = CSV.parse(reports[0]) | ||||||||||||||||||||
| expect(csv.length).to eq(2) | ||||||||||||||||||||
| expect(csv.first).to eq(['uuid', 'welcome_view_at', 'error_code']) | ||||||||||||||||||||
| expect(csv[1]).to eq([uuid, now.to_time.utc.iso8601, 'DOCUMENT_FAIL']) | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| it 'sends out a document error if the user submits mobile back image and fails' do | ||||||||||||||||||||
| DocAuthLog.create( | ||||||||||||||||||||
| user_id: user.id, | ||||||||||||||||||||
| welcome_view_at: now, | ||||||||||||||||||||
| mobile_back_image_submit_at: now + 1.second, | ||||||||||||||||||||
| issuer: issuer, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| reports = run_reports | ||||||||||||||||||||
| expect(reports.length).to eq(1) | ||||||||||||||||||||
| csv = CSV.parse(reports[0]) | ||||||||||||||||||||
| expect(csv.length).to eq(2) | ||||||||||||||||||||
| expect(csv.first).to eq(['uuid', 'welcome_view_at', 'error_code']) | ||||||||||||||||||||
| expect(csv[1]).to eq([uuid, now.to_time.utc.iso8601, 'DOCUMENT_FAIL']) | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| it 'sends out a verify error if the user submits PII but does not progress forward' do | ||||||||||||||||||||
| DocAuthLog.create( | ||||||||||||||||||||
| user_id: user.id, | ||||||||||||||||||||
|
|
@@ -115,6 +163,38 @@ | |||||||||||||||||||
| expect(csv[2]).to eq([uuid2, now.to_time.utc.iso8601, 'ABANDON']) | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| it 'allows submit to be recent and not just after welcome' do | ||||||||||||||||||||
| DocAuthLog.create( | ||||||||||||||||||||
| user_id: user.id, | ||||||||||||||||||||
| welcome_view_at: now, | ||||||||||||||||||||
| mobile_back_image_submit_at: now - 12.hours, | ||||||||||||||||||||
| issuer: issuer, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| reports = run_reports | ||||||||||||||||||||
| expect(reports.length).to eq(1) | ||||||||||||||||||||
| csv = CSV.parse(reports[0]) | ||||||||||||||||||||
| expect(csv.length).to eq(2) | ||||||||||||||||||||
| expect(csv.first).to eq(['uuid', 'welcome_view_at', 'error_code']) | ||||||||||||||||||||
| expect(csv[1]).to eq([uuid, now.to_time.utc.iso8601, 'DOCUMENT_FAIL']) | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| it 'does not consider old submits as fails' do | ||||||||||||||||||||
| DocAuthLog.create( | ||||||||||||||||||||
| user_id: user.id, | ||||||||||||||||||||
| welcome_view_at: now, | ||||||||||||||||||||
| document_capture_submit_at: now - 24.hours, | ||||||||||||||||||||
| issuer: issuer, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| reports = run_reports | ||||||||||||||||||||
| expect(reports.length).to eq(1) | ||||||||||||||||||||
| csv = CSV.parse(reports[0]) | ||||||||||||||||||||
| expect(csv.length).to eq(2) | ||||||||||||||||||||
| expect(csv.first).to eq(['uuid', 'welcome_view_at', 'error_code']) | ||||||||||||||||||||
| expect(csv[1]).to eq([uuid, now.to_time.utc.iso8601, 'ABANDON']) | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| describe '#good_job_concurrency_key' do | ||||||||||||||||||||
| let(:date) { Time.zone.today } | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
@@ -133,6 +213,6 @@ def run_reports | |||||||||||||||||||
| [{ 'name' => name, 'issuers' => [issuer], 'emails' => [email] }], | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Reports::VerificationErrorsReport.new.perform(Time.zone.today) | ||||||||||||||||||||
| Reports::VerificationFailuresReport.new.perform(Time.zone.today) | ||||||||||||||||||||
| end | ||||||||||||||||||||
| end | ||||||||||||||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Was it intended to remove this line? When running the migration locally, the line was added back.