From acfbc43b537c0b76e323630c1aafc0eebfd8556e Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 10:04:30 -0600 Subject: [PATCH 01/11] CXX-2995 Bump minimum required C Driver version to 1.29.0 --- .../components/funcs/install_c_driver.py | 2 +- .evergreen/generated_configs/functions.yml | 2 +- CHANGELOG.md | 1 + CMakeLists.txt | 6 +++--- etc/cyclonedx.sbom.json | 16 ++++++++-------- etc/make_release.py | 2 +- etc/purls.txt | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.evergreen/config_generator/components/funcs/install_c_driver.py b/.evergreen/config_generator/components/funcs/install_c_driver.py index cd5899b499..ed1e27195f 100644 --- a/.evergreen/config_generator/components/funcs/install_c_driver.py +++ b/.evergreen/config_generator/components/funcs/install_c_driver.py @@ -12,7 +12,7 @@ # - the version of pkg:github/mongodb/mongo-c-driver in etc/purls.txt # - the default value of --c-driver-build-ref in etc/make_release.py # Only LIBMONGOC_DOWNLOAD_VERSION needs to be updated when pinning to an unreleased commit. -MONGOC_VERSION_MINIMUM = '1.28.0' +MONGOC_VERSION_MINIMUM = '1.29.0' class InstallCDriver(Function): diff --git a/.evergreen/generated_configs/functions.yml b/.evergreen/generated_configs/functions.yml index a98ac23d5b..b98a419381 100644 --- a/.evergreen/generated_configs/functions.yml +++ b/.evergreen/generated_configs/functions.yml @@ -307,7 +307,7 @@ functions: type: setup params: updates: - - { key: mongoc_version_minimum, value: 1.28.0 } + - { key: mongoc_version_minimum, value: 1.29.0 } - command: subprocess.exec type: setup params: diff --git a/CHANGELOG.md b/CHANGELOG.md index fab05a10a3..0a9e744b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Changes prior to 3.9.0 are documented as [release notes on GitHub](https://githu ## Changed +- Bump the minimum required C Driver version to [1.29.0](https://github.com/mongodb/mongo-c-driver/releases/tag/1.29.0). - CMake option `ENABLE_TESTS` is now `OFF` by default. - Set `ENABLE_TEST=ON` to re-enable building test targets. - Set `BUILD_TESTING=ON` to include test targets in the "all" target when `ENABLE_TESTS=ON` (since 3.9.0, `OFF` by default). diff --git a/CMakeLists.txt b/CMakeLists.txt index e7ab622e3f..d2af682b4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,12 +49,12 @@ else() endif() # Also update etc/purls.txt. -set(LIBBSON_REQUIRED_VERSION 1.28.0) +set(LIBBSON_REQUIRED_VERSION 1.29.0) set(LIBBSON_REQUIRED_ABI_VERSION 1.0) # Also update etc/purls.txt. -set(LIBMONGOC_REQUIRED_VERSION 1.28.0) -set(LIBMONGOC_DOWNLOAD_VERSION d934cd5de55af65220816e4fd01ce3f9c0ef1cd4) # TODO: update to 1.29.0 once it is released. +set(LIBMONGOC_REQUIRED_VERSION 1.29.0) +set(LIBMONGOC_DOWNLOAD_VERSION 1.29.0) set(LIBMONGOC_REQUIRED_ABI_VERSION 1.0) set(NEED_DOWNLOAD_C_DRIVER false) diff --git a/etc/cyclonedx.sbom.json b/etc/cyclonedx.sbom.json index 16efc9eed8..e5ef1add1b 100644 --- a/etc/cyclonedx.sbom.json +++ b/etc/cyclonedx.sbom.json @@ -1,16 +1,16 @@ { "components": [ { - "bom-ref": "pkg:github/mongodb/mongo-c-driver@v1.28.0", + "bom-ref": "pkg:github/mongodb/mongo-c-driver@v1.29.0", "copyright": "Copyright 2009-present MongoDB, Inc.", "externalReferences": [ { "type": "distribution", - "url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/v1.28.0.tar.gz" + "url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/v1.29.0.tar.gz" }, { "type": "website", - "url": "https://github.com/mongodb/mongo-c-driver/tree/v1.28.0" + "url": "https://github.com/mongodb/mongo-c-driver/tree/v1.29.0" } ], "group": "mongodb", @@ -22,18 +22,18 @@ } ], "name": "mongo-c-driver", - "purl": "pkg:github/mongodb/mongo-c-driver@v1.28.0", + "purl": "pkg:github/mongodb/mongo-c-driver@v1.29.0", "type": "library", - "version": "v1.28.0" + "version": "v1.29.0" } ], "dependencies": [ { - "ref": "pkg:github/mongodb/mongo-c-driver@v1.28.0" + "ref": "pkg:github/mongodb/mongo-c-driver@v1.29.0" } ], "metadata": { - "timestamp": "2024-11-04T17:45:42.970888+00:00", + "timestamp": "2024-11-19T16:09:18.634544+00:00", "tools": [ { "externalReferences": [ @@ -77,7 +77,7 @@ ] }, "serialNumber": "urn:uuid:dd68fbb0-f77c-4bb9-90cd-606dd854f301", - "version": 4, + "version": 5, "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", "bomFormat": "CycloneDX", "specVersion": "1.5", diff --git a/etc/make_release.py b/etc/make_release.py index f2802bfe73..d6cdb6c2f1 100755 --- a/etc/make_release.py +++ b/etc/make_release.py @@ -88,7 +88,7 @@ show_default=True, help='The remote reference which points to the mongodb/mongo-cxx-driver repo') @click.option('--c-driver-build-ref', - default='1.28.0', + default='1.29.0', show_default=True, help='When building the C driver, build at this Git reference') @click.option('--with-c-driver', diff --git a/etc/purls.txt b/etc/purls.txt index 087b355b61..e3f180b5d0 100644 --- a/etc/purls.txt +++ b/etc/purls.txt @@ -6,4 +6,4 @@ # re-generate the SBOM JSON file! # libbson and libmongoc are obtained via cmake/FetchMongoC.cmake. -pkg:github/mongodb/mongo-c-driver@v1.28.0 +pkg:github/mongodb/mongo-c-driver@v1.29.0 From 44d3b8e9df08c66f1eec50b344306411b0ed8338 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 10:59:17 -0600 Subject: [PATCH 02/11] Address -Wdeprecated-declarations warnings for bson_as_json --- src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp index 87001ab831..b1801b77c4 100644 --- a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp +++ b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +37,7 @@ void bson_free_deleter(std::uint8_t* ptr) { bson_free(ptr); } -std::string to_json_helper(document::view view, decltype(bson_as_json) converter) { +std::string to_json_helper(document::view view, char* (*converter)(const bson_t*, std::size_t*)) { bson_t bson; if (!bson_init_static(&bson, view.data(), view.length())) { @@ -61,7 +62,9 @@ std::string to_json_helper(document::view view, decltype(bson_as_json) converter std::string to_json(document::view view, ExtendedJsonMode mode) { switch (mode) { case ExtendedJsonMode::k_legacy: + BSONCXX_SUPPRESS_DEPRECATION_WARNINGS_BEGIN return to_json_helper(view, bson_as_json); + BSONCXX_SUPPRESS_DEPRECATION_WARNINGS_END case ExtendedJsonMode::k_relaxed: return to_json_helper(view, bson_as_relaxed_extended_json); From 7f7b15d95fa33247444edddea1dccc03fc1db8ff Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 11:02:06 -0600 Subject: [PATCH 03/11] Address -Wdeprecated-declarations warnings using recommended alternatives --- src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp index b1801b77c4..0eb5a8dee1 100644 --- a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp +++ b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -62,9 +61,7 @@ std::string to_json_helper(document::view view, char* (*converter)(const bson_t* std::string to_json(document::view view, ExtendedJsonMode mode) { switch (mode) { case ExtendedJsonMode::k_legacy: - BSONCXX_SUPPRESS_DEPRECATION_WARNINGS_BEGIN - return to_json_helper(view, bson_as_json); - BSONCXX_SUPPRESS_DEPRECATION_WARNINGS_END + return to_json_helper(view, bson_as_legacy_extended_json); case ExtendedJsonMode::k_relaxed: return to_json_helper(view, bson_as_relaxed_extended_json); @@ -79,7 +76,7 @@ std::string to_json(document::view view, ExtendedJsonMode mode) { std::string to_json(array::view view, ExtendedJsonMode mode) { switch (mode) { case ExtendedJsonMode::k_legacy: - return to_json_helper(view, bson_array_as_json); + return to_json_helper(view, bson_array_as_legacy_extended_json); case ExtendedJsonMode::k_relaxed: return to_json_helper(view, bson_array_as_relaxed_extended_json); From e21906e41dcc3a79c7bf611518484f853809ef04 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 11:09:41 -0600 Subject: [PATCH 04/11] Revert to using decltype to preserve calling conventions --- src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp index 0eb5a8dee1..1501068856 100644 --- a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp +++ b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp @@ -36,7 +36,7 @@ void bson_free_deleter(std::uint8_t* ptr) { bson_free(ptr); } -std::string to_json_helper(document::view view, char* (*converter)(const bson_t*, std::size_t*)) { +std::string to_json_helper(document::view view, decltype(bson_as_legacy_extended_json) converter) { bson_t bson; if (!bson_init_static(&bson, view.data(), view.length())) { From 76758780577ddb0501d9853f5b7781676a9268b5 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 12:07:31 -0600 Subject: [PATCH 05/11] Update release instructions with instant Augmented SBOM update --- etc/releasing.md | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/etc/releasing.md b/etc/releasing.md index f2035449da..bfad6c8c72 100644 --- a/etc/releasing.md +++ b/etc/releasing.md @@ -160,7 +160,9 @@ Generate an updated Augmented SBOM as described below. Ensure the `silk-check-augmented-sbom` task is passing on Evergreen for the relevant release branch. If it is passing, nothing needs to be done (unless the SBOM Lite was updated as described above). - If the `silk-check-augmented-sbom` task was failing, update the Augmented SBOM document using the following command(s): +#### Regular Update + +Update the Augmented SBOM document using the following command(s): ```bash # Artifactory and Silk credentials. @@ -189,6 +191,47 @@ Update `etc/third_party_vulnerabilities.md` with any updates to new or known vul Commit the latest version of the Augmented SBOM document into the repo as `etc/augmented.sbom.json`. The Augmented SBOM document does not need to be updated if the `silk-check-augmented-sbom` was not failing (in which case the only changes present would a version bump or timestamp update). +#### Instant Update + +If the Augmented SBOM has not yet been updated in time for a release, a temporary Silk Asset Group may be used instead: + +```bash +# Artifactory and Silk credentials. +. $HOME/.secrets/artifactory-creds.txt +. $HOME/.secrets/silk-creds.txt + +# Required to parse JWT Token in authentication response below. +command -V jq + +# Name of the temporary Silk Asset Group. Do NOT use an existing Silk Asset Group! +asset_group_id="mongo-cxx-driver-X.Y.Z-tmp" + +# Output: "Login succeeded!" +podman login --password-stdin --username "${ARTIFACTORY_USER:?}" artifactory.corp.mongodb.com <<<"${ARTIFACTORY_PASSWORD:?}" + +# Ensure latest version of SilkBomb is being used. +podman pull artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 + +# Common flags to podman. +silkbomb_flags=( + --env-file "$HOME/.secrets/silk-creds.txt" + -it --rm -v "$(pwd):/pwd" + artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 +) + +# Create a new and temporary Silk Asset Group. +podman run "${silkbomb_flags[@]:?}" asset-group --asset-cmd create --silk-asset-group "${asset_group_id:?}" --name "${asset_group_id:?}" + +# Upload the SBOM Lite. +podman run "${silkbomb_flags[@]:?}" upload --silk-asset-group "${asset_group_id:?}" -i /pwd/etc/cyclonedx.sbom.json -o /pwd/etc/cyclonedx.sbom.json + +# Download the Augmented SBOM. +podman run "${silkbomb_flags[@]:?}" download --silk-asset-group "${asset_group_id:?}" -o /pwd/etc/augmented.sbom.json + +# Remove the temporary Silk Asset Group. +podman run "${silkbomb_flags[@]:?}" asset-group --asset-cmd delete --silk-asset-group "${asset_group_id:?}" +``` + ### Check Snyk Inspect the list of projects in the latest report for the `mongodb/mongo-cxx-driver` target in [Snyk](https://app.snyk.io/org/dev-prod/). From 0c1fd1fd470e56e27d461aead044b372251d5fb2 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 12:11:03 -0600 Subject: [PATCH 06/11] Update SBOM files with latest dependencies --- etc/augmented.sbom.json | 16 ++++++++-------- etc/cyclonedx.sbom.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/etc/augmented.sbom.json b/etc/augmented.sbom.json index 16efc9eed8..073dbceff4 100644 --- a/etc/augmented.sbom.json +++ b/etc/augmented.sbom.json @@ -1,16 +1,16 @@ { "components": [ { - "bom-ref": "pkg:github/mongodb/mongo-c-driver@v1.28.0", + "bom-ref": "pkg:github/mongodb/mongo-c-driver@v1.29.0", "copyright": "Copyright 2009-present MongoDB, Inc.", "externalReferences": [ { "type": "distribution", - "url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/v1.28.0.tar.gz" + "url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/v1.29.0.tar.gz" }, { "type": "website", - "url": "https://github.com/mongodb/mongo-c-driver/tree/v1.28.0" + "url": "https://github.com/mongodb/mongo-c-driver/tree/v1.29.0" } ], "group": "mongodb", @@ -22,18 +22,18 @@ } ], "name": "mongo-c-driver", - "purl": "pkg:github/mongodb/mongo-c-driver@v1.28.0", + "purl": "pkg:github/mongodb/mongo-c-driver@v1.29.0", "type": "library", - "version": "v1.28.0" + "version": "v1.29.0" } ], "dependencies": [ { - "ref": "pkg:github/mongodb/mongo-c-driver@v1.28.0" + "ref": "pkg:github/mongodb/mongo-c-driver@v1.29.0" } ], "metadata": { - "timestamp": "2024-11-04T17:45:42.970888+00:00", + "timestamp": "2024-11-19T18:14:12.160074+00:00", "tools": [ { "externalReferences": [ @@ -77,7 +77,7 @@ ] }, "serialNumber": "urn:uuid:dd68fbb0-f77c-4bb9-90cd-606dd854f301", - "version": 4, + "version": 5, "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", "bomFormat": "CycloneDX", "specVersion": "1.5", diff --git a/etc/cyclonedx.sbom.json b/etc/cyclonedx.sbom.json index e5ef1add1b..073dbceff4 100644 --- a/etc/cyclonedx.sbom.json +++ b/etc/cyclonedx.sbom.json @@ -33,7 +33,7 @@ } ], "metadata": { - "timestamp": "2024-11-19T16:09:18.634544+00:00", + "timestamp": "2024-11-19T18:14:12.160074+00:00", "tools": [ { "externalReferences": [ From c19e7cab9714443fcd9cf5820541260b3e66f401 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 12:24:12 -0600 Subject: [PATCH 07/11] Remove stray jq command check --- etc/releasing.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/etc/releasing.md b/etc/releasing.md index bfad6c8c72..418ab5cdcf 100644 --- a/etc/releasing.md +++ b/etc/releasing.md @@ -200,9 +200,6 @@ If the Augmented SBOM has not yet been updated in time for a release, a temporar . $HOME/.secrets/artifactory-creds.txt . $HOME/.secrets/silk-creds.txt -# Required to parse JWT Token in authentication response below. -command -V jq - # Name of the temporary Silk Asset Group. Do NOT use an existing Silk Asset Group! asset_group_id="mongo-cxx-driver-X.Y.Z-tmp" From 4e0f583d18273ba3d64f12641d204e1ba9192bff Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 14:30:09 -0600 Subject: [PATCH 08/11] Refactor client-side error detection in unified test runner --- .../test/spec/unified_tests/runner.cpp | 87 ++++++++++--------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/src/mongocxx/test/spec/unified_tests/runner.cpp b/src/mongocxx/test/spec/unified_tests/runner.cpp index b2558d6604..a31d6569d2 100644 --- a/src/mongocxx/test/spec/unified_tests/runner.cpp +++ b/src/mongocxx/test/spec/unified_tests/runner.cpp @@ -866,46 +866,53 @@ void assert_error(const mongocxx::operation_exception& exception, } if (const auto is_client_error = expect_error["isClientError"]) { - if (std::strstr(exception.what(), "Snapshot reads require MongoDB 5.0 or later") != - nullptr) { - // Original error: { MONGOC_ERROR_CLIENT, MONGOC_ERROR_CLIENT_SESSION_FAILURE } - // Do not assert a server-side error. - // The C++ driver throws this error as a server-side error operation_exception. - // Remove this special case as part of CXX-2377. - REQUIRE(is_client_error.get_bool()); - } else if (std::strstr(exception.what(), "The selected server does not support hint for") != - nullptr) { - // Original error: { MONGOC_ERROR_COMMAND, MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION } - // Do not assert a server-side error. - // The C++ driver throws this error as a server-side error operation_exception. - // Remove this special case as part of CXX-2377. - REQUIRE(is_client_error.get_bool()); - } else if (std::strstr(exception.what(), "Error in KMS response") != nullptr) { - REQUIRE(is_client_error.get_bool()); - } else if (std::strstr(exception.what(), - "keyMaterial should have length 96, but has length 84") != nullptr) { - REQUIRE(is_client_error.get_bool()); - } else if (std::strstr(exception.what(), "expected UTF-8 key") != nullptr) { - REQUIRE(is_client_error.get_bool()); - } else if (std::strstr(exception.what(), "Unexpected field: 'invalid'") != nullptr) { - REQUIRE(is_client_error.get_bool()); - } else if (std::strstr(exception.what(), "Failed to resolve kms.invalid.amazonaws.com") != - nullptr) { - REQUIRE(is_client_error.get_bool()); - } else if (std::strstr( - exception.what(), - "The ciphertext refers to a customer master key that does not exist") != - nullptr) { - REQUIRE(is_client_error.get_bool()); - } else if (std::strstr(exception.what(), "does not exist") != nullptr) { - REQUIRE(is_client_error.get_bool()); - } else if (std::strstr(exception.what(), - "Failed to resolve invalid-vault-csfle.vault.azure.net") != - nullptr) { - REQUIRE(is_client_error.get_bool()); - } else if (is_client_error.get_bool()) { - // An operation_exception represents a server-side error. - REQUIRE(!is_client_error.get_bool()); + // An explicit list of client-side errors. We do not yet have a reliable and consistent + // method to distinguish client-side errors from server-side errors. (CXX-2377) + static const bsoncxx::stdx::string_view patterns[] = { + // { MONGOC_ERROR_CLIENT, MONGOC_ERROR_CLIENT_SESSION_FAILURE } + // mongoc: mongoc_cmd_parts_assemble + "Snapshot reads require MongoDB 5.0 or later", + + // { MONGOC_ERROR_COMMAND, MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION } + // mongoc: mongoc_collection_find_and_modify_with_opts, _mongoc_write_command_execute_idl + "The selected server does not support hint for", + + // { MONGOC_ERROR_STREAM, MONGOC_ERROR_STREAM_NAME_RESOLUTION } + // mongoc: mongoc_client_connect_tcp, mongoc_topology_scanner_node_setup_tcp + "Failed to resolve ", + + // { MONGOCRYPT_STATUS_ERROR_CLIENT, MONGOCRYPT_GENERIC_ERROR_CODE } + // libmongocrypt: mongocrypt_kms_ctx_feed + "Error in KMS response", + + // { MONGOCRYPT_STATUS_ERROR_CLIENT, MONGOCRYPT_GENERIC_ERROR_CODE } + // libmongocrypt: mongocrypt_ctx_setopt_key_material + "keyMaterial should have length 96, but has length 84", + + // { MONGOCRYPT_STATUS_ERROR_CLIENT, MONGOCRYPT_GENERIC_ERROR_CODE } + // libmongocrypt: _mongocrypt_parse_optional_utf8, _mongocrypt_parse_required_utf8 + "expected UTF-8 key", + + // { MONGOCRYPT_STATUS_ERROR_CLIENT, MONGOCRYPT_GENERIC_ERROR_CODE } + // libmongocrypt: _mongocrypt_check_allowed_fields + "Unexpected field: 'invalid'", + }; + + const bsoncxx::stdx::string_view message = exception.what(); + + const auto iter = std::find_if( + std::begin(patterns), + std::end(patterns), + [message](bsoncxx::stdx::string_view pattern) { return message.find(pattern) != message.npos; }); + + if (iter != std::end(patterns)) { + // Treat this as a client-side error. + const auto pattern = *iter; + CAPTURE(pattern); + REQUIRE(is_client_error.get_bool().value); + } else { + // Treat this as a server-side error. + REQUIRE(!is_client_error.get_bool().value); } } From e2c792a6bf4a2d9540a4b58bd629d0d0174d981f Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 14:30:21 -0600 Subject: [PATCH 09/11] Add entry for rewrapManyDataKey-encrypt_failure client-side errors --- src/mongocxx/test/spec/unified_tests/runner.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mongocxx/test/spec/unified_tests/runner.cpp b/src/mongocxx/test/spec/unified_tests/runner.cpp index a31d6569d2..a411a1a846 100644 --- a/src/mongocxx/test/spec/unified_tests/runner.cpp +++ b/src/mongocxx/test/spec/unified_tests/runner.cpp @@ -896,6 +896,10 @@ void assert_error(const mongocxx::operation_exception& exception, // { MONGOCRYPT_STATUS_ERROR_CLIENT, MONGOCRYPT_GENERIC_ERROR_CODE } // libmongocrypt: _mongocrypt_check_allowed_fields "Unexpected field: 'invalid'", + + // { MONGOCRYPT_STATUS_ERROR_CLIENT, MONGOCRYPT_GENERIC_ERROR_CODE } + // libmongocrypt: _kms_done + "key material not expected length", }; const bsoncxx::stdx::string_view message = exception.what(); From 28fafa4901ad1a5f4f9215df0ae0ce7638dd8e45 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 14:57:52 -0600 Subject: [PATCH 10/11] Add instruction to schedule C Driver version updates in JIRA --- .../config_generator/components/funcs/install_c_driver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.evergreen/config_generator/components/funcs/install_c_driver.py b/.evergreen/config_generator/components/funcs/install_c_driver.py index ed1e27195f..b1e5bfa507 100644 --- a/.evergreen/config_generator/components/funcs/install_c_driver.py +++ b/.evergreen/config_generator/components/funcs/install_c_driver.py @@ -12,6 +12,8 @@ # - the version of pkg:github/mongodb/mongo-c-driver in etc/purls.txt # - the default value of --c-driver-build-ref in etc/make_release.py # Only LIBMONGOC_DOWNLOAD_VERSION needs to be updated when pinning to an unreleased commit. +# If pinning to an unreleased commit, create a "Blocked" JIRA ticket with +# a "depends on" link to the appropriate C Driver version release ticket. MONGOC_VERSION_MINIMUM = '1.29.0' From bb7b10e494251812c1221f56d4e1f9046fae482f Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 19 Nov 2024 15:20:35 -0600 Subject: [PATCH 11/11] Fix formatting --- src/mongocxx/test/spec/unified_tests/runner.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mongocxx/test/spec/unified_tests/runner.cpp b/src/mongocxx/test/spec/unified_tests/runner.cpp index a411a1a846..d3c024be7d 100644 --- a/src/mongocxx/test/spec/unified_tests/runner.cpp +++ b/src/mongocxx/test/spec/unified_tests/runner.cpp @@ -874,7 +874,8 @@ void assert_error(const mongocxx::operation_exception& exception, "Snapshot reads require MongoDB 5.0 or later", // { MONGOC_ERROR_COMMAND, MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION } - // mongoc: mongoc_collection_find_and_modify_with_opts, _mongoc_write_command_execute_idl + // mongoc: mongoc_collection_find_and_modify_with_opts, + // _mongoc_write_command_execute_idl "The selected server does not support hint for", // { MONGOC_ERROR_STREAM, MONGOC_ERROR_STREAM_NAME_RESOLUTION } @@ -904,10 +905,11 @@ void assert_error(const mongocxx::operation_exception& exception, const bsoncxx::stdx::string_view message = exception.what(); - const auto iter = std::find_if( - std::begin(patterns), - std::end(patterns), - [message](bsoncxx::stdx::string_view pattern) { return message.find(pattern) != message.npos; }); + const auto iter = std::find_if(std::begin(patterns), + std::end(patterns), + [message](bsoncxx::stdx::string_view pattern) { + return message.find(pattern) != message.npos; + }); if (iter != std::end(patterns)) { // Treat this as a client-side error.