GODRIVER-3900 Move Hello into internal/handshake/operation. - #2513
GODRIVER-3900 Move Hello into internal/handshake/operation.#2513qingyang-hu wants to merge 1 commit into
Conversation
API Change Report./v2/x/mongo/driver/operationincompatible changesHello: removed |
🧪 Performance ResultsCommit SHA: 2920d85The following benchmark tests for version 6a67dbdf04b2330007be4e55 had statistically significant changes (i.e., |z-score| > 1.96):
For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch. |
dd88bfb to
2920d85
Compare
There was a problem hiding this comment.
Pull request overview
Relocates the Hello handshake operation from the importable x/mongo/driver/operation package into a new internal/handshake/operation package to prevent external consumption, while updating existing internal callers to use the new import path.
Changes:
- Added
internal/handshake/operation/hello.gocontaining theHellohandshaker implementation. - Added
internal/handshake/operation/hello_test.gowith unit tests/benchmarks/fuzzing for client metadata encoding helpers. - Updated 8 internal callers to swap imports from
go.mongodb.org/mongo-driver/v2/x/mongo/driver/operationtogo.mongodb.org/mongo-driver/v2/internal/handshake/operation.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| x/mongo/driver/topology/topology_options.go | Swaps operation import to the new internal handshake package. |
| x/mongo/driver/topology/server.go | Swaps operation import to the new internal handshake package. |
| x/mongo/driver/topology/rtt_monitor.go | Swaps operation import to the new internal handshake package. |
| x/mongo/driver/topology/rtt_monitor_test.go | Swaps operation import to the new internal handshake package for tests. |
| x/mongo/driver/topology/pool_test.go | Swaps operation import to the new internal handshake package for tests. |
| x/mongo/driver/topology/CMAP_spec_test.go | Swaps operation import to the new internal handshake package for spec tests. |
| x/mongo/driver/topology/cmap_prose_test.go | Swaps operation import to the new internal handshake package for prose tests. |
| x/mongo/driver/auth/auth.go | Swaps operation import to the new internal handshake package. |
| internal/handshake/operation/hello.go | Introduces the internalized Hello operation implementation. |
| internal/handshake/operation/hello_test.go | Adds unit tests/benchmarks/fuzzing for the moved code. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GODRIVER-3900
Summary
This PR relocates
Hellofromx/mongo/driver/operationpackage into a new internal packageinternal/handshake/operation.8 callers are updated with an import path swap only.
Background & Motivation
Moving
Hellotointernal/makes it unimportable by external code.It is impossible to move
Hellointo themongopackage because it would forcetopology/authto importmongo, which cycles.