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

95727 - Issue with data validation in submission creditorName and spouseFullName/last [FSR] #19058

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

penny-lischer
Copy link
Contributor

@penny-lischer penny-lischer commented Oct 24, 2024

We found out that we are erroring when validating form data that we have mutated. This PR fixes the issue (nil creditorName and spouseFullName/last instead of empty string) and allows us to see what the validation issue was in the logs rather than having to guess/look up in progress forms.

Summary

  • This work is behind a feature toggle (flipper): YES/NO: NO
  • (Summarize the changes that have been made to the platform)
    Fixed issue, added better logging, and added monitor for issue (not in this PR)
  • (If bug, how to reproduce)
1. Copied payload that was erroring from Staging env
2. Ran IPF through transform
    ipf = DebtsApi::V0::FsrFormTransform::FullTransformService.new(full_transform_form)
    output = ipf.transform
3. Ran output through validator
    schema_path = Rails.root.join('lib', 'debt_management_center', 'schemas', 'fsr.json').to_s
    errors = JSON::Validator.fully_validate(schema_path, output)
4. Validated no errors
  • (What is the solution, why is this the solution?)
    Default optional parameters where they are passed in as nil/null and default to ''.
  • (Which team do you work for, does your team own the maintenance of this component?)
    You can find me on OCTO Slack at #debt-resolution
  • *(If introducing a flipper, what is the success criteria being targeted?)*N/A

Related issue(s)

  • Link to ticket created in va.gov-team repo OR screenshot of Jira ticket if your team uses Jira
    95727
  • Link to previous change of the code/bug (if applicable): N/A
  • Link to epic if not included in ticket: N/A

Testing done

  • New code is covered by unit tests
  • Describe what the old behavior was prior to the change
    We were not checking for truthiness and passing a string, we would just pass nil/null on for creditorName and spouseFullName/last
  • Describe the steps required to verify your changes are working as expected. Exclusively stating 'Specs run' is NOT acceptable as appropriate testing
    I've verified the change by running the code above in rails console. We can verify again in staging
  • 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)

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?

Copy link

Backend-review-group approval confirmed.

@digitaldrk digitaldrk merged commit c343926 into master Oct 24, 2024
36 checks passed
@digitaldrk digitaldrk deleted the 95727_creditorName_nil branch October 24, 2024 23:21
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