Repository navigation
Convert the $topN, $bottomN and $fill named-argument cases - #4567
Open
evanchooly wants to merge 1 commit into
Open
evanchooly wants to merge 1 commit into
evanchooly wants to merge 1 commit into
Conversation
The three cases recorded as legacy-only for key order already declare NAMED_ARGUMENTS, which the server's treatment of named arguments justifies, and on retry they convert and pass under both mappers. The pages order these arguments inconsistently, so changing Morphia's order would break the cases that pass today. Their declarations move to migrated, cutover.json drops them, and the derived catalogs are regenerated.
This branch has not been deployed
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.
Follows up the #4548 finding ("
sortBybeforen"), as you asked. Stacked on #4566.Problem
Three cases were recorded in
cutover.jsonas legacy-only because of a serialization difference in the order of named arguments:topN/computingNBasedOnTheGroupKeyForGroup: the page printsoutput, n, sortBy, and Morphia emitsoutput, sortBy, n;bottomN/computingNBasedOnTheGroupKeyForGroup: the same difference;fill/fillDataForDistinctPartitions: the page printssortBy, partitionBy, output, and Morphia emitspartitionBy, sortBy, output.What I found
$topNexamples, and both other$bottomNexamples, printoutput, sortBy, n, which is what Morphia emits, and they pass today. Reordering Morphia to match these three pages would break those cases.NAMED_ARGUMENTSinform-review.json. That rule exists for exactly this: the server ignores the order of named arguments, so sorted keys are compared on both sides, while nested values such as thesortByspec keep their order.NAMED_ARGUMENTSfrom the$topNscenario makes the test fail with "serialization differs".So the recommended change is the declared rule, not a change to Morphia: these cases leave the legacy path.
Change
scenario.json, andfixture-migration.jsonrecords the moves.declarationstomigratedinform-review.json, andcutover.jsondrops them.manifest.jsonandform-migration.jsonare regenerated. Regeneratingexample-bindings.jsonand the repair inventory left them unchanged.FormMigrationTest's count of open overrides goes from 9 to 6.Verification
TestTopN,TestBottomN,TestFill,GeneratedCasesTestandExampleBindingsTestpass under Critter, then reflection.Self-reviewed only: the independent reviewers are out of quota until 2026-11-26.