department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
99 stars 69 forks source link

Find a VA Form results may display draft va_form information in some circumstances #19545

Open timcosgrove opened 1 month ago

timcosgrove commented 1 month ago

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:

  1. On 3/30/2023, VA Form 22-10282 was added as part of the Forms Migration process. As part of that, a draft va_forms page was created for the form: https://prod.cms.va.gov/find-forms/about-form-22-10282. The initial revision is this: https://prod.cms.va.gov/node/54762/revisions/760078/view
  2. On 10/15/2024, a URL was added for the 'Online Tool' field: https://prod.cms.va.gov/node/54762/revisions/view/919381/925176/visual_inline . The va_form node was still in draft and had never been published.
  3. On 10/17/2024, Beth Potts observed that the URL for Online Tool (known as the "action link") was displaying in search results for this form: https://www.va.gov/find-forms/?q=skillsbuild . We unfortunately do not have screenshots of this.
  4. On 10/17/2024, Beth Potts removed the URL from the va_form node. The node was still in draft and had never been published. https://prod.cms.va.gov/node/54762/revisions/view/925178/926038/visual_inline
  5. On 10/18/2024, Beth Potts and others observed that the action link was no longer appearing in the search results at https://www.va.gov/find-forms/?q=skillsbuild.

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

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#L159

This 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

dsasser commented 3 weeks ago

Testing notes

In order to test the proposed changes (adjusting the sidekiq import script), we'll need to:

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.

jilladams commented 3 weeks ago

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?

jilladams commented 2 weeks ago

Closing this ticket as complete. If we find further issues, we can reopen as needed or cut new tickets to track additional issues.

jilladams commented 2 weeks ago

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. Image Image

jilladams commented 2 weeks ago

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:

Image

Reopening. We'll need to revisit the solution.

jilladams commented 2 weeks ago

From planning: