RUBY-3588 Deprecate Support for Server Version 4.0#2980
Merged
jamis merged 9 commits intomongodb:masterfrom Feb 3, 2026
Merged
RUBY-3588 Deprecate Support for Server Version 4.0#2980jamis merged 9 commits intomongodb:masterfrom
jamis merged 9 commits intomongodb:masterfrom
Conversation
Adds a new Mongo::Deprecations module as well
Contributor
There was a problem hiding this comment.
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.
comandeo-mongo
approved these changes
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds wire version 7 (MongoDB 4.0) to the deprecated list.