Skip to content
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

LG-13120 | Moves ssn_is_unique logic into ResolutionProofingJob #10801

Merged
merged 9 commits into from
Jun 18, 2024

Conversation

n1zyy
Copy link
Member

@n1zyy n1zyy commented Jun 11, 2024

🎫 Ticket

Link to the relevant ticket:
LG-13120

🛠 Summary of changes

We want to move the ssn_is_unique check out of VerifyInfoConcern entirely, and start doing it in ResolutionProofingJob instead.

Part 1 of this process is adding it in the ResolutionProofingJob. Since it's stored in the results, it'll come back to VerifyInfoConcern "for free."

After this is released, a separate PR will rip the existing code out of VerifyInfoConcern.

@n1zyy
Copy link
Member Author

n1zyy commented Jun 11, 2024

I wanted to add a test to VerifyInfoControllerSpec, but it turned into a downwards spiral.

Where that spiral ended--or at least, where I decided to put this up as WIP PR rather than continuing to dig--is a belief that VerifyInfoController is doing way too much, and that adding to its spec is making it worse. I guess this is not shocking, given that this story stems from removing stuff that's kind of inappropriately in the VerifyInfoConcern which supports that class.

I also realized with some concern that I'm still not completely sure whether this is all getting called in the show or update method. It's happening for me in update but I thought I traced the code to show. The tests around what we're logging is pretty spartan. So my grumpy-pants position right now is that if it historically hasn't been important to assert that ssn_is_unique is logged, I am not going to add that test there as I move the code further away.

Also, the show method is 10 lines, including newlines and simple assignments. Its test is 299 lines.

app/controllers/concerns/idv/verify_info_concern.rb Outdated Show resolved Hide resolved
app/controllers/concerns/idv/verify_info_concern.rb Outdated Show resolved Hide resolved
spec/jobs/resolution_proofing_job_spec.rb Outdated Show resolved Hide resolved
This adds ssn_is_unique, but more significantly pulls a ludicrously
long pattern of lines of nested hashes out because what was there
previously broke my brain trying to change this.
Now that it's not all mashed together, it's easy to realize what
parts are duplicated and clean them up!
spec/features/idv/analytics_spec.rb Outdated Show resolved Hide resolved
attributes_requiring_additional_verification: [],
vendor_name: 'ResolutionMock',
vendor_workflow: nil }
end
Copy link
Member Author

Choose a reason for hiding this comment

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

These two blocks are used in both of the blocks below.

},
},
}
end
Copy link
Member Author

Choose a reason for hiding this comment

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

base_proofing_results and in_person_path_proofing_results were used below, all mashed together incomprehensibly.

I added ssn_is_unique, but this is otherwise the same content, just made more readable.

Copy link
Member

Choose a reason for hiding this comment

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

Cool, I am 👍 on this change

spec/jobs/resolution_proofing_job_spec.rb Outdated Show resolved Hide resolved
changelog: Internal, ResolutionProofingJob, Populate ssn_is_unique
@n1zyy n1zyy changed the title [WIP] LG-13120 | Moves ssn_is_unique logic out of VerifyInfoConcern LG-13120 | Moves ssn_is_unique logic into ResolutionProofingJob Jun 14, 2024
@n1zyy n1zyy marked this pull request as ready for review June 14, 2024 18:55
@n1zyy n1zyy requested a review from a team June 14, 2024 18:55
Copy link
Member

@matthinz matthinz left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for the analytics spec cleanup

},
},
}
end
Copy link
Member

Choose a reason for hiding this comment

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

Cool, I am 👍 on this change

Comment on lines +61 to +63
before do
create(:profile, pii: Idp::Constants::MOCK_IDV_APPLICANT_WITH_SSN)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ thanks for keeping it simple!

@n1zyy n1zyy merged commit bb911e3 into main Jun 18, 2024
2 checks passed
@n1zyy n1zyy deleted the mattw/LG-13120_ssn_is_unique branch June 18, 2024 14:40
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.

4 participants