remove encrypted ssn check for ssa call eligibility check#298
remove encrypted ssn check for ssa call eligibility check#298jacobkagon merged 2 commits intotrunkfrom
Conversation
…list of ssa-applicable evidences
WalkthroughRemoved citizenship evidence from SSA evidence keys and tightened SSA eligibility to require only an encrypted SSN. Tests were reorganized into finer-grained contexts to cover SSA and DHS eligibility branches explicitly. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/operations/fdsh/ssa_vlp/rj3/process_applicant_requests.rb(2 hunks)spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-14T19:06:48.270Z
Learnt from: ymhari
Repo: ideacrew/fdsh_gateway PR: 268
File: app/operations/fdsh/ssa_vlp/rj3/ssa/process_verification_response.rb:99-119
Timestamp: 2025-07-14T19:06:48.270Z
Learning: In `app/operations/fdsh/ssa_vlp/rj3/ssa/process_verification_response.rb`, the evidence appending approach in `update_evidences_with_failure` and `update_evidences_with_results` methods is intentionally designed to accumulate evidence entries rather than replace them, as confirmed by ymhari.
Applied to files:
app/operations/fdsh/ssa_vlp/rj3/process_applicant_requests.rbspec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb
📚 Learning: 2025-07-16T13:34:53.451Z
Learnt from: ymhari
Repo: ideacrew/fdsh_gateway PR: 268
File: app/operations/fdsh/ssa_vlp/rj3/vlp/process_verification_response.rb:129-138
Timestamp: 2025-07-16T13:34:53.451Z
Learning: In `app/operations/fdsh/ssa_vlp/rj3/vlp/process_verification_response.rb`, the evidence appending approach in `update_evidences_with_failure` and `update_evidences_with_results` methods is intentionally designed to accumulate evidence entries rather than replace them, as confirmed by ymhari.
Applied to files:
app/operations/fdsh/ssa_vlp/rj3/process_applicant_requests.rbspec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb
🧬 Code graph analysis (1)
spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb (1)
app/operations/fdsh/ssa_vlp/rj3/process_applicant_requests.rb (1)
eligibility(62-64)
🪛 GitHub Actions: RSpec
spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb
[error] 313-313: Trailing whitespace detected. Layout/TrailingWhitespace (Correctable).
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-and-upload-image
🔇 Additional comments (3)
app/operations/fdsh/ssa_vlp/rj3/process_applicant_requests.rb (1)
82-87: LGTM!The simplified eligibility check is clear and correct. SSA invocation now strictly requires an encrypted SSN to be present, which aligns with the PR objective. The early returns for
eligibilityandssa_evidences?are maintained appropriately.spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb (2)
306-341: LGTM!The restructured tests comprehensively cover all branches of
eligible_for_invoking_ssa?:
- With SSA evidences: encrypted SSN present (true) vs absent (false)
- Without SSA evidences (false)
This aligns well with the updated production logic.
352-404: LGTM!The DHS eligibility tests are well-structured with clear nested contexts covering all decision branches: evidence presence, coverage application status, and citizen status. The test expectations correctly mirror the production logic.
spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb (2)
333-341: “No SSA evidences” branch looks correct and focusedThis context cleanly asserts that
eligible_for_invoking_ssa?returnsfalsewhenssa_evidences?isfalse, which matches the expected gating behavior.If you want to make the dependency on
eligibilityexplicit for readability, you could also stubeligibilityhere as you do in the “has SSA evidences” branch, but that’s optional.
352-393: DHS eligibility branches are well-factored and cover key combinationsThe DHS contexts clearly encode the intended rules:
- Requires DHS evidences (
immigration_evidence?true).- Requires the applicant to be applying for coverage.
- Returns
trueonly for a non‑citizen status (e.g.,'alien_lawfully_present'), andfalsefor'us_citizen'.- Returns
falsewhen not applying for coverage.The nested contexts make the decision table easy to read and should help prevent regressions.
As a small optional enhancement, you might add an example for another non‑eligible status (e.g., “not lawfully present”) if such a status exists in your domain, to lock down that behavior too.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-14T19:06:48.270Z
Learnt from: ymhari
Repo: ideacrew/fdsh_gateway PR: 268
File: app/operations/fdsh/ssa_vlp/rj3/ssa/process_verification_response.rb:99-119
Timestamp: 2025-07-14T19:06:48.270Z
Learning: In `app/operations/fdsh/ssa_vlp/rj3/ssa/process_verification_response.rb`, the evidence appending approach in `update_evidences_with_failure` and `update_evidences_with_results` methods is intentionally designed to accumulate evidence entries rather than replace them, as confirmed by ymhari.
Applied to files:
spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb
🧬 Code graph analysis (1)
spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb (1)
app/operations/fdsh/ssa_vlp/rj3/process_applicant_requests.rb (1)
eligibility(62-64)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-and-upload-image
- GitHub Check: rspec
🔇 Additional comments (2)
spec/operations/fdsh/ssa_vlp/rj3/process_applicant_requests_spec.rb (2)
395-405: “No DHS evidences” branch correctly forces ineligibilityThis context verifies that
eligible_for_invoking_dhs?returnsfalsewhenimmigration_evidence?isfalse, even with a valideligibility, which matches the intended gating for DHS calls.No changes needed here.
306-331: The implementation at line 86 ofapp/operations/fdsh/ssa_vlp/rj3/process_applicant_requests.rbstill containsencrypted_ssn.present?, meaning the encrypted SSN check has not been removed. The spec at lines 306-331 correctly reflects the current implementation behavior—returning true when encrypted SSN is present and false when nil. There is no mismatch between the spec and implementation.Likely an incorrect or invalid review comment.
…)" This reverts commit 454cc39.
* only make ssa call when ssn field is present, remove citizenshp from list of ssa-applicable evidences * lint fix
* remove encrypted ssn check for ssa call eligibility check (#298) * only make ssa call when ssn field is present, remove citizenshp from list of ssa-applicable evidences * lint fix * refactor ssa call when no ssn (#301) * allow ssa processor to be called when an applicant is a citizen but lacks an ssn, fail the request in the processor for this case * spec coverage * lint fix * comment clarity * lint fixes --------- Co-authored-by: Jacob Kagon <69021620+jacobkagon@users.noreply.github.com> * query applicant by hbx id (#303) * return success on SSA/VLP request verifications (#307) * return success on SSA/VLP request verifications * rubocop fix --------- Co-authored-by: Charlie Parker <charlie.parker@ideacrew.com> Co-authored-by: Jacob Kagon <69021620+jacobkagon@users.noreply.github.com> Co-authored-by: vishal kalletla <vishuk1201@gmail.com>
Ticket: https://app.clickup.com/t/868gfyb67
Summary by CodeRabbit
Changes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.