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

API-45023-recache-mpi-after-icn #20798

Merged
merged 6 commits into from
Feb 18, 2025

Conversation

rockwellwindsor-va
Copy link
Contributor

@rockwellwindsor-va rockwellwindsor-va commented Feb 13, 2025

Summary

  • re caches MPI data once we have the ICN
  • adds method to enable re fetching the cache on MPI data
  • adds flipper for add_person_proxy update
    *. Adjusts related tests

Related issue(s)

API-45023

Testing done

  • New code is covered by unit tests

Testing Notes

  • This is perhaps more easily seen via manual testing
  • To test manually send in a v1 request (2122 and 526 were both tested locally by me, any should work though)
  • Place a debugger to stop the app flow inside the veteran_from_headers method before recache_mpi_data is called
  • Observe the redis cache that there is a key related to the veteran in the headers, the key should use the SSN as it value so something like this should exist (change the SSN based on your test veteran)
    • KEYS * => mpi-profile-response:796127677 , where 796127677 is the SSN of your test veteran
    • Then allow the app to continue to run through its workflow
    • AFTER recache_mpi_data gets called you should have a new key in Redis for the same test veteran in the headers but this one should have the ICN as its key
    • KEYS * => mpi-profile-response:1012861229V078999
    • Once you have that key then you can test the add_person_proxy gets called and is successful.
  • Testing add_person_proxy
    • You need to get the value of the Redis cache and remove the participant_id from it.
    • GET mpi-profile-response:1012861229V078999
    • Remove the participant ID from the object (I left in the "" but either should work)
    • copy that object with participant_id removed
    • SET mpi-profile-response:1012861229V078999 <object with participant_id removed pasted here>
    • Now when you run the same submit you can observe that the headers workflow gets called and built
    • After recache_mpi_data gets called make sure to verify the Redis cache is still missing the participant ID, if it has it just re set it again without it.
    • Debugging inside validate_veteran_identifiers you should be able to see it get to line 88.
    • Debugging after line 88 you should see a successful response and observe the Redis cache has the participant ID.
    • Allow the workflow to continue and it should proceed past the application controller into whatever form you submitted to.

What areas of the site does it impact?

modified:   modules/claims_api/app/controllers/claims_api/v1/application_controller.rb
modified:   modules/claims_api/app/models/claims_api/veteran.rb

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?

* WIP
	* re caches MPI data once we have the ICN
	* adds method to enable re fetching the cache on MPI data
 Changes to be committed:
	modified:   modules/claims_api/app/controllers/claims_api/v1/application_controller.rb
	modified:   modules/claims_api/app/models/claims_api/veteran.rb
@va-vfs-bot va-vfs-bot temporarily deployed to API-45023-recache-mpi-after-icn/main/main February 13, 2025 22:10 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to API-45023-recache-mpi-after-icn/main/main February 13, 2025 22:12 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to API-45023-recache-mpi-after-icn/main/main February 14, 2025 14:00 Inactive
* Adds call to recache MPI data when building from headers after we have the ICN
* Adds test that new method is called
* Clean up
	Cleans up a comment line from another file that was not necessary
	modified:   modules/claims_api/app/controllers/claims_api/v1/application_controller.rb
	new file:   modules/claims_api/spec/controllers/v1/application_controller_spec.rb
	modified:   modules/claims_api/spec/controllers/v1/disability_compensation_controller_spec.rb
@rockwellwindsor-va rockwellwindsor-va added the claimsApi modules/claims_api label Feb 17, 2025
@va-vfs-bot va-vfs-bot temporarily deployed to API-45023-recache-mpi-after-icn/main/main February 17, 2025 14:59 Inactive
@rockwellwindsor-va rockwellwindsor-va marked this pull request as ready for review February 17, 2025 15:09
@rockwellwindsor-va rockwellwindsor-va requested a review from a team as a code owner February 17, 2025 15:09
@rockwellwindsor-va rockwellwindsor-va marked this pull request as draft February 17, 2025 15:10
* Adds flipper for `add_person_proxy` update
* Adjusts related tests
	modified:   config/features.yml
	modified:   modules/claims_api/app/controllers/claims_api/v1/application_controller.rb
	modified:   modules/claims_api/spec/controllers/v1/application_controller_spec.rb
	modified:   modules/claims_api/spec/requests/v1/forms/2122_spec.rb
	modified:   modules/claims_api/spec/requests/v1/forms/526_spec.rb
@va-vfs-bot va-vfs-bot temporarily deployed to API-45023-recache-mpi-after-icn/main/main February 17, 2025 15:55 Inactive
@rockwellwindsor-va rockwellwindsor-va marked this pull request as ready for review February 17, 2025 16:00
@rockwellwindsor-va rockwellwindsor-va requested review from a team as code owners February 17, 2025 16:00
@va-vfs-bot va-vfs-bot temporarily deployed to API-45023-recache-mpi-after-icn/main/main February 18, 2025 15:35 Inactive
Copy link
Contributor

@stiehlrod stiehlrod left a comment

Choose a reason for hiding this comment

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

Saw the redis cache before and after the new re-cache method. LGTM

@rockwellwindsor-va rockwellwindsor-va merged commit b0f0159 into master Feb 18, 2025
22 of 23 checks passed
@rockwellwindsor-va rockwellwindsor-va deleted the API-45023-recache-mpi-after-icn branch February 18, 2025 23:05
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.

4 participants