Skip to content

Conversation

@jamis
Copy link
Contributor

@jamis jamis commented Jan 27, 2026

Adds wire version 7 (MongoDB 4.0) to the deprecated list.

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 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::Deprecations module 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 in DEPRECATED_WIRE_VERSIONS, and defined DEPRECATED_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.

@jamis jamis added the feature A PR for a new feature label Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A PR for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant