Add nightly sanity check for court codes - #423
Merged
Merged
Conversation
BryceStevenWilley
requested changes
Jul 17, 2026
BryceStevenWilley
left a comment
Collaborator
There was a problem hiding this comment.
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
force-pushed
the
datafieldconfig-required-check
branch
from
July 20, 2026 01:59
360a872 to
1e9a698
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.