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 26589 v2 itf request format #12688

Merged
merged 12 commits into from
May 22, 2023

Conversation

rockwellwindsor-va
Copy link
Contributor

@rockwellwindsor-va rockwellwindsor-va commented May 16, 2023

Summary

Updates controller and RSpec tests for new request object format.

Related issue(s)

API-26589

Testing done

RSpec

What areas of the site does it impact?

  • modules/claims_api/app/controllers/claims_api/v2/veterans/intent_to_file_controller.rb
  • modules/claims_api/config/schemas/v2/request_bodies/intent_to_file/example.json
  • modules/claims_api/config/schemas/v2/request_bodies/intent_to_file/request.json
  • /lib/claims_api/v2/params_validation/intent_to_file/intent_to_file_validator.rb
  • modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json
  • modules/claims_api/spec/requests/v2/veterans/intent_to_files_request_spec.rb
  • modules/claims_api/spec/requests/v2/veterans/rswag_intent_to_file_request_spec.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 or Grafana (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

@rockwellwindsor-va rockwellwindsor-va added the claimsApi modules/claims_api label May 16, 2023
@rockwellwindsor-va rockwellwindsor-va marked this pull request as ready for review May 16, 2023 21:40
@rockwellwindsor-va rockwellwindsor-va requested review from a team as code owners May 16, 2023 21:40
@va-vsp-bot va-vsp-bot requested a deployment to API-26589-v2-itf-request-format/main/main May 17, 2023 14:01 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-26589-v2-itf-request-format/main/main May 17, 2023 14:09 Inactive
ryan-mcneil
ryan-mcneil previously approved these changes May 17, 2023
Copy link
Contributor

@ryan-mcneil ryan-mcneil left a comment

Choose a reason for hiding this comment

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

👍 for the extra tests to validate the new, expected format

@va-vsp-bot va-vsp-bot requested a deployment to API-26589-v2-itf-request-format/main/main May 17, 2023 17:50 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-26589-v2-itf-request-format/main/main May 17, 2023 18:02 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-26589-v2-itf-request-format/main/main May 17, 2023 18:24 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-26589-v2-itf-request-format/main/main May 17, 2023 18:56 Inactive
stiehlrod
stiehlrod previously approved these changes May 17, 2023
Copy link
Contributor

@aurora-a-k-a-lightning aurora-a-k-a-lightning 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

@@ -133,7 +142,7 @@ def claimant_ssn_equals_vet_ssn?(options)
end

def get_bgs_type(params)
itf_types[params[:type].downcase]
params[:data] ? itf_types[params[:data][:attributes][:type].downcase] : itf_types[params[:type].downcase]
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I'm late to this party. But this code looks like it could call .downcase on nil, and crash with a undefined method error?

Looks like you have some tests build around that scenario, so maybe the error is raised before it would crash.

  • non-blocking comment, assuming you'll fix it if needed.

Copy link
Contributor

@FonzMP FonzMP May 19, 2023

Choose a reason for hiding this comment

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

^ this is possible. if we don't include attributes and only include type (ex: { data: { type: '' }}), it will throw this nil error. i think we could prevent this in a few ways, but maybe updating validate_request_format is the easiest approach? Ultimately, validate_request! should prevent all of this, if I'm understanding correctly.

@va-vsp-bot va-vsp-bot requested a deployment to API-26589-v2-itf-request-format/main/main May 19, 2023 21:55 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-26589-v2-itf-request-format/main/main May 19, 2023 21:56 Inactive
Copy link
Contributor

@FonzMP FonzMP left a comment

Choose a reason for hiding this comment

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

:shipit:

@rockwellwindsor-va rockwellwindsor-va merged commit f2fcfcf into master May 22, 2023
@rockwellwindsor-va rockwellwindsor-va deleted the API-26589-v2-itf-request-format branch May 22, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
claimsApi modules/claims_api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants