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

[10-10CG] Add ability to not call fully_validate_schema in SavedClaim #19468

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

coope93
Copy link
Contributor

@coope93 coope93 commented Nov 14, 2024

Summary

  • This work is behind a feature toggle (flipper): YES
  • Added a flipper toggle to allow us to turn off recently added functionality to call the fully_validate_schema in the json-schema gem. This call was added to try to validate the schema without the form content to handle some errors that were being seen, but seems to have potentially introduced another error that's causing the schema file to not be read in the subsequent fully_validate call. This is the only location where we are currently calling fully_validate_schema (we call fully_validate other places), and it is the only one experiencing the issue. This PR adds a flipper toggle that allows us to skip that validation step.
  • 10-10 Health Apps
  • Flipper toggle saved_claim_schema_validation_disable

Related issue(s)

Testing done

  • New code is covered by unit tests

Screenshots

Note: Optional

What areas of the site does it impact?

Any model that inherits from the SavedClaim

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?

@va-vfs-bot va-vfs-bot temporarily deployed to 95897-disable-fully-validate-schema/main/main November 14, 2024 21:39 Inactive
@mjknight50 mjknight50 marked this pull request as ready for review November 15, 2024 13:20
@mjknight50 mjknight50 requested review from a team as code owners November 15, 2024 13:20
mjknight50
mjknight50 previously approved these changes Nov 15, 2024
Copy link
Contributor

@mjknight50 mjknight50 left a comment

Choose a reason for hiding this comment

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

GTG
For context for anyone else taking a look at this --> Brandon and I have been discussing an issue with schema-validation for several days. This PR is an attempt to isolate the difference in behavior between fully_validate_schema and fully_validate

context 'The flipper is turned on' do
before do
Flipper.enable(:dependents_enqueue_with_user_struct)
allow(Flipper).to receive(:enabled?).with(:dependents_enqueue_with_user_struct).and_return(true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change these to stubs instead of actually enabling/disabling the toggle. Added stub at the top to default to original values to handle any that are not stubbed.

@@ -3270,6 +3270,10 @@
end

describe 'contact us' do
before do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were failing because some expectations were validating that some toggle was set and the new Flipper call in saved_claim was expecting it. I added this to default all to call the original so any that don't have explicit expectations won't fail.

@va-vfs-bot va-vfs-bot temporarily deployed to 95897-disable-fully-validate-schema/main/main November 15, 2024 16:46 Inactive
@coope93 coope93 marked this pull request as draft November 15, 2024 17:08
Copy link

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: spec/controllers/v0/contact_us/inquiries_controller_spec.rb

Copy link

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: spec/controllers/v0/contact_us/inquiries_controller_spec.rb

@@ -1107,6 +1107,7 @@ spec/controllers/v0/benefits_reference_data_controller_spec.rb @department-of-ve
spec/controllers/v0/burial_claims_controller_spec.rb @department-of-veterans-affairs/mbs-core-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/caregivers_assistance_claims_controller_spec.rb @department-of-veterans-affairs/vfs-10-10
spec/controllers/v0/claim_letters_controller_spec.rb @department-of-veterans-affairs/benefits-management-tools-be @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/contact_us @department-of-veterans-affairs/ask-va-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently this was missing? The github job flagged it since I had updated one fo the specs in the directory so I went ahead and added the codeowners to match the actual implementation directory.

Copy link
Contributor

@mjknight50 mjknight50 left a comment

Choose a reason for hiding this comment

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

GTG

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.

3 participants