Repository navigation
RUBY-3907 Add missing revert_server_monitoring_mode to OptionsMapper - #3120
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Fixes https://jira.mongodb.org/browse/RUBY-3907
serverMonitoringModeis registered withtype: :server_monitoring_mode, butMongo::URI::OptionsMapperonly definesconvert_server_monitoring_modeandstringify_server_monitoring_mode.ruby_to_smcdispatches torevert_#{type}, so reverting client options that contain:server_monitoring_moderaises:Repro:
Changes
revert_server_monitoring_mode, which returns the mode as a string, and aliasstringify_server_monitoring_modeto it. This follows the existingrevert_symbolandrevert_read_modepattern.sdam-options.ymlfromspecifications/source/uri-options/tests/intospec/spec_tests/data/uri_options/. The URI options runner maps client options back throughruby_to_smc, so the three validserverMonitoringModecases cover the revert path.Testing
libchange: 349 examples, 3 failures (sdam-options.yml serverMonitoringMode=auto|stream|poll creates a client with the correct options,NoMethodError).spec/mongo/uri/options_mapper_spec.rb,spec/mongo/uri_spec.rb,spec/spec_tests/connection_string_spec.rbandspec/spec_tests/uri_options_spec.rbpass against a single-node 8.0 replica set (997 examples, 0 failures). RuboCop reports no offenses forlib/mongo/uri/options_mapper.rb.