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

[ARP PoA submission] (#2) Lighthouse 2122 submission (#99310) #20641

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

pixiitech
Copy link
Contributor

@pixiitech pixiitech commented Feb 5, 2025

This is PR No. 2 of a stack concerning ticket #99310 and #101919
This code handles the methods added to consume the LH API for the form submission and RSpec tests. The controller action, and code that creates our local PowerOfAttorneyFormSubmission object are being moved to the next PR.

Summary

  • This work is behind a feature toggle (flipper): YES/NO Yes

  • (Summarize the changes that have been made to the platform)

  • Updated endpoint for submission of 2122 form to submit decision to Lighthouse

  • (If bug, how to reproduce) feature

  • (What is the solution, why is this the solution?)

  • ⭐ Implement POA Establishment Method In Lighthouse API Client va.gov-team#99310

  • (Which team do you work for, does your team own the maintenance of this component?) ARF

  • (If introducing a flipper, what is the success criteria being targeted?)

Related issue(s)

Testing done

  • New code is covered by unit tests

  • Describe what the old behavior was prior to the change

  • method did not exist

  • Describe the steps required to verify your changes are working as expected. Exclusively stating 'Specs run' is NOT acceptable as appropriate testing

  • If this work is behind a flipper:

    • Tests need to be written for both the flipper on and flipper off scenarios. Docs.
    • What is the testing plan for rolling out the feature?

Screenshots

Note: Optional

What areas of the site does it impact?

(Describe what parts of the site are impacted andifcode touched other areas)
AR portal

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

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?

@pixiitech pixiitech force-pushed the art/101919/lighthouse-api-integration branch from 5cfd7c9 to 490e3d0 Compare February 5, 2025 22:41
@va-vfs-bot va-vfs-bot temporarily deployed to art/101919/lighthouse-api-integration/main/main February 5, 2025 22:47 Inactive
@pixiitech pixiitech changed the title PoA acceptance/LH submission (#101919) (#2) PoA acceptance/LH submission (#101919) Feb 6, 2025
@pixiitech pixiitech force-pushed the art/101919/create-poa-form-submissions branch from 08c3f04 to 760aa9e Compare February 6, 2025 14:43
@pixiitech pixiitech changed the title (#2) PoA acceptance/LH submission (#101919) [ARP PoA submission] (#2) PoA acceptance/LH submission (#101919) Feb 6, 2025
@pixiitech pixiitech force-pushed the art/101919/lighthouse-api-integration branch from 490e3d0 to 2c83434 Compare February 6, 2025 14:52
@va-vfs-bot va-vfs-bot temporarily deployed to art/101919/lighthouse-api-integration/main/main February 6, 2025 14:53 Inactive
@pixiitech pixiitech force-pushed the art/101919/lighthouse-api-integration branch from 2c83434 to fd2c474 Compare February 6, 2025 15:23
@va-vfs-bot va-vfs-bot temporarily deployed to art/101919/lighthouse-api-integration/main/main February 6, 2025 15:24 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to art/101919/lighthouse-api-integration/main/main February 11, 2025 16:55 Inactive
@pixiitech pixiitech force-pushed the art/101919/lighthouse-api-integration branch from bb62f04 to 81c62b8 Compare February 11, 2025 22:24
@va-vfs-bot va-vfs-bot temporarily deployed to art/101919/lighthouse-api-integration/main/main February 11, 2025 22:26 Inactive
@pixiitech pixiitech changed the title [ARP PoA submission] (#2) PoA acceptance/LH submission (#101919) [ARP PoA submission] (#2) Lighthouse 2122 submission (#101919) Feb 11, 2025
@pixiitech pixiitech changed the title [ARP PoA submission] (#2) Lighthouse 2122 submission (#101919) [ARP PoA submission] (#2) Lighthouse 2122 submission (#99310) Feb 11, 2025
Base automatically changed from art/101919/create-poa-form-submissions to master February 12, 2025 15:15
@va-vfs-bot va-vfs-bot temporarily deployed to art/101919/lighthouse-api-integration/main/main February 12, 2025 15:16 Inactive
@pixiitech pixiitech force-pushed the art/101919/lighthouse-api-integration branch from 81c62b8 to 376a2b6 Compare February 12, 2025 16:41
@va-vfs-bot va-vfs-bot temporarily deployed to art/101919/lighthouse-api-integration/main/main February 12, 2025 16:42 Inactive
ojbucao
ojbucao previously approved these changes Feb 13, 2025
@pixiitech pixiitech marked this pull request as ready for review February 13, 2025 21:21
@pixiitech pixiitech requested review from a team as code owners February 13, 2025 21:21
Copy link
Contributor

@nihil2501 nihil2501 left a comment

Choose a reason for hiding this comment

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

Don't use double (which defeats the request from actually happening and getting captured by VCR). Also use full match_requests_on options (e.g. body explained a little here in weirdly organized VCR docs).

Actually, you'd probably run into a really crappy way in which bearer token filtering defeats the headers part of the VCR matching. But this is an example where the headers aren't worth matching because they aren't dynamic in a way that is correlated to the program's input. So you could leave headers out of the matching when that bearer token filtering happens.

Full matching (or as full as you can get) and asserting about the entire response together constitute a test that fully checks inputs and outputs. All this is the best practice way to do VCR based specs (which is why we have a spec helper for default full matching in a forthcoming PR).


context 'successful submit' do
it 'submits the correct data to lighthouse' do
allow(Common::Client::Base).to receive(:configuration).and_return lh_config
Copy link
Contributor

@nihil2501 nihil2501 Feb 14, 2025

Choose a reason for hiding this comment

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

This double is stopping a VCR-mediated request from being made. I think we would completely test this functionality with just using using VCR with strictest request matching and not doing the extra work of making these manual receive expectations.

You can see what is meant by "strictest request matching" here in an spec helper we're adding to the ARP module in an upcoming PR (we have a tiny fix PR that adds body to the request matching which we forgot first time around).

Since this is outside the ARP module (and that code wasn't introduced yet anyway), you could just merge in these VCR options directly:

{ match_requests_on: %i[method uri headers body] }

Then we can remove the double.

expect(lh_config).to receive(:post).with(
'1012666183V089914/2122', expected_data, 'lh_client_id', 'key_path', {}
)
VCR.use_cassette('lighthouse/benefits_claims/power_of_attorney_decision/202_response.yml') do
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor point but removing the .yml extension in cassette name will result in .yml cassette rather than _yml.yml cassette.

context 'rep does not have poa for veteran' do
it 'returns a not_found response' do
@service = BenefitsClaims::Service.new('1012666183V089914')
VCR.use_cassette('lighthouse/benefits_claims/power_of_attorney_decision/404_response.yml') do
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor point but removing the .yml extension in cassette name will result in .yml cassette rather than _yml.yml cassette.

'1012666183V089914/2122', expected_data, 'lh_client_id', 'key_path', {}
)
VCR.use_cassette('lighthouse/benefits_claims/power_of_attorney_decision/202_response.yml') do
@service.submit2122(attributes, 'lh_client_id', 'key_path')
Copy link
Contributor

Choose a reason for hiding this comment

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

We should make a complete assertion about the entire response object and status and stuff here.

@pixiitech pixiitech marked this pull request as draft February 14, 2025 16:54
- Added LH methods for 2122 submit (#99310)
- Testing for LH submit2122
- Added VCR files, rubocop
- allow pass-thru of all attributes
@pixiitech pixiitech force-pushed the art/101919/lighthouse-api-integration branch from 376a2b6 to 4852ce1 Compare February 14, 2025 17:46
@pixiitech pixiitech requested a review from nihil2501 February 14, 2025 17:47
@va-vfs-bot va-vfs-bot temporarily deployed to art/101919/lighthouse-api-integration/main/main February 14, 2025 17:47 Inactive
@pixiitech pixiitech requested a review from ojbucao February 18, 2025 17:52
Copy link
Contributor

@nihil2501 nihil2501 left a comment

Choose a reason for hiding this comment

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

LGTM

@pixiitech pixiitech marked this pull request as ready for review February 19, 2025 03:44
@pixiitech pixiitech merged commit ec00f49 into master Feb 19, 2025
34 of 35 checks passed
@pixiitech pixiitech deleted the art/101919/lighthouse-api-integration branch February 19, 2025 14:56
patrick-brown-oddball pushed a commit that referenced this pull request Feb 24, 2025
* Add LH methods for 2122 submit (#99310)

- Added LH methods for 2122 submit (#99310)
- Testing for LH submit2122
- Added VCR files, rubocop
- allow pass-thru of all attributes

* Changes per Oren review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants