Open timcosgrove opened 1 month ago
In order to test the proposed changes (adjusting the sidekiq import script), we'll need to:
bundle exec rake va_forms:fetch_latest_curl
form_tool_url
is empty. (eg: http://5ca93c1d492fccb6f4f8fac75e5591ad-api.review.vetsgov-internal/v0/forms?query=22-5495)Update One challenge we have seen is that the Review Instances and lower environments do not have data parity with production. In the above example, the form is published in the RI but unpublished in production. We have been unable to find another suitable form in the RI. This may make it mandatory to test locally using CMS data that we control.
Changes to resolve this issue were deployed to production today.
@bethpottsVADEPO if you are willing, we could try re-adding the Online tool information to https://prod.cms.va.gov/find-forms/about-form-22-10282, and waiting for a content release, to verify and close?
Closing this ticket as complete. If we find further issues, we can reopen as needed or cut new tickets to track additional issues.
Added the online tool link back onto the form listed in the ticket description as test case. After content release, that data does not appear in Find a form.
Unfortunately, after last night's migration, this no longer validates. The online form tool link appears on https://www.va.gov/find-forms/?q=22-10282, even though the node is stored as Draft:
Reopening. We'll need to revisit the solution.
From planning:
Describe the defect
If a va_form node is in draft state, it is possible for some of its information to appear on Find a VA Form search results anyway.
To Reproduce
It's difficult to reproduce this since it involves the Forms Migration process and it's hard to recreate the situation without actually creating the bug on production. However, this appears to be the chain of events:
On 10/18/2024, the problem and its corresponding ticket were reported to CMS Team: https://github.com/department-of-veterans-affairs/va.gov-cms/issues/19535
Testing
We do have a forms Audit page to find forms in various states: https://prod.cms.va.gov/admin/content/va-forms/audit
AC / Expected behavior
[ ] Find a VA Form should not display data in its search results if that data is contained in a draft va_form node.
Additional context
I believe this problem lies in the GraphQL query that pulls this data from CMS nightly and the code that makes it available via vets-api.
The query that pulls va_forms data from the CMS is here: https://github.com/department-of-veterans-affairs/vets-api/blob/master/modules/va_forms/config/graphql_query.txt
This query selects all va_form nodes it finds regardless of publishing state.
The code that makes use of that data and assigns it to
form_tool_url
appears to be here: https://github.com/department-of-veterans-affairs/vets-api/blob/master/modules/va_forms/app/sidekiq/va_forms/form_builder.rb#L159This code does not appear to take published status into account. Note that
form_details_url
, just above it, does take published status into account, and returns null if the va_form url is not published: https://github.com/department-of-veterans-affairs/vets-api/blob/master/modules/va_forms/app/sidekiq/va_forms/form_builder.rb#L156