Skip to content

Convert the legacy cases whose pages print results the server does not return - #4579

Open
evanchooly wants to merge 1 commit into
audits-delete-unbackedfrom
audits-published-skips
Open

evanchooly wants to merge 1 commit into
audits-delete-unbackedfrom
audits-published-skips

Conversation

@evanchooly

Copy link
Copy Markdown
Member

Toward retiring the legacy loader (step 7). Stacked on #4578.

Problem

After #4578, 16 legacy cases remained, all with a documented source. 11 of them failed only the published check: Morphia's serialization matched the page, and its behavior matched the documented command run through the driver, but the page prints results the server doesn't return. For example, $cos's page prints {_id, angle_a, side_a, hypotenuse}, but $addFields appends side_a last, so the server returns {_id, angle_a, hypotenuse, side_a}.

Change

  • A reviewed published skip. A ledger entry may carry publishedSkip, a reviewed page error with its evidence. Its scenario then gets skipped.published, and the runner skips only the published comparison; serialization and behavior stay strict. FixtureMigration.scenario(migrated) is now the one way to write a ledger case's scenario, so the migration, rescenario, candidate and verification paths all include the skip.
  • Nine cases convert with a recorded page error:
    • $cos ×2 and $sin ×2: the page prints the field $addFields adds before an existing one;
    • $getField ×2: the page prints the fields in an order its own insert doesn't store;
    • $isoWeekYear: a Long printed as 2015, where mongosh prints Long('2015');
    • $bucketAuto ×2: facets printed as area, price, year, where $facet returns the pipeline's order, price, year, area.
  • Two cases use unordered arrays instead (Compare declared result arrays as multisets and convert the $graphLookup cases #4568): $addToSet useInGroupStage (/itemsSold) and $setUnion's accumulator case (/allValues). With a published skip alone, $addToSet's behavior check flaked under reflection, because the server builds the set in no defined order between runs. Declaring the arrays keeps every check strict, and both passed four times in a row.
    • The $setUnion declaration in form-review.json and the $addToSet reference in legacy-references.json carry the reviewed arrays.

Result

384 cases are on the runner and 5 legacy directories remain, the last users of the legacy loader:

  • tan/tangentOfValueInRadians, densify/densifyTimeSeriesData and graphLookup/acrossMultipleCollections: the page's printed results don't parse (typos such as a missing comma);
  • rand/selectRandomItemsFromACollection: the page projects {_id: 0, name: 1, registered: 1}. Morphia writes inclusions before exclusions, and a pinned reference can't declare PROJECT_ID_FIRST;
  • type/queryingByMultipleDataTypes: alternative commands, which conversion doesn't support.

Decisions for review

Verification

  • TestCos, TestSin, TestGetField, TestIsoWeekYear, TestAddToSet, TestSetUnion and TestBucketAuto pass under Critter, then reflection.
  • Core operator tests: 551 pass under both mappers.
  • Audits suite passes under both mappers.

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

…t return

A ledger entry can carry a reviewed page error that skips only the
published check, keeping serialization and behavior strict. Nine cases
convert that way, each with the evidence: printed field orders the
server does not return, a Long printed as a plain number, and facets
printed out of the pipeline's order. The $addToSet and $setUnion cases
declare their set arrays unordered instead, so all their checks stay
strict. Five legacy cases remain.

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