Skip to content

Conversation

@qingyang-hu
Copy link
Collaborator

@qingyang-hu qingyang-hu commented Dec 10, 2025

GODRIVER-3540

Summary

  • Add Prefix/Suffix/Substring Indexes. (dea5746)
  • Add a new task for client side encryption prose tests. (915f59e)

Background & Motivation

@mongodb-drivers-pr-bot
Copy link
Contributor

mongodb-drivers-pr-bot bot commented Dec 10, 2025

🧪 Performance Results

Commit SHA: 915f59e

The following benchmark tests for version 6945d3323f89b900076a2759 had statistically significant changes (i.e., |z-score| > 1.96):

Benchmark Measurement % Change Patch Value Stable Region H-Score Z-Score
BenchmarkBSONDeepDocumentDecoding ops_per_second_min -62.8161 796.5842 Avg: 2142.2831
Med: 2140.4239
Stdev: 223.9171
0.9071 -6.0098
BenchmarkBSONFlatDocumentEncoding ops_per_second_min -41.1528 2059.1893 Avg: 3499.2112
Med: 3611.8556
Stdev: 573.2363
0.7892 -2.5121
BenchmarkSingleFindOneByID ops_per_second_min 31.2379 1545.3681 Avg: 1177.5316
Med: 1218.6958
Stdev: 171.1895
0.7439 2.1487
BenchmarkBSONDeepDocumentEncoding ops_per_second_min 30.8261 4460.5619 Avg: 3409.5348
Med: 3423.8432
Stdev: 505.4244
0.7443 2.0795
BenchmarkSingleFindOneByID allocated_bytes_per_op -0.1613 22423.0000 Avg: 22459.2174
Med: 22458.0000
Stdev: 18.4197
0.7143 -1.9662
BenchmarkBSONFullDocumentDecoding allocated_bytes_per_op 0.0337 25331.0000 Avg: 25322.4722
Med: 25321.0000
Stdev: 4.0672
0.7952 2.0967

For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch.

@mongodb-drivers-pr-bot
Copy link
Contributor

API Change Report

./v2/mongo/options

compatible changes

(*EncryptOptionsBuilder).SetTextOptions: added
EncryptOptions.TextOptions: added
PrefixOptions: added
SubstringOptions: added
SuffixOptions: added
Text: added
TextOptions: added
TextOptionsBuilder: added

./v2/x/mongo/driver/mongocrypt/options

compatible changes

(*ExplicitEncryptionOptions).SetTextOptions: added
ExplicitEncryptionOptions.TextOptions: added
ExplicitTextOptions: added
PrefixOptions: added
SubstringOptions: added
SuffixOptions: added

@github-actions github-actions bot added the review-priority-normal Medium Priority PR for Review: within 1 business day label Dec 12, 2025
@qingyang-hu qingyang-hu force-pushed the godriver3540 branch 18 times, most recently from 07ccbf6 to 78de09d Compare December 19, 2025 20:30
Comment on lines -505 to -519
run-kms-tls-test:
- command: subprocess.exec
params:
binary: "bash"
env:
GO_BUILD_TAGS: cse
include_expansions_in_env: [AUTH, SSL, MONGODB_URI, TOPOLOGY, MONGO_GO_DRIVER_COMPRESSOR]
args: [*task-runner, setup-test]
- command: subprocess.exec
type: test
retry_on_failure: true
params:
binary: "bash"
include_expansions_in_env: [KMS_TLS_TESTCASE]
args: [*task-runner, evg-test-kms]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Merged into run-client-side-encryption-test.

Comment on lines -1411 to -1440
- name: "test-kms-tls-invalid-cert"
tags: ["kms-test"]
commands:
- func: bootstrap-mongo-orchestration
vars:
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"
- func: start-cse-servers
- func: run-kms-tls-test
vars:
KMS_TLS_TESTCASE: "INVALID_CERT"
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"
- name: "test-kms-tls-invalid-hostname"
tags: ["kms-test"]
commands:
- func: bootstrap-mongo-orchestration
vars:
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"
- func: start-cse-servers
- func: run-kms-tls-test
vars:
KMS_TLS_TESTCASE: "INVALID_HOSTNAME"
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Merged into run-client-side-encryption-test.

Comment on lines -24 to -27
assume-test-secrets-ec2-role:
- command: ec2.assume_role
params:
role_arn: ${aws_test_secrets_role}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A duplicate of L565.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copied from "specifications/source/client-side-encryption/etc/data/encryptedFields-prefix-suffix.json"

@qingyang-hu qingyang-hu marked this pull request as ready for review December 19, 2025 21:38
Copilot AI review requested due to automatic review settings December 19, 2025 21:38
@qingyang-hu qingyang-hu requested a review from a team as a code owner December 19, 2025 21:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for Prefix/Suffix/Substring indexes in client-side encryption (queryable encryption) and consolidates client-side encryption prose test infrastructure into a single task.

  • Adds new TextOptions, SubstringOptions, PrefixOptions, and SuffixOptions types to support text query indexes
  • Implements BSON document construction for text options in the mongocrypt context
  • Consolidates multiple KMS test tasks into a unified client-side encryption test task

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
mongo/options/encryptoptions.go Adds TextOptions types and builder pattern for configuring prefix, suffix, and substring query options
x/mongo/driver/mongocrypt/options/mongocrypt_context_options.go Adds internal TextOptions types mirroring the public API options
x/mongo/driver/mongocrypt/mongocrypt.go Implements BSON document construction and C API calls for text encryption options
mongo/client_encryption.go Transforms public TextOptions to internal mongocrypt options format
testdata/client-side-encryption-prose/encryptedFields-prefix-suffix.json Adds test data configuration for prefix and suffix query testing
internal/integration/client_side_encryption_prose_test.go Adds comprehensive test cases for prefix, suffix, and substring query operations; refactors KMS TLS tests to run all mock servers in parallel
internal/spectest/skip.go Removes skip entries for now-supported text index tests
Taskfile.yml Consolidates multiple client-side encryption test tasks into single evg-test-client-side-encryption task
.evergreen/config.yml Removes individual KMS test tasks and functions in favor of unified client-side-encryption-test task

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qingyang-hu qingyang-hu marked this pull request as draft December 19, 2025 21:57
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@qingyang-hu qingyang-hu requested a review from Copilot December 19, 2025 22:17

This comment was marked as outdated.

@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 19, 2025
@qingyang-hu qingyang-hu requested a review from Copilot December 19, 2025 22:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to +36
"keyId": {
"$binary": {
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
"subType": "04"
}
},
"path": "encryptedText",
"bsonType": "string",
"queries": [
{
"queryType": "prefixPreview",
"strMinQueryLength": {
"$numberInt": "2"
},
"strMaxQueryLength": {
"$numberInt": "10"
},
"caseSensitive": true,
"diacriticSensitive": true
},
{
"queryType": "suffixPreview",
"strMinQueryLength": {
"$numberInt": "2"
},
"strMaxQueryLength": {
"$numberInt": "10"
},
"caseSensitive": true,
"diacriticSensitive": true
}
]
}
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The indentation in this JSON file is inconsistent. The first field object starting at line 3 has excessive indentation (12 spaces) compared to standard JSON formatting (typically 2 or 4 spaces per level). This should be corrected to maintain consistent formatting throughout the file.

Suggested change
"keyId": {
"$binary": {
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
"subType": "04"
}
},
"path": "encryptedText",
"bsonType": "string",
"queries": [
{
"queryType": "prefixPreview",
"strMinQueryLength": {
"$numberInt": "2"
},
"strMaxQueryLength": {
"$numberInt": "10"
},
"caseSensitive": true,
"diacriticSensitive": true
},
{
"queryType": "suffixPreview",
"strMinQueryLength": {
"$numberInt": "2"
},
"strMaxQueryLength": {
"$numberInt": "10"
},
"caseSensitive": true,
"diacriticSensitive": true
}
]
}
"keyId": {
"$binary": {
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
"subType": "04"
}
},
"path": "encryptedText",
"bsonType": "string",
"queries": [
{
"queryType": "prefixPreview",
"strMinQueryLength": {
"$numberInt": "2"
},
"strMaxQueryLength": {
"$numberInt": "10"
},
"caseSensitive": true,
"diacriticSensitive": true
},
{
"queryType": "suffixPreview",
"strMinQueryLength": {
"$numberInt": "2"
},
"strMaxQueryLength": {
"$numberInt": "10"
},
"caseSensitive": true,
"diacriticSensitive": true
}
]
}

Copilot uses AI. Check for mistakes.
@qingyang-hu qingyang-hu marked this pull request as ready for review December 19, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature review-priority-normal Medium Priority PR for Review: within 1 business day

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant