-
Notifications
You must be signed in to change notification settings - Fork 532
RUBY-3588 Deprecate Support for Server Version 4.0 #2980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Adds a new Mongo::Deprecations module as well
There was a problem hiding this 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 introduces a deprecation mechanism for specific server wire versions and starts emitting deprecation warnings when connecting to servers using deprecated wire versions. It also exposes a reusable Mongo::Deprecations module and wires it into feature support checks.
Changes:
- Added
Mongo::Deprecationsmodule to centralize thread-safe, once-per-feature deprecation logging. - Extended
Mongo::Server::Description::Features#check_driver_support!to warn when the server’s max wire version is inDEPRECATED_WIRE_VERSIONS, and definedDEPRECATED_WIRE_VERSIONS = 6..7. - Updated the feature spec to assert deprecation warnings are emitted and to verify that wire versions 6 and 7 are considered deprecated.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| spec/mongo/server/description/features_spec.rb | Adds tests verifying that check_driver_support! triggers a deprecation warning for deprecated max wire versions and that wire versions 6 and 7 are marked as deprecated. |
| lib/mongo/server/description/features.rb | Introduces deprecation messaging/constants, validates deprecated wire versions against supported versions, and emits deprecation warnings on connection when appropriate. |
| lib/mongo/deprecations.rb | New module encapsulating deprecation warning behavior with mutex-protected state and logging via Mongo::Loggable. |
| lib/mongo.rb | Requires the new mongo/deprecations module so it is available throughout the driver. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds wire version 7 (MongoDB 4.0) to the deprecated list.