From 026c92b60cd400d289d720c2f717a2320b64f356 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 7 May 2025 13:56:32 -0700 Subject: [PATCH 01/23] Update spec to allow on-demand client metadata updates for instantiated MongoClients. --- source/mongodb-handshake/handshake.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index bff5d730b7..ff92f00307 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -405,15 +405,25 @@ class DriverInfoOptions { } ``` -Note that how these options are provided to a driver is left up to the implementer. +Note that how these options are provided to a driver during MongoClient initialization is left up to the implementer. -If provided, these options MUST NOT replace the values used for metadata generation. The provided options MUST be +### Metadata updates after MongoClient initialization +Drivers MUST provide an API that allows to append `DriverInfoOptions` to a MongoClient instance after initialization. Drivers MUST +ignore provided `DriverInfoOptions` if the name of the library wrapping the driver already exists in the generated +metadata [client.driver.name](#clientdrivername) field. + +After client metadata update, drivers MUST apply updated metadata to newly created connections and MUST NOT apply +it to already established connections. + +### Appending metadata +If `DriverInfoOptions` are provided during or after driver initialization, these options MUST NOT replace any existing metadata values, +including driver-generated metadata and previously provided options. The provided options MUST be appended to their respective fields, and be delimited by a `|` character. For example, when [Motor](https://www.mongodb.com/docs/drivers/motor/) wraps PyMongo, the following fields are updated to include Motor's "driver info": ```typescript -{ +{ client: { driver: { name: "PyMongo|Motor", @@ -534,6 +544,7 @@ support the `hello` command, the `helloOk: true` argument is ignored and the leg ## Changelog +- 2025-05-07: Add requirement to allow appending to client metadata after MongoClient initialization. - 2024-11-05: Move handshake prose tests from spec file to prose test file. - 2024-10-09: Clarify that FaaS and container metadata must both be populated when both are present. - 2024-08-16: Migrated from reStructuredText to Markdown. From a9eddb4bdb6deb63d6379f91f391466c804b0b1c Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 7 May 2025 14:00:55 -0700 Subject: [PATCH 02/23] Use MongoClient terminology. --- source/mongodb-handshake/handshake.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index ff92f00307..6ae5d76efd 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -416,7 +416,7 @@ After client metadata update, drivers MUST apply updated metadata to newly creat it to already established connections. ### Appending metadata -If `DriverInfoOptions` are provided during or after driver initialization, these options MUST NOT replace any existing metadata values, +If `DriverInfoOptions` are provided during or after MongoClient initialization, these options MUST NOT replace any existing metadata values, including driver-generated metadata and previously provided options. The provided options MUST be appended to their respective fields, and be delimited by a `|` character. For example, when [Motor](https://www.mongodb.com/docs/drivers/motor/) wraps PyMongo, the following fields are updated to include Motor's From 324019d7a2028f9bbe91518ae1c092f7de82b323 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 7 May 2025 22:43:20 -0700 Subject: [PATCH 03/23] Add prose tests. --- source/mongodb-handshake/handshake.md | 4 +- source/mongodb-handshake/tests/README.md | 76 +++++++++++++++++++++++- 2 files changed, 76 insertions(+), 4 deletions(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index 6ae5d76efd..cfe7bb2031 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -408,9 +408,7 @@ class DriverInfoOptions { Note that how these options are provided to a driver during MongoClient initialization is left up to the implementer. ### Metadata updates after MongoClient initialization -Drivers MUST provide an API that allows to append `DriverInfoOptions` to a MongoClient instance after initialization. Drivers MUST -ignore provided `DriverInfoOptions` if the name of the library wrapping the driver already exists in the generated -metadata [client.driver.name](#clientdrivername) field. +Drivers MUST provide an API that allows to append `DriverInfoOptions` to a MongoClient instance after initialization. After client metadata update, drivers MUST apply updated metadata to newly created connections and MUST NOT apply it to already established connections. diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index 02e90f3805..d00b420ed5 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -18,7 +18,7 @@ the following sets of environment variables: 2. Valid Azure | Environment Variable | Value | - | -------------------------- | ------ | + | -------------------------- | ------ | `FUNCTIONS_WORKER_RUNTIME` | `node` | 3. Valid GCP @@ -82,3 +82,77 @@ the following sets of environment variables: 2. Create and connect a `Connection` object that connects to the server that returns the mocked response. 3. Assert that no error is raised. + + +## Client Metadata Update Prose Tests + +The driver **MAY** implement the following tests. Because drivers do not emit command log messages for commands issued +as part of the handshake with the server, drivers will need to create a test-only backdoor mechanism to intercept the +handshake `hello` command for verification purposes. + +### Test 1: Test that the driver updates metadata + +Drivers should verify that client metadata can be updated and is reflected in a `hello` command on a new connection. + +1. Create a `MongoClient` instance with the following: + - `maxIdleTimeMS` set to `1ms` + - Wrapping library metadata: + + | Field | Value | + |----------|------------------| + | name | library | + | version | 1.2 | + | platform | Library Platform | + +2. Send a `ping` command to the server and verify: + - The command succeeds. + - The wrapping library metadata is present in the handshake `hello` command. + +3. Wait 5ms for connection to become idle. + +4. Append the following metadata to the `MongoClient: + + | Field | Value | + |----------|--------------------| + | name | framework | + | version | 2.0 | + | platform | Framework Platform | + +5. Send another `hello` command to the server and verify: + - The command succeeds. + - The updated framework metadata is appended to existing metadata in the handshake `hello` command. + + | Field | Value | + |----------|--------------------------------------| + | name | library\|framework | + | version | 1.2\|2.0 | + | platform | Library Platform\|Framework Platform | + +### Test 2: Test that metadata is not updated on established connections + +Drivers should verify that appending metadata does **not** close existing connections, and that no new `hello` command is sent. + +1. Create a `MongoClient` instance with wrapping library metadata: + + | Field | Value | + |----------|------------------| + | name | library | + | version | 1.2 | + | platform | Library Platform | + +2. Send a `ping` command to the server and verify: + - The command succeeds. + - The wrapping library metadata is present in the initial handshake `hello` command. + +3. Append the following metadata to the `MongoClient: + + | Field | Value | + |----------|--------------------| + | name | framework | + | version | 2.0 | + | platform | Framework Platform | + +4. Send another `ping` command to the server and verify: + - The command succeeds. + - No `hello` command is sent. + - No ConnectionClosedEvent is emitted. From 03b5c1d26fc89811ab213c3246de3ed059e36e00 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Fri, 9 May 2025 16:25:27 -0700 Subject: [PATCH 04/23] Add prose tests. --- source/mongodb-handshake/handshake.md | 14 ++-- source/mongodb-handshake/tests/README.md | 94 +++++++++++++----------- 2 files changed, 61 insertions(+), 47 deletions(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index cfe7bb2031..64435ca451 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -405,18 +405,20 @@ class DriverInfoOptions { } ``` -Note that how these options are provided to a driver during MongoClient initialization is left up to the implementer. +Note that how these options are provided to a driver during `MongoClient` initialization is left up to the implementer. ### Metadata updates after MongoClient initialization + Drivers MUST provide an API that allows to append `DriverInfoOptions` to a MongoClient instance after initialization. -After client metadata update, drivers MUST apply updated metadata to newly created connections and MUST NOT apply -it to already established connections. +After client metadata update, drivers MUST apply updated metadata to newly created connections and MUST NOT apply it to +already established connections. ### Appending metadata -If `DriverInfoOptions` are provided during or after MongoClient initialization, these options MUST NOT replace any existing metadata values, -including driver-generated metadata and previously provided options. The provided options MUST be -appended to their respective fields, and be delimited by a `|` character. For example, when + +If `DriverInfoOptions` are provided during or after MongoClient initialization, these options MUST NOT replace any +existing metadata values, including driver-generated metadata and previously provided options. The provided options MUST +be appended to their respective fields, and be delimited by a `|` character. For example, when [Motor](https://www.mongodb.com/docs/drivers/motor/) wraps PyMongo, the following fields are updated to include Motor's "driver info": diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index d00b420ed5..c0728cb63e 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -18,7 +18,7 @@ the following sets of environment variables: 2. Valid Azure | Environment Variable | Value | - | -------------------------- | ------ + | -------------------------- | ------ | | `FUNCTIONS_WORKER_RUNTIME` | `node` | 3. Valid GCP @@ -83,76 +83,88 @@ the following sets of environment variables: 3. Assert that no error is raised. - ## Client Metadata Update Prose Tests -The driver **MAY** implement the following tests. Because drivers do not emit command log messages for commands issued -as part of the handshake with the server, drivers will need to create a test-only backdoor mechanism to intercept the -handshake `hello` command for verification purposes. +The driver **MAY** implement the following tests. Drivers that do not emit events for commands issued as part of the +handshake with the server will need to create a test-only backdoor mechanism to intercept the handshake `hello` command +for verification purposes. ### Test 1: Test that the driver updates metadata -Drivers should verify that client metadata can be updated and is reflected in a `hello` command on a new connection. +Drivers should verify that metadata provided after `MongoClient` initialization is appended, not replaced, and is +visible in the `hello` command of new connections. 1. Create a `MongoClient` instance with the following: + - `maxIdleTimeMS` set to `1ms` + - Wrapping library metadata: - | Field | Value | - |----------|------------------| - | name | library | - | version | 1.2 | - | platform | Library Platform | + | Field | Value | + | -------- | ---------------- | + | name | library | + | version | 1.2 | + | platform | Library Platform | 2. Send a `ping` command to the server and verify: + - The command succeeds. - - The wrapping library metadata is present in the handshake `hello` command. - -3. Wait 5ms for connection to become idle. + - The wrapping library metadata is appended to the respective `client.driver` fields of the `hello` command. + - Save intercepted `client` document as `initialClientMetadata`. + +3. Wait 5ms for the connection to become idle. -4. Append the following metadata to the `MongoClient: +4. Append the following metadata to the `MongoClient`: - | Field | Value | - |----------|--------------------| - | name | framework | - | version | 2.0 | - | platform | Framework Platform | + | Field | Value | + | -------- | ------------------ | + | name | framework | + | version | 2.0 | + | platform | Framework Platform | + +5. Send `ping` command to the server and verify: -5. Send another `hello` command to the server and verify: - The command succeeds. - - The updated framework metadata is appended to existing metadata in the handshake `hello` command. - | Field | Value | - |----------|--------------------------------------| - | name | library\|framework | - | version | 1.2\|2.0 | - | platform | Library Platform\|Framework Platform | + - The framework metadata is appended to the existing `DriverInfoOptions` in the `client.driver` fields of the `hello` + command. + + | Field | Value | + | -------- | ------------------------------------ | + | name | library\|framework | + | version | 1.2\|2.0 | + | platform | Library Platform\|Framework Platform | + + - All other subfields in the client document remain unchanged from `initialClientMetadata`. ### Test 2: Test that metadata is not updated on established connections -Drivers should verify that appending metadata does **not** close existing connections, and that no new `hello` command is sent. +Drivers should verify that appending metadata after `MongoClient` initialization does **not** close existing +connections, and that no new `hello` command is sent. 1. Create a `MongoClient` instance with wrapping library metadata: - | Field | Value | - |----------|------------------| - | name | library | - | version | 1.2 | - | platform | Library Platform | + | Field | Value | + | -------- | ---------------- | + | name | library | + | version | 1.2 | + | platform | Library Platform | 2. Send a `ping` command to the server and verify: + - The command succeeds. - - The wrapping library metadata is present in the initial handshake `hello` command. + - The wrapping library metadata is appended to the respective `client.driver` fields of the `hello` command. -3. Append the following metadata to the `MongoClient: +3. Append the following metadata to the `MongoClient`: - | Field | Value | - |----------|--------------------| - | name | framework | - | version | 2.0 | - | platform | Framework Platform | + | Field | Value | + | -------- | ------------------ | + | name | framework | + | version | 2.0 | + | platform | Framework Platform | 4. Send another `ping` command to the server and verify: + - The command succeeds. - No `hello` command is sent. - - No ConnectionClosedEvent is emitted. + - No `ConnectionClosedEvent` is emitted. From 450528c2cf156ca85627c54c2d5d1bb36ee1cd58 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Fri, 9 May 2025 18:17:49 -0700 Subject: [PATCH 05/23] Change wording. --- source/mongodb-handshake/tests/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index c0728cb63e..fc93f291fc 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -114,7 +114,7 @@ visible in the `hello` command of new connections. 3. Wait 5ms for the connection to become idle. -4. Append the following metadata to the `MongoClient`: +4. Append the following `DriverInfoOptions` to the `MongoClient` metadata: | Field | Value | | -------- | ------------------ | @@ -155,7 +155,7 @@ connections, and that no new `hello` command is sent. - The command succeeds. - The wrapping library metadata is appended to the respective `client.driver` fields of the `hello` command. -3. Append the following metadata to the `MongoClient`: +3. Append the following `DriverInfoOptions` to the `MongoClient` metadata: | Field | Value | | -------- | ------------------ | From 5ce8b92fceb7363c8ed10f142e857c474fef6dd9 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Fri, 16 May 2025 19:31:26 -0700 Subject: [PATCH 06/23] Replace phrase for correctness. --- source/mongodb-handshake/handshake.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index 64435ca451..163c0651f6 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -409,7 +409,7 @@ Note that how these options are provided to a driver during `MongoClient` initia ### Metadata updates after MongoClient initialization -Drivers MUST provide an API that allows to append `DriverInfoOptions` to a MongoClient instance after initialization. +Drivers MUST provide an API that allows appending `DriverInfoOptions` to a MongoClient instance after initialization. After client metadata update, drivers MUST apply updated metadata to newly created connections and MUST NOT apply it to already established connections. @@ -423,7 +423,7 @@ be appended to their respective fields, and be delimited by a `|` character. For "driver info": ```typescript -{ +{ client: { driver: { name: "PyMongo|Motor", From c6a042bd877d72bfcbf55e51f6aa9ec2c3d2050d Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Sun, 18 May 2025 00:30:49 -0700 Subject: [PATCH 07/23] Add parametrized test-cases. --- source/mongodb-handshake/tests/README.md | 71 ++++++++++++++++++------ 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index fc93f291fc..f15fa25fee 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -94,6 +94,11 @@ for verification purposes. Drivers should verify that metadata provided after `MongoClient` initialization is appended, not replaced, and is visible in the `hello` command of new connections. +There are multiple test cases parameterized with `DriverInfoOptions` to be appended after `MongoClient` initialization. +Before each test case, perform the setup. + +#### Setup + 1. Create a `MongoClient` instance with the following: - `maxIdleTimeMS` set to `1ms` @@ -114,33 +119,67 @@ visible in the `hello` command of new connections. 3. Wait 5ms for the connection to become idle. -4. Append the following `DriverInfoOptions` to the `MongoClient` metadata: +#### Parameterized test cases - | Field | Value | - | -------- | ------------------ | - | name | framework | - | version | 2.0 | - | platform | Framework Platform | +**Case 1** + +| Field | Value | +| -------- | ------------------ | +| name | framework | +| version | 2.0 | +| platform | Framework Platform | + +**Case 2** -5. Send `ping` command to the server and verify: +| Field | Value | +| -------- | --------- | +| name | framework | +| version | 2.0 | +| platform | null | + +**Case 3** + +| Field | Value | +| -------- | ------------------ | +| name | framework | +| version | null | +| platform | Framework Platform | + +**Case 4** + +| Field | Value | +| -------- | --------- | +| name | framework | +| version | null | +| platform | null | + +#### Running a test case + +1. Append the `DriverInfoOptions` from the selected test case to the `MongoClient` metadata. + +2. Send a `ping` command to the server and verify: - The command succeeds. - The framework metadata is appended to the existing `DriverInfoOptions` in the `client.driver` fields of the `hello` - command. + command, with values separated by a pipe `|`. - | Field | Value | - | -------- | ------------------------------------ | - | name | library\|framework | - | version | 1.2\|2.0 | - | platform | Library Platform\|Framework Platform | + - `client.driver.name`: + - If test case's name is non-null: `library|` + - Otherwise, the field remains unchanged: `library` + - `client.driver.version`: + - If test case's version is non-null: `1.2|` + - Otherwise, the field remains unchanged: `1.2` + - `client.driver.platform`: + - If test case's platform is non-null: `Library Platform|` + - Otherwise, the field remains unchanged: `Library Platform` - - All other subfields in the client document remain unchanged from `initialClientMetadata`. + - All other subfields in the `client` document remain unchanged from `initialClientMetadata`. ### Test 2: Test that metadata is not updated on established connections Drivers should verify that appending metadata after `MongoClient` initialization does **not** close existing -connections, and that no new `hello` command is sent. +connections, and that no new `hello` command is sent on existing connections. 1. Create a `MongoClient` instance with wrapping library metadata: @@ -163,7 +202,7 @@ connections, and that no new `hello` command is sent. | version | 2.0 | | platform | Framework Platform | -4. Send another `ping` command to the server and verify: +4. Send a `ping` command to the server and verify: - The command succeeds. - No `hello` command is sent. From e02503b4bd1e344e522995815fe832bc12731d45 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Sun, 18 May 2025 21:37:16 -0700 Subject: [PATCH 08/23] Disallow creating new connections solely to transfer updated metadata. --- source/mongodb-handshake/handshake.md | 5 +++-- source/mongodb-handshake/tests/README.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index 163c0651f6..9a7825daf1 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -411,8 +411,9 @@ Note that how these options are provided to a driver during `MongoClient` initia Drivers MUST provide an API that allows appending `DriverInfoOptions` to a MongoClient instance after initialization. -After client metadata update, drivers MUST apply updated metadata to newly created connections and MUST NOT apply it to -already established connections. +After client metadata update, drivers MUST apply updated metadata to newly created connections. Drivers MUST NOT apply +updated metadata to already established connections, nor create new connections solely for the purpose of transferring +updated metadata. ### Appending metadata diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index f15fa25fee..9bd20bce13 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -179,7 +179,7 @@ Before each test case, perform the setup. ### Test 2: Test that metadata is not updated on established connections Drivers should verify that appending metadata after `MongoClient` initialization does **not** close existing -connections, and that no new `hello` command is sent on existing connections. +connections, and that no new `hello` command is sent. 1. Create a `MongoClient` instance with wrapping library metadata: From 1faef56e97032c944aaf17e1efa7e46f4621fde5 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Tue, 20 May 2025 13:06:00 -0700 Subject: [PATCH 09/23] Split saving of intercepted client document into a distinct step. --- source/mongodb-handshake/tests/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index 9bd20bce13..31b5a29f1b 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -115,9 +115,10 @@ Before each test case, perform the setup. - The command succeeds. - The wrapping library metadata is appended to the respective `client.driver` fields of the `hello` command. - - Save intercepted `client` document as `initialClientMetadata`. -3. Wait 5ms for the connection to become idle. +3. Save intercepted `client` document as `initialClientMetadata`. + +4. Wait 5ms for the connection to become idle. #### Parameterized test cases From 8fc6f1c7647169b6a8fa674a87a21011fb7d3aa2 Mon Sep 17 00:00:00 2001 From: Viacheslav Babanin Date: Tue, 20 May 2025 14:30:33 -0700 Subject: [PATCH 10/23] Update source/mongodb-handshake/handshake.md Co-authored-by: Jeff Yemin --- source/mongodb-handshake/handshake.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index 9a7825daf1..2547887db4 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -412,7 +412,7 @@ Note that how these options are provided to a driver during `MongoClient` initia Drivers MUST provide an API that allows appending `DriverInfoOptions` to a MongoClient instance after initialization. After client metadata update, drivers MUST apply updated metadata to newly created connections. Drivers MUST NOT apply -updated metadata to already established connections, nor create new connections solely for the purpose of transferring +updated metadata to already established connections, create new connections, or close existing connections solely for the purpose of transferring updated metadata. ### Appending metadata From c572c4d717805883bbb65158c336823c046d39d9 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Tue, 20 May 2025 15:28:08 -0700 Subject: [PATCH 11/23] Revert "during MongoClient initialization". --- source/mongodb-handshake/handshake.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index 2547887db4..5ca9692862 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -405,19 +405,19 @@ class DriverInfoOptions { } ``` -Note that how these options are provided to a driver during `MongoClient` initialization is left up to the implementer. +Note that how these options are provided to a driver is left up to the implementer. ### Metadata updates after MongoClient initialization -Drivers MUST provide an API that allows appending `DriverInfoOptions` to a MongoClient instance after initialization. +Drivers MUST provide an API that allows appending `DriverInfoOptions` to a `MongoClient` instance after initialization. After client metadata update, drivers MUST apply updated metadata to newly created connections. Drivers MUST NOT apply -updated metadata to already established connections, create new connections, or close existing connections solely for the purpose of transferring -updated metadata. +updated metadata to already established connections, create new connections, or close existing connections solely for +the purpose of transferring updated metadata. ### Appending metadata -If `DriverInfoOptions` are provided during or after MongoClient initialization, these options MUST NOT replace any +If `DriverInfoOptions` are provided during or after `MongoClient` initialization, these options MUST NOT replace any existing metadata values, including driver-generated metadata and previously provided options. The provided options MUST be appended to their respective fields, and be delimited by a `|` character. For example, when [Motor](https://www.mongodb.com/docs/drivers/motor/) wraps PyMongo, the following fields are updated to include Motor's @@ -545,7 +545,7 @@ support the `hello` command, the `helloOk: true` argument is ignored and the leg ## Changelog -- 2025-05-07: Add requirement to allow appending to client metadata after MongoClient initialization. +- 2025-05-20: Add requirement to allow appending to client metadata after `MongoClient` initialization. - 2024-11-05: Move handshake prose tests from spec file to prose test file. - 2024-10-09: Clarify that FaaS and container metadata must both be populated when both are present. - 2024-08-16: Migrated from reStructuredText to Markdown. From 0b7fbfa453b48b19eb22660ac2741663c04f17b8 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Tue, 20 May 2025 19:19:32 -0700 Subject: [PATCH 12/23] Remove "MAY" from prose tests. --- source/mongodb-handshake/tests/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index 31b5a29f1b..6079d4ca8c 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -85,9 +85,8 @@ the following sets of environment variables: ## Client Metadata Update Prose Tests -The driver **MAY** implement the following tests. Drivers that do not emit events for commands issued as part of the -handshake with the server will need to create a test-only backdoor mechanism to intercept the handshake `hello` command -for verification purposes. +Drivers that do not emit events for commands issued as part of the handshake with the server will need to create a +test-only backdoor mechanism to intercept the handshake `hello` command for verification purposes. ### Test 1: Test that the driver updates metadata From dfde2d12a8dd59efebc9a29b8c010fd0dad40984 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 4 Jun 2025 15:53:11 -0700 Subject: [PATCH 13/23] Add additional test-cases. --- source/mongodb-handshake/tests/README.md | 92 ++++++++++++++++-------- 1 file changed, 62 insertions(+), 30 deletions(-) diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index 6079d4ca8c..42288496d0 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -110,10 +110,7 @@ Before each test case, perform the setup. | version | 1.2 | | platform | Library Platform | -2. Send a `ping` command to the server and verify: - - - The command succeeds. - - The wrapping library metadata is appended to the respective `client.driver` fields of the `hello` command. +2. Send a `ping` command to the server and verify that the command succeeds. 3. Save intercepted `client` document as `initialClientMetadata`. @@ -121,37 +118,72 @@ Before each test case, perform the setup. #### Parameterized test cases -**Case 1** +| Case | Name | Version | Platform | +| ---- | --------- | ------- | ------------------ | +| 1 | framework | 2.0 | Framework Platform | +| 2 | framework | 2.0 | null | +| 3 | framework | null | Framework Platform | +| 4 | framework | null | null | + +#### Running a test case + +1. Append the `DriverInfoOptions` from the selected test case to the `MongoClient` metadata. + +2. Send a `ping` command to the server and verify: + + - The command succeeds. + + - The framework metadata is appended to the existing `DriverInfoOptions` in the `client.driver` fields of the `hello` + command, with values separated by a pipe `|`. + + - `client.driver.name`: + - If test case's name is non-null: `library|` + - Otherwise, the field remains unchanged: `library` + - `client.driver.version`: + - If test case's version is non-null: `1.2|` + - Otherwise, the field remains unchanged: `1.2` + - `client.driver.platform`: + - If test case's platform is non-null: `Library Platform|` + - Otherwise, the field remains unchanged: `Library Platform` + + - All other subfields in the `client` document remain unchanged from `initialClientMetadata`. -| Field | Value | -| -------- | ------------------ | -| name | framework | -| version | 2.0 | -| platform | Framework Platform | +## Test 2: Multiple Successive Metadata Updates -**Case 2** +Drivers should verify that after `MongoClient` initialization, metadata can be updated multiple times, not replaced, and +is visible in the `hello` command of new connections. -| Field | Value | -| -------- | --------- | -| name | framework | -| version | 2.0 | -| platform | null | +There are multiple test cases parameterized with `DriverInfoOptions` to be appended after a previous metadata update. +Before each test case, perform the setup. -**Case 3** +### Setup -| Field | Value | -| -------- | ------------------ | -| name | framework | -| version | null | -| platform | Framework Platform | +1. Create a `MongoClient` instance with: -**Case 4** + - `maxIdleTimeMS` set to `1ms` -| Field | Value | -| -------- | --------- | -| name | framework | -| version | null | -| platform | null | +2. Append the following `DriverInfoOptions` to the `MongoClient` metadata: + + | Field | Value | + | -------- | ---------------- | + | name | library | + | version | 1.2 | + | platform | Library Platform | + +3. Send a `ping` command to the server and verify that the command succeeds. + +4. Save intercepted `client` document as `updatedClientMetadata`. + +5. Wait 5ms for the connection to become idle. + +#### Parameterized test cases + +| Case | Name | Version | Platform | +| ---- | --------- | ------- | ------------------ | +| 1 | framework | 2.0 | Framework Platform | +| 2 | framework | 2.0 | null | +| 3 | framework | null | Framework Platform | +| 4 | framework | null | null | #### Running a test case @@ -174,9 +206,9 @@ Before each test case, perform the setup. - If test case's platform is non-null: `Library Platform|` - Otherwise, the field remains unchanged: `Library Platform` - - All other subfields in the `client` document remain unchanged from `initialClientMetadata`. + - All other subfields in the `client` document remain unchanged from `updatedClientMetadata`. -### Test 2: Test that metadata is not updated on established connections +### Test 3: Test that metadata is not updated on established connections Drivers should verify that appending metadata after `MongoClient` initialization does **not** close existing connections, and that no new `hello` command is sent. From 4be80aa3686b8c9471ce60fa42044ae807b43725 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Fri, 6 Jun 2025 10:07:54 -0700 Subject: [PATCH 14/23] Add API guidance. --- source/mongodb-handshake/handshake.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index 5ca9692862..fa026a07c7 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -405,11 +405,19 @@ class DriverInfoOptions { } ``` -Note that how these options are provided to a driver is left up to the implementer. +Note that how these options are provided to a driver during `MongoClient` initialization is left up to the implementer. ### Metadata updates after MongoClient initialization -Drivers MUST provide an API that allows appending `DriverInfoOptions` to a `MongoClient` instance after initialization. +Drivers MUST provide an API that allows appending `DriverInfoOptions` to a `MongoClient` instance after initialization, +adhering to the pattern described below while following idioms of the language of the driver: + +```java +interface MongoClient { + void appendMetadata(DriverInfoOptions driverInfoOptions); + // other existing members of MongoClient +} +``` After client metadata update, drivers MUST apply updated metadata to newly created connections. Drivers MUST NOT apply updated metadata to already established connections, create new connections, or close existing connections solely for From f0315f4b48fd849209639956698b3f99168340a6 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Fri, 6 Jun 2025 13:29:49 -0700 Subject: [PATCH 15/23] Remove redundant assertions. --- source/mongodb-handshake/tests/README.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index 42288496d0..fe7027546e 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -213,18 +213,9 @@ Before each test case, perform the setup. Drivers should verify that appending metadata after `MongoClient` initialization does **not** close existing connections, and that no new `hello` command is sent. -1. Create a `MongoClient` instance with wrapping library metadata: +1. Create a `MongoClient` instance. - | Field | Value | - | -------- | ---------------- | - | name | library | - | version | 1.2 | - | platform | Library Platform | - -2. Send a `ping` command to the server and verify: - - - The command succeeds. - - The wrapping library metadata is appended to the respective `client.driver` fields of the `hello` command. +2. Send a `ping` command to the server and verify that the command succeeds. 3. Append the following `DriverInfoOptions` to the `MongoClient` metadata: From da284daf41cc862e27aa173fcd5c9725346f8d65 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Mon, 9 Jun 2025 20:54:24 -0700 Subject: [PATCH 16/23] Add unified-tests. --- source/mongodb-handshake/tests/README.md | 23 ----- .../tests/unified/metadata-not-transfered.yml | 56 +++++++++++ .../unified/metadata-not-transferred.json | 99 +++++++++++++++++++ .../unified-test-format.md | 14 +++ 4 files changed, 169 insertions(+), 23 deletions(-) create mode 100644 source/mongodb-handshake/tests/unified/metadata-not-transfered.yml create mode 100644 source/mongodb-handshake/tests/unified/metadata-not-transferred.json diff --git a/source/mongodb-handshake/tests/README.md b/source/mongodb-handshake/tests/README.md index fe7027546e..848c6351fd 100644 --- a/source/mongodb-handshake/tests/README.md +++ b/source/mongodb-handshake/tests/README.md @@ -207,26 +207,3 @@ Before each test case, perform the setup. - Otherwise, the field remains unchanged: `Library Platform` - All other subfields in the `client` document remain unchanged from `updatedClientMetadata`. - -### Test 3: Test that metadata is not updated on established connections - -Drivers should verify that appending metadata after `MongoClient` initialization does **not** close existing -connections, and that no new `hello` command is sent. - -1. Create a `MongoClient` instance. - -2. Send a `ping` command to the server and verify that the command succeeds. - -3. Append the following `DriverInfoOptions` to the `MongoClient` metadata: - - | Field | Value | - | -------- | ------------------ | - | name | framework | - | version | 2.0 | - | platform | Framework Platform | - -4. Send a `ping` command to the server and verify: - - - The command succeeds. - - No `hello` command is sent. - - No `ConnectionClosedEvent` is emitted. diff --git a/source/mongodb-handshake/tests/unified/metadata-not-transfered.yml b/source/mongodb-handshake/tests/unified/metadata-not-transfered.yml new file mode 100644 index 0000000000..c62ddede2d --- /dev/null +++ b/source/mongodb-handshake/tests/unified/metadata-not-transfered.yml @@ -0,0 +1,56 @@ +description: client metadata is not transferred +schemaVersion: '1.9' +runOnRequirements: + - minServerVersion: '6.0' +createEntities: + - client: + id: &client client + observeEvents: + - commandSucceededEvent + - commandFailedEvent + - connectionClosedEvent + - connectionCreatedEvent + - database: + id: &database + client: *client + databaseName: test +tests: + # Test that appending metadata after `MongoClient` initialization does not close existing + # connections, create new ones, and that no new `hello` command is sent. + - description: metadata append does not create new connections or close existing ones and no hello command is sent + operations: + - name: runCommand + object: *database + arguments: + command: + ping: 1 + expectResult: + ok: 1 + - name: appendClientMetadata + object: *client + arguments: + driverInfoOptions: + name: framework + version: '2.0' + platform: Framework Platform + - name: runCommand + object: *database + arguments: + command: + ping: 1 + expectResult: + ok: 1 + expectEvents: + - client: *client + eventType: cmap + events: + # Expect only one connection to be created for the first 'ping' command. + - connectionCreatedEvent: { } + - client: *client + eventType: command + events: + - commandSucceededEvent: + commandName: ping + - commandSucceededEvent: + commandName: ping + diff --git a/source/mongodb-handshake/tests/unified/metadata-not-transferred.json b/source/mongodb-handshake/tests/unified/metadata-not-transferred.json new file mode 100644 index 0000000000..b17dcb7259 --- /dev/null +++ b/source/mongodb-handshake/tests/unified/metadata-not-transferred.json @@ -0,0 +1,99 @@ +{ + "description": "client metadata is not transferred", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "6.0" + } + ], + "createEntities": [ + { + "client": { + "id": "client", + "observeEvents": [ + "commandSucceededEvent", + "commandFailedEvent", + "connectionClosedEvent", + "connectionCreatedEvent" + ] + } + }, + { + "database": { + "id": "database", + "client": "client", + "databaseName": "test" + } + } + ], + "tests": [ + { + "description": "metadata append does not create new connections or close existing ones and no hello command is sent", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "command": { + "ping": 1 + } + }, + "expectResult": { + "ok": 1 + } + }, + { + "name": "appendClientMetadata", + "object": "client", + "arguments": { + "driverInfoOptions": { + "name": "framework", + "version": "2.0", + "platform": "Framework Platform" + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "command": { + "ping": 1 + } + }, + "expectResult": { + "ok": 1 + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCreatedEvent": {} + } + ] + }, + { + "client": "client", + "eventType": "command", + "events": [ + { + "commandSucceededEvent": { + "commandName": "ping" + } + }, + { + "commandSucceededEvent": { + "commandName": "ping" + } + } + ] + } + ] + } + ] +} + diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index 9c8625895f..4ba0e4ebab 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -1311,6 +1311,7 @@ The structure of each object is as follows: When `failureIsRedacted` is present and its value is `true`, the test runner MUST assert that a failure is present and that the failure has been redacted according to the rules defined for error redaction in the [command logging and monitoring specification](../command-logging-and-monitoring/command-logging-and-monitoring.md#security). + When `false`, the test runner MUST assert that a failure is present and that the failure has NOT been redacted. @@ -1491,6 +1492,19 @@ driver behavior when an operation is attempted on a closed client or one of its +#### appendMetadata + +Appends client metadata to the client. + +The following arguments are supported: + +- `driverInfoOptions`: Required object with the following fields: + - `name`: Required string. The name of the wrapping library or framework. + - `version`: Optional string. The version of the wrapping library or framework. + - `platform`: Optional string. The platform of the wrapping library or framework. + +See [handshake](../mongodb-handshake/handshake.md#metadata-updates-after-mongoclient-initialization). + #### createChangeStream Creates a cluster-level change stream and ensures that the server-side cursor has been created. From 72f1150b1d63bde4c5d8b2748324d80604448b94 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Mon, 9 Jun 2025 21:18:26 -0700 Subject: [PATCH 17/23] Update changelog. --- source/mongodb-handshake/handshake.md | 2 +- source/unified-test-format/unified-test-format.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index fa026a07c7..aa5574718e 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -553,7 +553,7 @@ support the `hello` command, the `helloOk: true` argument is ignored and the leg ## Changelog -- 2025-05-20: Add requirement to allow appending to client metadata after `MongoClient` initialization. +- 2025-06-09: Add requirement to allow appending to client metadata after `MongoClient` initialization. - 2024-11-05: Move handshake prose tests from spec file to prose test file. - 2024-10-09: Clarify that FaaS and container metadata must both be populated when both are present. - 2024-08-16: Migrated from reStructuredText to Markdown. diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index 4ba0e4ebab..885248313f 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -3597,6 +3597,8 @@ other specs *and* collating spec changes developed in parallel or during the sam ## Changelog +- 2025-06-09: Add `appendClientMetadata` operation. + - 2025-06-04: Deprecate the `serverless` runOnRequirement - 2025-04-25: Drop `_enxcol` collections. From ae795a6e8cec86952084bc8629cd1fe3c070b2ca Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Mon, 9 Jun 2025 21:19:30 -0700 Subject: [PATCH 18/23] Fix changelog. --- source/unified-test-format/unified-test-format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index 885248313f..f3c2b01347 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -3597,7 +3597,7 @@ other specs *and* collating spec changes developed in parallel or during the sam ## Changelog -- 2025-06-09: Add `appendClientMetadata` operation. +- 2025-06-09: Add `appendMetadata` operation. - 2025-06-04: Deprecate the `serverless` runOnRequirement From a34752be3b96c6f3b98da03955f76c7b6220e9b9 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Mon, 9 Jun 2025 21:23:11 -0700 Subject: [PATCH 19/23] Rename test files. --- ...tadata-not-transferred.json => metadata-not-propagated.json} | 2 +- ...{metadata-not-transfered.yml => metadata-not-propagated.yml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename source/mongodb-handshake/tests/unified/{metadata-not-transferred.json => metadata-not-propagated.json} (96%) rename source/mongodb-handshake/tests/unified/{metadata-not-transfered.yml => metadata-not-propagated.yml} (96%) diff --git a/source/mongodb-handshake/tests/unified/metadata-not-transferred.json b/source/mongodb-handshake/tests/unified/metadata-not-propagated.json similarity index 96% rename from source/mongodb-handshake/tests/unified/metadata-not-transferred.json rename to source/mongodb-handshake/tests/unified/metadata-not-propagated.json index b17dcb7259..58a622fafa 100644 --- a/source/mongodb-handshake/tests/unified/metadata-not-transferred.json +++ b/source/mongodb-handshake/tests/unified/metadata-not-propagated.json @@ -1,5 +1,5 @@ { - "description": "client metadata is not transferred", + "description": "client metadata is not propagated to the server", "schemaVersion": "1.9", "runOnRequirements": [ { diff --git a/source/mongodb-handshake/tests/unified/metadata-not-transfered.yml b/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml similarity index 96% rename from source/mongodb-handshake/tests/unified/metadata-not-transfered.yml rename to source/mongodb-handshake/tests/unified/metadata-not-propagated.yml index c62ddede2d..fdb111b290 100644 --- a/source/mongodb-handshake/tests/unified/metadata-not-transfered.yml +++ b/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml @@ -1,4 +1,4 @@ -description: client metadata is not transferred +description: client metadata is not propagated to the server schemaVersion: '1.9' runOnRequirements: - minServerVersion: '6.0' From 43dea26ae75c326b5c723cbf1f13c452350e2f99 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Mon, 9 Jun 2025 22:02:03 -0700 Subject: [PATCH 20/23] Fix database name. --- .../tests/unified/metadata-not-propagated.json | 5 ++--- .../tests/unified/metadata-not-propagated.yml | 4 ++-- source/unified-test-format/unified-test-format.md | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/source/mongodb-handshake/tests/unified/metadata-not-propagated.json b/source/mongodb-handshake/tests/unified/metadata-not-propagated.json index 58a622fafa..2d14f84e15 100644 --- a/source/mongodb-handshake/tests/unified/metadata-not-propagated.json +++ b/source/mongodb-handshake/tests/unified/metadata-not-propagated.json @@ -28,7 +28,7 @@ ], "tests": [ { - "description": "metadata append does not create new connections or close existing ones and no hello command is sent", + "description": "metadata append does not create new connections or close existing ones and no hello command is sent", "operations": [ { "name": "runCommand", @@ -43,7 +43,7 @@ } }, { - "name": "appendClientMetadata", + "name": "appendMetadata", "object": "client", "arguments": { "driverInfoOptions": { @@ -96,4 +96,3 @@ } ] } - diff --git a/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml b/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml index fdb111b290..71b96c1c7a 100644 --- a/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml +++ b/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml @@ -11,7 +11,7 @@ createEntities: - connectionClosedEvent - connectionCreatedEvent - database: - id: &database + id: &database database client: *client databaseName: test tests: @@ -26,7 +26,7 @@ tests: ping: 1 expectResult: ok: 1 - - name: appendClientMetadata + - name: appendMetadata object: *client arguments: driverInfoOptions: diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index f3c2b01347..1db97a8fa9 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -1311,7 +1311,6 @@ The structure of each object is as follows: When `failureIsRedacted` is present and its value is `true`, the test runner MUST assert that a failure is present and that the failure has been redacted according to the rules defined for error redaction in the [command logging and monitoring specification](../command-logging-and-monitoring/command-logging-and-monitoring.md#security). - When `false`, the test runner MUST assert that a failure is present and that the failure has NOT been redacted. From 944329d4e1521235f429f02f69fdaa1e8325a972 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 11 Jun 2025 23:15:57 -0700 Subject: [PATCH 21/23] Add commandName "ping" to runCommand arguments. --- .../tests/unified/metadata-not-propagated.json | 2 ++ .../mongodb-handshake/tests/unified/metadata-not-propagated.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/source/mongodb-handshake/tests/unified/metadata-not-propagated.json b/source/mongodb-handshake/tests/unified/metadata-not-propagated.json index 2d14f84e15..500b579b89 100644 --- a/source/mongodb-handshake/tests/unified/metadata-not-propagated.json +++ b/source/mongodb-handshake/tests/unified/metadata-not-propagated.json @@ -34,6 +34,7 @@ "name": "runCommand", "object": "database", "arguments": { + "commandName": "ping", "command": { "ping": 1 } @@ -57,6 +58,7 @@ "name": "runCommand", "object": "database", "arguments": { + "commandName": "ping", "command": { "ping": 1 } diff --git a/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml b/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml index 71b96c1c7a..4ff911a739 100644 --- a/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml +++ b/source/mongodb-handshake/tests/unified/metadata-not-propagated.yml @@ -22,6 +22,7 @@ tests: - name: runCommand object: *database arguments: + commandName: ping command: ping: 1 expectResult: @@ -36,6 +37,7 @@ tests: - name: runCommand object: *database arguments: + commandName: ping command: ping: 1 expectResult: From 37456ca24083899ad68602cda2e65ceeaf0fa9b9 Mon Sep 17 00:00:00 2001 From: Viacheslav Babanin Date: Fri, 13 Jun 2025 12:43:03 -0700 Subject: [PATCH 22/23] Update source/unified-test-format/unified-test-format.md Co-authored-by: Andreas Braun --- source/unified-test-format/unified-test-format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index 1db97a8fa9..2853ea3e03 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -1502,7 +1502,7 @@ The following arguments are supported: - `version`: Optional string. The version of the wrapping library or framework. - `platform`: Optional string. The platform of the wrapping library or framework. -See [handshake](../mongodb-handshake/handshake.md#metadata-updates-after-mongoclient-initialization). +See the [handshake spec](../mongodb-handshake/handshake.md#metadata-updates-after-mongoclient-initialization) for more details. #### createChangeStream From c77aa66c68bcad11335306b96e6536b146941ed0 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Mon, 16 Jun 2025 15:31:48 -0700 Subject: [PATCH 23/23] Fix formatting in unified-test-format.md --- source/unified-test-format/unified-test-format.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index 2853ea3e03..c49fff02e5 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -1502,7 +1502,8 @@ The following arguments are supported: - `version`: Optional string. The version of the wrapping library or framework. - `platform`: Optional string. The platform of the wrapping library or framework. -See the [handshake spec](../mongodb-handshake/handshake.md#metadata-updates-after-mongoclient-initialization) for more details. +See the [handshake spec](../mongodb-handshake/handshake.md#metadata-updates-after-mongoclient-initialization) for more +details. #### createChangeStream