Skip to content

Convert or delete the last legacy cases - #4580

Open
evanchooly wants to merge 1 commit into
audits-published-skipsfrom
audits-last-legacy
Open

evanchooly wants to merge 1 commit into
audits-published-skipsfrom
audits-last-legacy

Conversation

@evanchooly

Copy link
Copy Markdown
Member

As you decided: fix what's fixable, delete the rest. Stacked on #4579.

Problem

Five legacy cases kept the legacy fixture loader alive:

  • $type "Querying by Multiple Data Types": the page runs two equivalent commands, $type: [2, 1] and $type: ["string", "double"], and conversion refused declared alternative commands.
  • $rand "Select Random Items From a Collection": the page projects {_id: 0, name: 1, registered: 1}. The test dropped _id with removeIds instead, and Morphia writes exclusions after inclusions anyway; as a pinned reference, the case couldn't declare PROJECT_ID_FIRST.
  • $tan (radians), $densify (time series) and $graphLookup (across collections): the pages' printed results don't parse, because of page typos such as a missing comma or quote.

Change

  • Alternative commands.
    • FormMigration.documented keeps a declared case's other spellings.
    • The scenario carries them as action.alternatives, in the action's own shape, and the declared rule itself no longer appears in the scenario's rules.
    • OperatorCaseRunner requires Morphia's command to equal one documented spelling, strictly and after the declared rules; the reference then runs that spelling.
    • convertible no longer refuses alternatives.
    • $type converts and passes.
  • Added rules on a reference. A ledger entry may carry reviewed addedRules (rules plus reason) for a pinned reference, which declares no rules itself. $rand's body gains .projection().exclude("_id"), a reviewed body edit, and its entry adds PROJECT_ID_FIRST: Morphia writes inclusions before exclusions, and _id's position doesn't change the output.
  • Deleted: the three unparseable cases, recorded in deleted-fixtures.json. The two declared ones also record their already-retired locks' digests, since their overrides are gone. TestTan and TestDensify, left with no tests, are removed.
  • cutover.json now lists no legacy-only cases, and the tests that assumed some construct their own records.

Result

No legacy fixture directory remains: 386 cases are on the runner. The next PR removes the legacy loader's code from TemplatedTestBase.

Verification

  • TestType and TestRand pass under Critter, then reflection.
  • Core operator tests: 548 pass under both mappers.
  • Audits suite passes under both mappers: preservation, frozen catalog, ledger, cutover and manifest.

Self-reviewed only: the independent reviewers are out of quota until 2026-11-26.

$type's multiple-data-types case converts with alternative commands: the
scenario carries the page's other spellings, Morphia's command must equal
one, and the reference runs that one. $rand's case converts after its
body gains the page's _id exclusion and its ledger entry a reviewed
PROJECT_ID_FIRST rule. The three cases whose pages print unparseable
results are deleted and recorded. No legacy fixture directory remains.

This branch has not been deployed

No deployments
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.

1 participant