Skip to content

Generate the stage pages' examples and bind common accumulators - #4577

Open
evanchooly wants to merge 1 commit into
audits-projectionsfrom
audits-stage-family
Open

evanchooly wants to merge 1 commit into
audits-projectionsfrom
audits-stage-family

Conversation

@evanchooly

Copy link
Copy Markdown
Member

Step 5 of the operator-audit plan. Stacked on #4576.

Problem

  • Stage pages weren't generated. The aggregation/stages family wasn't in generation-review.json, so 41 unowned stage-page examples were never considered.
  • Missing common bindings. Expression examples were still blocked on basics: $limit, $sum, $first, $push, $addToSet, $multiply.
  • A collision. Enabling the family generated $project's "Suppress _id Field in the Output Documents", but a converted legacy case already has that name, and the manifest check failed: "Case listed more than once". The page's title has changed since the fixture was written, and so has the action text, so neither match found the owner.

Change

  • Family: aggregation/stages joins the generated families.

  • Bindings, all verified against core's API:

    • stages: $limit, $skip, $count, $sortByCount;
    • accumulators and expressions: $sum, $avg, $first, $last, $push, $addToSet, $max, $min, $multiply.

    A long parameter takes integer literals.

  • Matching by name. When neither title nor action text matches, the inventory matches an example to the fixture whose folder is its descriptive name (detail: "matched by name"). The name backport named every fixture for its example, so that name identifies it. Seven examples match this way.

  • $bitOr's "Bitwise OR with a Long and Integer" is one of them. A legacy fixture owns it, so the generator's exclusion of it no longer applies and is removed; the page error it recorded stays in Follow up: report two mongodb/docs operator page errors #4563.

Result

12 more generated cases, integrated under both mappers and promoted, for 26 in all:

  • stages: $group, $project ×2, $sort, $unwind, and others;
  • expressions: $addToSet, $first, $push, and others.

The inventory reads 444 owned and 138 unowned. Most remaining gaps are:

  • $type, whose Type constants are named by BSON number, not MQL alias;
  • compound $group _ids;
  • new server operators ($serializeEJSON, $hexHash, ...);
  • database-level commands (db.aggregate(...), 13 on stage pages);
  • projections and arrayFilters.

Decisions for review

  • Match by name only as a fallback. Title, then action text, then name. A name match can't override a title or action match.

Verification

  • New GeneratorTest.aFixtureWithTheExamplesNameOwnsIt.
  • Audits suite: 459 pass under Critter, then reflection.
  • Core operator tests: 704 pass under both mappers.

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

aggregation/stages joins the generated families, with bindings for
$limit, $skip, $count, $sortByCount and the common accumulators. The
inventory also matches an example to the fixture named for it when its
title and action text have changed, which keeps generation from
duplicating a converted case. Twelve more cases are generated,
integrated under both mappers and promoted.

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