Skip to content

Conversation

@qingyang-hu
Copy link
Collaborator

@qingyang-hu qingyang-hu commented Nov 12, 2025

GODRIVER-3486
GODRIVER-3402

Summary

Support auto encryption in unified tests.

Background & Motivation

@evergreen-ci-prod
Copy link

There is an existing patch(es) for this commit SHA:

Please note that the status that is posted is not in the context of this PR but rather the (latest) existing patch and that may affect some tests that may depend on the particular PR. If your tests do not rely on any PR-specific values (like base or head branch name) then your tests will report the same status. If you would like a patch to run in the context of this PR and abort the other(s), comment 'evergreen retry'.

@mongodb-drivers-pr-bot
Copy link
Contributor

mongodb-drivers-pr-bot bot commented Nov 12, 2025

🧪 Performance Results

Commit SHA: f2113d4

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

Benchmark Measurement % Change Patch Value Stable Region H-Score Z-Score
BenchmarkBSONFullDocumentDecoding ops_per_second_min -52.1781 934.5375 Avg: 1954.2055
Med: 1959.3551
Stdev: 175.4638
0.9066 -5.8113
BenchmarkMultiFindMany total_bytes_allocated -15.3850 636082712.0000 Avg: 751737787.1515
Med: 762006024.0000
Stdev: 55402172.7374
0.7357 -2.0876
BenchmarkMultiFindMany total_mem_allocs -15.3294 391994.0000 Avg: 462963.7273
Med: 468895.0000
Stdev: 34144.8985
0.7339 -2.0785
BenchmarkSmallDocInsertOne ops_per_second_max -8.9608 5664.1499 Avg: 6221.6591
Med: 6255.1605
Stdev: 235.0399
0.7722 -2.3720
BenchmarkMultiInsertLargeDocument ns_per_op 7.8391 31828987.0000 Avg: 29515262.5909
Med: 29248431.0000
Stdev: 1035156.3373
0.7556 2.2351
BenchmarkBSONDeepDocumentDecoding allocated_bytes_per_op -0.0079 15098.0000 Avg: 15099.2000
Med: 15099.0000
Stdev: 0.5774
0.7707 -2.0785

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

No changes found!

@qingyang-hu qingyang-hu marked this pull request as ready for review November 13, 2025 14:14
@qingyang-hu qingyang-hu requested a review from a team as a code owner November 13, 2025 14:14
Copilot finished reviewing on behalf of qingyang-hu November 13, 2025 14:17

This comment was marked as outdated.

@qingyang-hu qingyang-hu marked this pull request as draft November 13, 2025 14:37
@qingyang-hu qingyang-hu force-pushed the godriver3486 branch 4 times, most recently from b1f3ca6 to 6bf8480 Compare November 15, 2025 02:55
@qingyang-hu qingyang-hu removed the request for review from matthewdale December 4, 2025 19:49
@qingyang-hu qingyang-hu force-pushed the godriver3486 branch 12 times, most recently from 1b980ac to 666c2d5 Compare December 6, 2025 03:45
@qingyang-hu qingyang-hu force-pushed the godriver3486 branch 7 times, most recently from e036710 to a871c58 Compare December 6, 2025 20:11
@mongodb mongodb deleted a comment from Copilot AI Dec 6, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 6, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 6, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 6, 2025
@mongodb mongodb deleted a comment from Copilot AI Dec 6, 2025
@qingyang-hu qingyang-hu requested a review from Copilot December 6, 2025 23:53
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 10 out of 10 changed files in this pull request and generated 3 comments.


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

}

// getKmsCredential processes a value of an input KMS provider credential.
// An empty document returns from the environment.
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

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

The comment "An empty document returns from the environment" is unclear and grammatically incorrect. It should be clarified to something like "A placeholder document ($$placeholder) causes the value to be retrieved from the environment variable or default value."

Suggested change
// An empty document returns from the environment.
// If a placeholder document ($$placeholder) is provided, the value is retrieved from the environment variable or default value.

Copilot uses AI. Check for mistakes.
// If neither documents nor options are provided, still create the collection with write concern "majority".
if len(c.Documents) == 0 && c.Options == nil {
} else {
// If options are provided, still create the collection with write concern "majority".
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

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

The comment states "If options are provided" but this is in the else block where c.Options is nil. The comment should say "If no options are provided" to accurately describe this code path.

Suggested change
// If options are provided, still create the collection with write concern "majority".
// If no options are provided, still create the collection with write concern "majority".

Copilot uses AI. Check for mistakes.
return nil, err
}
if v == "$$placeholder" {
provider["sessionToken"] = os.Getenv("CSFLE_AWS_TEMP_SESSION_TOKEN")
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

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

When the sessionToken placeholder is detected, the code directly assigns os.Getenv("CSFLE_AWS_TEMP_SESSION_TOKEN") without checking if the environment variable exists or is empty. If the environment variable is not set, this will assign an empty string to the provider's sessionToken. Consider using getKmsCredential or adding a check to ensure the environment variable is set before assigning it.

Suggested change
provider["sessionToken"] = os.Getenv("CSFLE_AWS_TEMP_SESSION_TOKEN")
sessionToken, err := getKmsCredential(opt, "sessionToken", "CSFLE_AWS_TEMP_SESSION_TOKEN", "")
if err != nil {
return nil, err
}
if sessionToken != nil {
provider["sessionToken"] = sessionToken
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant