Skip to content

DRIVERS-3625 Document db.operation.name discrepancies and add missing covered operations - #1993

Draft
blink1073 wants to merge 9 commits into
mongodb:masterfrom
blink1073:DRIVERS-3625
Draft

blink1073 wants to merge 9 commits into
mongodb:masterfrom
blink1073:DRIVERS-3625

Conversation

@blink1073

@blink1073 blink1073 commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

DRIVERS-3625

Documents the operation names that drivers report for tracing and server selection logging, and why some differ from the underlying server commands. Adds unified tests for both features.

  • Completes the covered-operations table with previously missing operations.
  • Corrects incorrect entries in the covered-operations table.
  • Specifies that server selection logging reports the same operation names as tracing.
  • Adds unified tests for the tracing operation names.
  • Adds unified tests for the server selection logging operation names.

Please complete the following before merging:

  • Is the relevant DRIVERS ticket in the PR title?

operations

Document how the reported operation names relate to the underlying server
commands, complete the OpenTelemetry covered-operations table, and specify
that server selection logging reports the same operation names. Add six
tracing unified tests (schema 1.27), two server selection logging tests
(schema 1.14), and their generated JSON.
operations

Document how the reported operation names relate to the underlying server
commands, complete the OpenTelemetry covered-operations table, and specify
that server selection logging reports the same operation names. Add six
tracing unified tests (schema 1.27), two server selection logging tests
(schema 1.14), and their generated JSON.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The definitive mapping has transaction and optional-API inconsistencies, and some mandated bulk-write branches remain untested.

4 open findings
What changed in this PR

Documents canonical operation names shared by OpenTelemetry tracing and server-selection logging, with unified test coverage.

Changes:

  • Expands and clarifies the covered-operations contract.
  • Adds tracing tests for newly documented operation names.
  • Adds server-selection logging tests for operation names.
File Description
source/​server-selection/​server-selection.md Defines logging operation-name behavior.
source/​server-selection/​tests/​logging/​operation-names.yml Adds standalone logging tests.
source/​server-selection/​tests/​logging/​operation-names.json Generated standalone fixture.
source/​server-selection/​tests/​logging/​operation-names-transactions.yml Adds transaction-related logging tests.
source/​server-selection/​tests/​logging/​operation-names-transactions.json Generated transaction fixture.
source/​open-telemetry/​open-telemetry.md Expands operation-name documentation.
source/​open-telemetry/​tests/​operation/​watch.yml Tests watch tracing.
source/​open-telemetry/​tests/​operation/​watch.json Generated watch fixture.
source/​open-telemetry/​tests/​operation/​run_cursor_command.yml Tests cursor command tracing.
source/​open-telemetry/​tests/​operation/​run_cursor_command.json Generated cursor command fixture.
source/​open-telemetry/​tests/​operation/​run_command.yml Tests generic command tracing.
source/​open-telemetry/​tests/​operation/​run_command.json Generated generic command fixture.
source/​open-telemetry/​tests/​operation/​rename_collection.yml Tests rename tracing.
source/​open-telemetry/​tests/​operation/​rename_collection.json Generated rename fixture.
source/​open-telemetry/​tests/​operation/​count_documents.yml Tests count tracing.
source/​open-telemetry/​tests/​operation/​count_documents.json Generated count fixture.
source/​open-telemetry/​tests/​operation/​collection_bulk_write.yml Tests collection bulk-write naming.
source/​open-telemetry/​tests/​operation/​collection_bulk_write.json Generated bulk-write fixture.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread source/open-telemetry/open-telemetry.md Resolved
Comment thread source/open-telemetry/open-telemetry.md Resolved
Comment thread source/open-telemetry/open-telemetry.md Resolved
Comment thread source/open-telemetry/open-telemetry.md Resolved
…d uniform-model tests, align withTransaction with the fixture

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Logging fixtures can fail during topology discovery, and the covered-operations table contradicts the new withTransaction requirements.

2 open findings
3 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Medium severity Add primary discovery wait before every test operation

source/​server-selection/​tests/​logging/​operation-names-transactions.yml:102

Each unified test case recreates the client, and expected log messages are matched exactly. Unlike the first case, this and the following cases do not wait for primary discovery, so an extra Waiting for suitable server to become available message can make them fail nondeterministically. Add the readiness waitForEvent to every test before its first driver operation.

Medium severity Wait for topology readiness before each test operation

source/​server-selection/​tests/​logging/​operation-names.yml:73

Each unified test case gets a newly created client, and log matching rejects extra messages. Only the first case waits for topology discovery, so this case and every later one can emit Waiting for suitable server to become available between the expected started/succeeded messages. Add the same readiness waitForEvent used by the first case to each subsequent test before invoking the operation.

🧠 Review effort: Balanced

Comment thread source/open-telemetry/open-telemetry.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate test-fixture issues require fixes, including duplicate data, invalid setup, skipped coverage, and missing cursor-ID assertions.

2 open findings
1 resolved since last review

🧠 Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Make the standalone logging fixture setup idempotent before approval.

0 open findings

2 resolved since last review

🧠 Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Add non-zero cursor ID assertions to both spans in the watch tracing fixture.

0 open findings

🧠 Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Fix the unsupported topology requirements in the change-stream fixture before approval.

1 open finding

🧠 Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The run_cursor_command fixture omits the returned collection type field, causing the test to fail.

1 open finding
1 resolved since last review

🧠 Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Test fixtures need seeded cleanup targets, and one comment needs grammatical clarification.

0 open findings

1 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Medium severity Seed rename target collection before cleanup

source/​open-telemetry/​tests/​operation/​rename_collection.yml:23

The rename target is not included in initialData, so on a fresh database the first operation tries to drop a nonexistent test1; drivers that surface NamespaceNotFound will stop before reaching the rename and span assertions. Seed the target collection here (as the existing create_collection.yml fixture does), or otherwise make the cleanup tolerate a missing collection.

Medium severity Seed collections used by cleanup operations

source/​server-selection/​tests/​logging/​operation-names.yml:36

The createCollection and renameCollection cases later drop created-collection and renamed-collection, but neither target is seeded here. On a fresh database those cleanup operations can raise NamespaceNotFound and prevent the operation-name assertions from running. Seed both target collections, following the existing collection-management fixtures.

🧠 Review effort: Lite

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.

2 participants