mongo 2.9.0.rc1 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7be78062f748710dc54cb80b22913e719ffdd5c066f09390ae701cbc4d5b817
4
- data.tar.gz: 64fd81ea9461edf3d4211ea32ad2958cd64a2584d84e9a8d3492e22c4332109e
3
+ metadata.gz: dd46b61214fcac244d0cbec169da07133ded518cc61f6da7f93ae38005326efc
4
+ data.tar.gz: b9fde5cb3b1060705a04cdbf6656f0b30f183acc341b6c9ae2e74322675bf358
5
5
  SHA512:
6
- metadata.gz: 8b2e95fc24ce7bea503e60e3c94066010945df1ba3822395fd34a2c8daa27df75cfbae4b4808133dd59663d65bbecdcb68511a46316aa3b3b840efdc3f34519c
7
- data.tar.gz: ce9ebadaeabfb7bd01f662fae6b4a06bb9d35d19cc866af4dab0549a5011120df08a5353b3ca56fa8b3f4408a3b6e06736f0662ca65e2c55a552dea636db93c1
6
+ metadata.gz: 897c70fc6cdb9d4a839c7cce246c3ff588ccae10b574ab8da7cd62f91860fb792b4ab74a6cc317dd9d80c03384d38d843dcc9119bb6ce71b35cb87d271eed30f
7
+ data.tar.gz: 849350864e0f5d29dcc9f1c2b5b623e0fd0ec61d028a8270a980ebe1e2cb0a764706f984d63f2206794d0fefca5610dd0f9edcec734faece59b0a8e32f4e7d38
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,64 +1,50 @@
1
- ## Contributing to the MongoDB Ruby Driver
1
+ # Contributing to the MongoDB Ruby Driver
2
2
 
3
3
  Thank you for your interest in contributing to the MongoDB Ruby driver.
4
4
 
5
- We are building this software together and strongly encourage contributions
6
- from the community that are within the guidelines set forth below.
5
+ We are building this software together and appreciate and encourage
6
+ contributions from the community.
7
7
 
8
- Bug Fixes and New Features
9
- --------------------------
8
+ JIRA Tickets
9
+ ------------
10
10
 
11
- Before starting to write code, look for existing [tickets]
12
- (https://jira.mongodb.org/browse/RUBY) or [create one]
13
- (https://jira.mongodb.org/secure/CreateIssue!default.jspa)
14
- for your bug, issue, or feature request. This helps the community
15
- avoid working on something that might not be of interest or which
16
- has already been addressed.
11
+ The Ruby driver team uses MongoDB JIRA to schedule and track work.
12
+ To report a problem with the driver, please [create a new
13
+ issue](https://jira.mongodb.org/secure/CreateIssue!default.jspa) in the Ruby
14
+ JIRA project. A ticket is appreciated, though not necessary, when submitting
15
+ a pull request.
16
+
17
+ Please consult [JIRA issues](https://jira.mongodb.org/browse/RUBY)
18
+ for existing known issues in the driver.
17
19
 
18
20
  Environment
19
21
  -----------
20
22
 
21
- We highly suggest using [RVM](https://rvm.io/) or [rbenv]
22
- (https://github.com/sstephenson/rbenv) to set up Ruby development and
23
- testing environments. In this way, moving between and testing code for
24
- alternate Ruby versions (besides the one possibly included with your
25
- system) is simple. This practice is essential for ensuring the quality
26
- of the driver.
27
-
28
- Pull Requests
29
- -------------
30
-
31
- Pull requests should be made against the master (development)
32
- branch and include relevant tests, if applicable. The driver follows
33
- the Git-Flow branching model where the traditional master branch is
34
- known as release and the master (default) branch is considered under
35
- development.
23
+ We recommend using [rbenv](https://github.com/sstephenson/rbenv) to set up
24
+ the Ruby development and testing environments, though other tools like
25
+ [RVM](https://rvm.io/) will also work. The driver currently supports
26
+ MRI 1.9.3-2.6 and JRuby 9.1-9.2.
36
27
 
37
- Tests should pass under all Ruby interpreters which the MongoDB Ruby
38
- driver currently supports (1.8.7, 1.9.3, JRuby 1.6.x and 1.7.x) and will be
39
- automatically tested.
28
+ A MongoDB cluster is required to run the tests. Setup procedures and
29
+ recommendations for various clusters, as well as how to configure the
30
+ driver's test suite, are covered in the [spec
31
+ readme](https://github.com/mongodb/mongo-ruby-driver/blob/master/spec/README.md).
40
32
 
41
- The results of pull request testing will be appended to the request.
42
- If any tests do not pass, or relavant tests are not included the pull
43
- request will not be considered.
33
+ The driver is tested on [Evergreen](https://github.com/evergreen-ci/evergreen),
34
+ MongoDB's in house continuous integration platform. After a pull request
35
+ is created, one of the Ruby driver team engineers will schedule continous
36
+ integration builds on Evergreen.
44
37
 
45
- Clusters and Replica Sets
46
- -------------------------
47
-
48
- If your bug fix or enhancement deals with Cluster or Replica Set
49
- code, please run all relevant tests for those code subsets before
50
- issuing the request.
51
-
52
- * `rake test:sharded_cluster` for sharded clusters
53
- * `rake test:replica_set` for replica sets
38
+ Pull Requests
39
+ -------------
54
40
 
55
- Cluster and Replica Set testing is currently **not** automatically
56
- performed so it is important they are run in a thorough fashion under
57
- all supported interpreters before a pull request is made.
41
+ Pull requests should be made against the master (development) branch and
42
+ include relevant tests, if applicable. The Ruby driver team will backport
43
+ the changes to the stable branches, if needed.
58
44
 
59
45
  Talk To Us
60
46
  ----------
61
47
 
62
- We love to hear from you. If you want to work on something or have
63
- questions / complaints please reach out to us by creating a [question]
64
- (https://jira.mongodb.org/secure/CreateIssue.jspa?pid=10005&issuetype=6).
48
+ We would love to hear from you. If you want to work on something or have
49
+ questions please reach out to us by creating a [question](https://jira.mongodb.org/secure/CreateIssue.jspa?pid=10005&issuetype=6)
50
+ in JIRA.
@@ -263,6 +263,8 @@ module Mongo
263
263
  'GHOST'
264
264
  when other?
265
265
  'OTHER'
266
+ when mongos?
267
+ 'MONGOS'
266
268
  when unknown?
267
269
  'UNKNOWN'
268
270
  else
@@ -378,13 +378,8 @@ module Mongo
378
378
  raise_invalid_error!("Value for option #{key} contains the key/value delimiter (=): #{value}")
379
379
  end
380
380
  key = ::URI.decode(key)
381
- strategy = URI_OPTION_MAP[key.downcase]
382
- if strategy.nil?
383
- log_warn("Unsupported URI option '#{key}' on URI '#{@string}'. It will be ignored.")
384
- else
385
- value = ::URI.decode(value)
386
- add_uri_option(key, strategy, value, uri_options)
387
- end
381
+ value = ::URI.decode(value)
382
+ add_uri_option(key, value, uri_options)
388
383
  uri_options
389
384
  end
390
385
  end
@@ -527,6 +522,7 @@ module Mongo
527
522
  uri_option 'appname', :app_name
528
523
  uri_option 'compressors', :compressors, :type => :array
529
524
  uri_option 'readconcernlevel', :level, group: :read_concern
525
+ uri_option 'retryreads', :retry_reads, :type => :retry_reads
530
526
  uri_option 'retrywrites', :retry_writes, :type => :retry_writes
531
527
  uri_option 'zlibcompressionlevel', :zlib_compression_level, :type => :zlib_compression_level
532
528
 
@@ -592,10 +588,15 @@ module Mongo
592
588
  # Merges the option into the target.
593
589
  #
594
590
  # @param key [String] URI option name.
595
- # @param strategy [Symbol] The strategy for this option.
596
591
  # @param value [String] The value of the option.
597
592
  # @param uri_options [Hash] The base option target.
598
- def add_uri_option(key, strategy, value, uri_options)
593
+ def add_uri_option(key, value, uri_options)
594
+ strategy = URI_OPTION_MAP[key.downcase]
595
+ if strategy.nil?
596
+ log_warn("Unsupported URI option '#{key}' on URI '#{@string}'. It will be ignored.")
597
+ return
598
+ end
599
+
599
600
  target = select_target(uri_options, strategy[:group])
600
601
  value = apply_transform(key, value, strategy[:type])
601
602
  merge_uri_option(target, value, strategy[:name])
@@ -785,6 +786,16 @@ module Mongo
785
786
  inverse_bool('tlsAllowInvalidHostnames', value)
786
787
  end
787
788
 
789
+ # Parses the retryReads value.
790
+ #
791
+ # @param value [ String ] The retryReads value.
792
+ #
793
+ # @return [ true | false | nil ] The boolean value parsed out, otherwise nil (and a warning
794
+ # will be logged).
795
+ def retry_reads(value)
796
+ convert_bool('retryReads', value)
797
+ end
798
+
788
799
  # Parses the retryWrites value.
789
800
  #
790
801
  # @param value [ String ] The retryWrites value.
@@ -170,8 +170,7 @@ module Mongo
170
170
  raise Error::InvalidTXTRecord.new(INVALID_OPTS_VALUE_DELIM) unless opt.index(URI_OPTS_VALUE_DELIM)
171
171
  key, value = opt.split(URI_OPTS_VALUE_DELIM)
172
172
  raise Error::InvalidTXTRecord.new(INVALID_TXT_RECORD_OPTION) unless VALID_TXT_OPTIONS.include?(key.downcase)
173
- strategy = URI_OPTION_MAP[key.downcase]
174
- add_uri_option(key, strategy, value, txt_options)
173
+ add_uri_option(key, value, txt_options)
175
174
  txt_options
176
175
  end
177
176
  end
@@ -17,5 +17,5 @@ module Mongo
17
17
  # The current version of the driver.
18
18
  #
19
19
  # @since 2.0.0
20
- VERSION = '2.9.0.rc1'.freeze
20
+ VERSION = '2.9.0'.freeze
21
21
  end
@@ -380,5 +380,19 @@ describe Mongo::Server do
380
380
  expect(server.summary).not_to include('replica_set')
381
381
  end
382
382
  end
383
+
384
+ context 'server is a mongos' do
385
+ let(:server) do
386
+ make_server(:mongos)
387
+ end
388
+
389
+ before do
390
+ expect(server).to be_mongos
391
+ end
392
+
393
+ it 'specifies the server is a mongos' do
394
+ expect(server.summary).to match(/MONGOS/)
395
+ end
396
+ end
383
397
  end
384
398
  end
@@ -55,7 +55,11 @@ class ClusterConfig
55
55
  if server_version >= '3.4' && !mongos?
56
56
  fcv
57
57
  else
58
- short_server_version
58
+ if short_server_version == '4.1'
59
+ '4.2'
60
+ else
61
+ short_server_version
62
+ end
59
63
  end
60
64
  end
61
65
 
@@ -46,18 +46,23 @@ module CommonShortcuts
46
46
  tags = options[:tags] || {}
47
47
  average_round_trip_time = options[:average_round_trip_time] || 0
48
48
 
49
- ismaster = {
50
- 'ismaster' => mode == :primary,
51
- 'secondary' => mode == :secondary,
52
- 'arbiterOnly' => mode == :arbiter,
53
- 'isreplicaset' => mode == :ghost,
54
- 'hidden' => mode == :other,
55
- 'tags' => tags,
56
- 'ok' => 1,
57
- 'minWireVersion' => 2, 'maxWireVersion' => 8,
58
- }
59
- if [:primary, :secondary, :arbiter, :other].include?(mode)
60
- ismaster['setName'] = 'mongodb_set'
49
+ if mode == :unknown
50
+ ismaster = {}
51
+ else
52
+ ismaster = {
53
+ 'ismaster' => mode == :primary,
54
+ 'secondary' => mode == :secondary,
55
+ 'arbiterOnly' => mode == :arbiter,
56
+ 'isreplicaset' => mode == :ghost,
57
+ 'hidden' => mode == :other,
58
+ 'msg' => mode == :mongos ? 'isdbgrid' : nil,
59
+ 'tags' => tags,
60
+ 'ok' => 1,
61
+ 'minWireVersion' => 2, 'maxWireVersion' => 8,
62
+ }
63
+ if [:primary, :secondary, :arbiter, :other].include?(mode)
64
+ ismaster['setName'] = 'mongodb_set'
65
+ end
61
66
  end
62
67
 
63
68
  listeners = Mongo::Event::Listeners.new
@@ -26,19 +26,10 @@ module Utils
26
26
  # Converts camel case clientOptions, as used in spec tests,
27
27
  # to Ruby driver underscore options.
28
28
  def convert_client_options(spec_test_options)
29
- spec_test_options.reduce({}) do |opts, kv|
30
- case kv.first
31
- when 'readConcernLevel'
32
- kv = [:read_concern, { 'level' => kv.last }]
33
- when 'readPreference'
34
- kv = [:read, { 'mode' => kv.last }]
35
- when 'w'
36
- kv = [:write, { w: kv.last }]
37
- else
38
- kv[0] = underscore(kv[0])
39
- end
40
-
41
- opts.tap { |o| o[kv.first] = kv.last }
29
+ uri = Mongo::URI.new('mongodb://localhost')
30
+ spec_test_options.reduce({}) do |opts, (name, value)|
31
+ uri.send(:add_uri_option, name, value.to_s, opts)
32
+ opts
42
33
  end
43
34
  end
44
35
  module_function :convert_client_options
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0.rc1
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Brock
@@ -31,7 +31,7 @@ cert_chain:
31
31
  bMYVwXXhV8czdzgkQB/ZPWHSbEWXnmkze1mzvqWBCPOVXYrcnL9cnEl/RoxtS1hr
32
32
  Db6Ac6mCUSYfYHBWpWqxjc45n70i5Xi1
33
33
  -----END CERTIFICATE-----
34
- date: 2019-06-13 00:00:00.000000000 Z
34
+ date: 2019-06-20 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bson
@@ -1088,9 +1088,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1088
1088
  version: '0'
1089
1089
  required_rubygems_version: !ruby/object:Gem::Requirement
1090
1090
  requirements:
1091
- - - ">"
1091
+ - - ">="
1092
1092
  - !ruby/object:Gem::Version
1093
- version: 1.3.1
1093
+ version: '0'
1094
1094
  requirements: []
1095
1095
  rubygems_version: 3.0.1
1096
1096
  signing_key:
metadata.gz.sig CHANGED
Binary file