Skip to content

Add nightly sanity check for court codes - #423

Merged
BryceStevenWilley merged 4 commits into
mainfrom
datafieldconfig-required-check
Jul 20, 2026
Merged

Add nightly sanity check for court codes#423
BryceStevenWilley merged 4 commits into
mainfrom
datafieldconfig-required-check

Conversation

@rajeswari1301

Copy link
Copy Markdown
Contributor

Adds a nightly check that catches court configuration problems before they break a real filing, instead of finding out reactively (#373).

Two checks run:

  • whether a court wrongly marks PartyNameSuffix or PartyMiddleName as required in datafieldconfig (there's no such thing as an empty suffix/middle name, so this should never happen)

  • whether our docassemble interviews hardcoded code lookups (eg, "Civil" resolves to 8151) still hold up against live data.

The second one replicates the same search logic the interviews use (ported from docassemble-EFSPIntegration), so it sees exactly what an interview would see, and flags it if a lookup now returns nothing, something different, or something ambiguous.

The lookup checks are seeded from a small maintained list (KnownCodeLookups), currently just 2 entries pulled from docassemble-MotionToStayEviction's efiling.yml - more should be added later on.

Both checks run on their own schedule, a few hours after the existing nightly codes refresh, so a problem in one can't hold up the other and covered by unit tests (matching logic, never-required-fields check) and an integration test against a real ephemeral Postgres instance confirming the full pipeline runs cleanly.

@rajeswari1301 rajeswari1301 changed the title Datafieldconfig required check Add nightly sanity check for court codes Jul 17, 2026

@BryceStevenWilley BryceStevenWilley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall looks great! Don't have any problems with the main approach or class design, but just have a few suggestions to condense things a bit and correct some of the business logic.

The check job now runs 7 mins after the codes refresh instead of 3hrs later. Moved the never-required-fields check out of TylerCodesParser and put it directly in CodesSanityChecker, and moved the knownCodeLookups list in there too. Stopped comparing against the interview's default code, since that's just a backup value and not what we actually expect the search to return - a single match is now treated as fine, nothing gets logged. Ambiguous matches now log a warning instead of an error.
@rajeswari1301
rajeswari1301 force-pushed the datafieldconfig-required-check branch from 360a872 to 1e9a698 Compare July 20, 2026 01:59

@BryceStevenWilley BryceStevenWilley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@BryceStevenWilley
BryceStevenWilley merged commit f84c8b4 into main Jul 20, 2026
4 checks passed
@BryceStevenWilley
BryceStevenWilley deleted the datafieldconfig-required-check branch July 20, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants