Repository navigation
fix: correct ResultTestEnum typo and migrate persisted data (issue #20) - #34
Merged
Merged
Conversation
Add correctly-spelled INDETERMINATE and mark the misspelled INDERTERMINATED @deprecated rather than deleting it, since Evaluation.result is persisted in MongoDB by enum name with no custom converter -- removing the old constant outright would break reads of any existing document still storing that value. Remove NOT_APPLICABLE, confirmed unused anywhere in the codebase. Add a one-time, idempotent Mongo migration (migrateIndeterminatedResultTypo) that rewrites any persisted evaluation still storing "INDERTERMINATED" to "INDETERMINATE", wired into the existing PostConstruct patcher runner. This also fixes a public API leak: EvaluationService already lowercases the enum name into the FTR JSON-LD resultValue field, so any affected evaluation was being served to API consumers as "indeterminated".
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.
Summary
Fixes the misspelled
ResultTestEnum.INDERTERMINATEDconstant, adding the correctly-spelledINDETERMINATEand migrating existing MongoDB data so the fix is complete rather than just cosmetic.Related Issue
Closes #20
Changes
INDETERMINATEtoResultTestEnum; markedINDERTERMINATED@Deprecatedrather than deleting it, sinceEvaluation.resultis persisted in MongoDB by enum name with no custom converter — removing the old constantoutright would break reads of any existing document still storing that value
NOT_APPLICABLEfrom the enum — confirmed zero usages anywhere in the codebaseINDETERMINATE:FairChampionResponseUtils,QualityOfActionsEvaluator,ComplianceEvaluator,DCSCompletenessEvaluatormigrateIndeterminatedResultTypo) that rewrites any persistedevaluationsdocument withresult: "INDERTERMINATED"to"INDETERMINATE", wired into the existingPostConstructpatcher runner from issue Improve and unify logging #14 (runs automatically on every startup, no-op once nothing matches)EvaluationServicealready doesevaluation.result.name.lowercase()to build the FTR-compliant JSON-LDresultValuefield, so this wasn't just an internal typo — any evaluation stored with the old spelling was being servedto API consumers as
"indeterminated"instead of"indeterminate". The migration fixes that for existing data; the code changes prevent it from happening again.Testing
result: "INDERTERMINATED", started the app, and confirmed the migration log line (Migrated 1 evaluation(s) from 'INDERTERMINATED' to 'INDETERMINATE') appears and the document is rewrittenChecklist
CHANGELOG.mdunder[Unreleased]if this is a user-facing change