mongoid 7.5.3 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/Rakefile +85 -21
  4. data/lib/mongoid/contextual/mongo.rb +26 -1
  5. data/lib/mongoid/criteria/queryable/selector.rb +1 -1
  6. data/lib/mongoid/criteria/queryable/storable.rb +1 -1
  7. data/lib/mongoid/version.rb +5 -1
  8. data/spec/mongoid/config_spec.rb +1 -0
  9. data/spec/mongoid/contextual/mongo_spec.rb +10 -0
  10. data/spec/mongoid/copyable_spec.rb +1 -0
  11. data/spec/mongoid/criteria/queryable/extensions/bignum_spec.rb +2 -1
  12. data/spec/mongoid/criteria/queryable/extensions/fixnum_spec.rb +2 -1
  13. data/spec/mongoid/criteria/queryable/selector_spec.rb +75 -2
  14. data/spec/mongoid/criteria/queryable/storable_spec.rb +72 -0
  15. data/spec/mongoid/query_cache_spec.rb +2 -1
  16. data/spec/mongoid/serializable_spec.rb +7 -14
  17. data/spec/shared/CANDIDATE.md +28 -0
  18. data/spec/shared/lib/mrss/docker_runner.rb +8 -1
  19. data/spec/shared/lib/mrss/lite_constraints.rb +2 -2
  20. data/spec/shared/lib/mrss/release/candidate.rb +281 -0
  21. data/spec/shared/lib/mrss/release/product_data.rb +144 -0
  22. data/spec/shared/lib/mrss/server_version_registry.rb +17 -24
  23. data/spec/shared/lib/mrss/spec_organizer.rb +32 -3
  24. data/spec/shared/lib/mrss/utils.rb +28 -6
  25. data/spec/shared/lib/tasks/candidate.rake +64 -0
  26. data/spec/shared/share/Dockerfile.erb +33 -107
  27. data/spec/shared/shlib/distro.sh +10 -0
  28. data/spec/shared/shlib/server.sh +60 -29
  29. data/spec/shared/shlib/set_env.sh +12 -71
  30. data/spec/support/expectations.rb +20 -17
  31. metadata +644 -667
  32. checksums.yaml.gz.sig +0 -0
  33. data.tar.gz.sig +0 -0
  34. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27b0f244fe4642a684c267744270dd8e72b2b3ae1074b3621c24b31e979299b6
4
- data.tar.gz: a79526be9f430f3777a35b2c27271175eca415c57ab2ae0346e3050b52f9311f
3
+ metadata.gz: 9ff7d60d6b900150abc528548490b2b678708dfe05af7818255c48511bb0162a
4
+ data.tar.gz: a17bd4adb82448f3577cec52a0fab82660227d5e8bce6a9058a499449375da04
5
5
  SHA512:
6
- metadata.gz: 88c97668e4474dc109a910b2faa28f08b4c105b02e0f43611df3f2122e1232d9c3b2bfaedaf8aebebccf4358c40bc65c6bd04cfdc252c8ceca286aecf5b2d77e
7
- data.tar.gz: ec9a56811c18fcf4cdeb238a7aa85eb350bc86513d9a883cd8f603122189af3da71bd0eea3a830ac06a26af30424648af935bf633f56ec740d045e94209b24fe
6
+ metadata.gz: 52adb1bd5f193bf327925d8650bffb9ea9761395b0b7e691f6c18f3ea9a56cc94c6d4824dd7b29e2316ecbb916a338430f4e96dde248982f78b451fb580afe62
7
+ data.tar.gz: 0a5147d6b5c686c8e103b41de6424ef6835097ca98abbc5d2b883f29f381cb090a5ad2c4a896d640dbe0216d49824a4eeca061b201d2e34e8d1228393440153d
data/README.md CHANGED
@@ -19,9 +19,9 @@ Compatibility
19
19
 
20
20
  Mongoid supports and is tested against:
21
21
 
22
- - MRI 2.5 - 3.1
23
- - JRuby 9.2
24
- - MongoDB server 2.6 - 6.0
22
+ - MRI 2.7 - 3.1
23
+ - JRuby 9.3
24
+ - MongoDB server 3.6 - 8.0
25
25
 
26
26
  Issues
27
27
  ------
@@ -40,7 +40,7 @@ License
40
40
  -------
41
41
 
42
42
  Copyright (c) 2009-2016 Durran Jordan
43
- Copyright (c) 2015-2020 MongoDB, Inc.
43
+ Copyright (c) 2015-present MongoDB, Inc.
44
44
 
45
45
  Permission is hereby granted, free of charge, to any person obtaining
46
46
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
+ # rubocop:todo all
2
3
 
3
4
  require "bundler"
4
- require "bundler/gem_tasks"
5
5
  Bundler.setup
6
6
 
7
7
  ROOT = File.expand_path(File.join(File.dirname(__FILE__)))
@@ -10,25 +10,53 @@ $: << File.join(ROOT, 'spec/shared/lib')
10
10
 
11
11
  require "rake"
12
12
  require "rspec/core/rake_task"
13
- require 'mrss/spec_organizer'
14
13
 
15
- $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
16
- require "mongoid/version"
17
-
18
- tasks = Rake.application.instance_variable_get('@tasks')
19
- tasks['release:do'] = tasks.delete('release')
14
+ if File.exist?('./spec/shared/lib/tasks/candidate.rake')
15
+ load 'spec/shared/lib/tasks/candidate.rake'
16
+ end
20
17
 
21
- task :gem => :build
18
+ desc 'Build the gem'
22
19
  task :build do
23
- system "gem build mongoid.gemspec"
20
+ command = %w[ gem build ]
21
+ command << "--output=#{ENV['GEM_FILE_NAME']}" if ENV['GEM_FILE_NAME']
22
+ command << (ENV['GEMSPEC'] || 'mongoid.gemspec')
23
+ system(*command)
24
24
  end
25
25
 
26
- task :install => :build do
27
- system "sudo gem install mongoid-#{Mongoid::VERSION}.gem"
26
+ # `rake version` is used by the deployment system so get the release version
27
+ # of the product beng deployed. It must do nothing more than just print the
28
+ # product version number.
29
+ #
30
+ # See the mongodb-labs/driver-github-tools/ruby/publish Github action.
31
+ desc "Print the current value of Mongoid::VERSION"
32
+ task :version do
33
+ require 'mongoid/version'
34
+
35
+ puts Mongoid::VERSION
28
36
  end
29
37
 
38
+ # overrides the default Bundler-provided `release` task, which also
39
+ # builds the gem. Our release process assumes the gem has already
40
+ # been built (and signed via GPG), so we just need `rake release` to
41
+ # push the gem to rubygems.
30
42
  task :release do
31
- raise "Please use ./release.sh to release"
43
+ require 'mongoid/version'
44
+
45
+ if ENV['GITHUB_ACTION'].nil?
46
+ abort <<~WARNING
47
+ `rake release` must be invoked from the `Mongoid Release` GitHub action,
48
+ and must not be invoked locally. This ensures the gem is properly signed
49
+ and distributed by the appropriate user.
50
+
51
+ Note that it is the `rubygems/release-gem@v1` step in the `Mongoid Release`
52
+ action that invokes this task. Do not rename or remove this task, or the
53
+ release-gem step will fail. Reimplement this task with caution.
54
+
55
+ mongoid-#{Mongoid::VERSION}.gem was NOT pushed to RubyGems.
56
+ WARNING
57
+ end
58
+
59
+ system 'gem', 'push', "mongoid-#{Mongoid::VERSION}.gem"
32
60
  end
33
61
 
34
62
  RSpec::Core::RakeTask.new("spec") do |spec|
@@ -40,6 +68,46 @@ RSpec::Core::RakeTask.new('spec:progress') do |spec|
40
68
  spec.pattern = "spec/**/*_spec.rb"
41
69
  end
42
70
 
71
+ desc 'Build and validate the evergreen config'
72
+ task eg: %w[ eg:build eg:validate ]
73
+
74
+ # 'eg' == 'evergreen', but evergreen is too many letters for convenience
75
+ namespace :eg do
76
+ desc 'Builds the .evergreen/config.yml file from the templates'
77
+ task :build do
78
+ ruby '.evergreen/update-evergreen-configs'
79
+ end
80
+
81
+ desc 'Validates the .evergreen/config.yml file'
82
+ task :validate do
83
+ system 'evergreen validate --project mongoid .evergreen/config.yml'
84
+ end
85
+
86
+ desc 'Updates the evergreen executable to the latest available version'
87
+ task :update do
88
+ system 'evergreen get-update --install'
89
+ end
90
+
91
+ desc 'Runs the current branch as an evergreen patch'
92
+ task :patch do
93
+ system 'evergreen patch --uncommitted --project mongoid --browse --auto-description --yes'
94
+ end
95
+ end
96
+
97
+ namespace :generate do
98
+ desc 'Generates a mongoid.yml from the template'
99
+ task :config do
100
+ require 'mongoid'
101
+ require 'erb'
102
+
103
+ template_path = 'lib/rails/generators/mongoid/config/templates/mongoid.yml'
104
+ database_name = ENV['DATABASE_NAME'] || 'my_db'
105
+
106
+ config = ERB.new(File.read(template_path), trim_mode: '-').result(binding)
107
+ File.write('mongoid.yml', config)
108
+ end
109
+ end
110
+
43
111
  CLASSIFIERS = [
44
112
  [%r,^mongoid/attribute,, :attributes],
45
113
  [%r,^mongoid/association/[or],, :associations_referenced],
@@ -55,6 +123,8 @@ RUN_PRIORITY = %i(
55
123
  )
56
124
 
57
125
  def spec_organizer
126
+ require 'mrss/spec_organizer'
127
+
58
128
  Mrss::SpecOrganizer.new(
59
129
  root: ROOT,
60
130
  classifiers: CLASSIFIERS,
@@ -88,18 +158,12 @@ desc "Generate all documentation"
88
158
  task :docs => 'docs:yard'
89
159
 
90
160
  namespace :docs do
91
- desc "Generate yard documention"
161
+ desc "Generate yard documentation"
92
162
  task :yard do
163
+ require "mongoid/version"
164
+
93
165
  out = File.join('yard-docs', Mongoid::VERSION)
94
166
  FileUtils.rm_rf(out)
95
167
  system "yardoc -o #{out} --title mongoid-#{Mongoid::VERSION}"
96
168
  end
97
169
  end
98
-
99
- namespace :release do
100
- task :check_private_key do
101
- unless File.exist?('gem-private_key.pem')
102
- raise "No private key present, cannot release"
103
- end
104
- end
105
- end
@@ -65,7 +65,14 @@ module Mongoid
65
65
  # @return [ Integer ] The number of matches.
66
66
  def count(options = {}, &block)
67
67
  return super(&block) if block_given?
68
- try_cache(:count) { view.count_documents(options) }
68
+
69
+ try_cache(:count) do
70
+ if valid_for_count_documents?
71
+ view.count_documents(options)
72
+ else
73
+ view.count(options)
74
+ end
75
+ end
69
76
  end
70
77
 
71
78
  # Get the estimated number of documents matching the query.
@@ -902,6 +909,24 @@ module Mongoid
902
909
  docs = eager_load(docs)
903
910
  limit ? docs : docs.first
904
911
  end
912
+
913
+ # Queries whether the current context is valid for use with
914
+ # the #count_documents? predicate. A context is valid if it
915
+ # does not include a `$where` operator.
916
+ #
917
+ # @return [ true | false ] whether or not the current context
918
+ # excludes a `$where` operator.
919
+ def valid_for_count_documents?(hash = view.filter)
920
+ # Note that `view.filter` is a BSON::Document, and all keys in a
921
+ # BSON::Document are strings; we don't need to worry about symbol
922
+ # representations of `$where`.
923
+ hash.keys.each do |key|
924
+ return false if key == '$where'
925
+ return false if hash[key].is_a?(Hash) && !valid_for_count_documents?(hash[key])
926
+ end
927
+
928
+ true
929
+ end
905
930
  end
906
931
  end
907
932
  end
@@ -20,7 +20,7 @@ module Mongoid
20
20
  other.each_pair do |key, value|
21
21
  if value.is_a?(Hash) && self[key.to_s].is_a?(Hash)
22
22
  value = self[key.to_s].merge(value) do |_key, old_val, new_val|
23
- case _key
23
+ case _key.to_s
24
24
  when '$in'
25
25
  new_val & old_val
26
26
  when '$nin'
@@ -47,7 +47,7 @@ module Mongoid
47
47
  if value.is_a?(Hash) && selector[field].is_a?(Hash) &&
48
48
  value.keys.all? { |key|
49
49
  key_s = key.to_s
50
- key_s.start_with?('$') && !selector[field].key?(key_s)
50
+ key_s.start_with?('$') && !selector[field].keys.map(&:to_s).include?(key_s)
51
51
  }
52
52
  then
53
53
  # Multiple operators can be combined on the same field by
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mongoid
4
- VERSION = "7.5.3"
4
+ # The current version of Mongoid
5
+ #
6
+ # Note that this file is automatically updated via `rake candidate:create`.
7
+ # Manual changes to this file will be overwritten by that rake task.
8
+ VERSION = '7.6.0'
5
9
  end
@@ -558,6 +558,7 @@ describe Mongoid::Config do
558
558
 
559
559
  # Wrapping libraries are only recognized by driver 2.13.0+.
560
560
  min_driver_version '2.13'
561
+ ruby_version_lt '3.0'
561
562
 
562
563
  it 'passes uuid to driver' do
563
564
  Mongo::Client.should receive(:new).with(SpecConfig.instance.addresses,
@@ -189,6 +189,16 @@ describe Mongoid::Contextual::Mongo do
189
189
  end
190
190
  end
191
191
  end
192
+
193
+ context 'when for_js is present' do
194
+ let(:context) do
195
+ Band.for_js('this.name == "Depeche Mode"')
196
+ end
197
+
198
+ it 'counts the expected records' do
199
+ expect(context.count).to eq(1)
200
+ end
201
+ end
192
202
  end
193
203
 
194
204
  describe "#estimated_count" do
@@ -5,6 +5,7 @@ require "spec_helper"
5
5
  require_relative './copyable_spec_models'
6
6
 
7
7
  describe Mongoid::Copyable do
8
+ ruby_version_lt "3.0"
8
9
 
9
10
  [ :clone, :dup ].each do |method|
10
11
 
@@ -2,7 +2,8 @@
2
2
 
3
3
  require "spec_helper"
4
4
 
5
- describe Bignum do
5
+ describe "Bignum" do
6
+ ruby_version_lt "2.4"
6
7
 
7
8
  describe ".evolve" do
8
9
 
@@ -2,7 +2,8 @@
2
2
 
3
3
  require "spec_helper"
4
4
 
5
- describe Fixnum do
5
+ describe 'Fixnum' do
6
+ ruby_version_lt "2.4"
6
7
 
7
8
  describe ".evolve" do
8
9
 
@@ -44,7 +44,7 @@ describe Mongoid::Criteria::Queryable::Selector do
44
44
  end
45
45
  end
46
46
 
47
- context "when selector contains a $nin" do
47
+ context "when selector contains a $nin string" do
48
48
 
49
49
  let(:initial) do
50
50
  { "$nin" => ["foo"] }
@@ -72,7 +72,35 @@ describe Mongoid::Criteria::Queryable::Selector do
72
72
  end
73
73
  end
74
74
 
75
- context "when selector contains a $in" do
75
+ context "when selector contains a $nin symbol" do
76
+
77
+ let(:initial) do
78
+ { :$nin => ["foo"] }
79
+ end
80
+
81
+ before do
82
+ selector["field"] = initial
83
+ end
84
+
85
+ context "when merging in a new $nin" do
86
+
87
+ let(:other) do
88
+ { "field" => { :$nin => ["bar"] } }
89
+ end
90
+
91
+ before do
92
+ selector.merge!(other)
93
+ end
94
+
95
+ it "combines the two $nin queries into one" do
96
+ expect(selector).to eq({
97
+ "field" => { :$nin => ["foo", "bar"] }
98
+ })
99
+ end
100
+ end
101
+ end
102
+
103
+ context "when selector contains a $in string" do
76
104
 
77
105
  let(:initial) do
78
106
  { "$in" => [1, 2] }
@@ -117,6 +145,51 @@ describe Mongoid::Criteria::Queryable::Selector do
117
145
  end
118
146
  end
119
147
 
148
+ context "when selector contains a $in symbol" do
149
+
150
+ let(:initial) do
151
+ { :$in => [1, 2] }
152
+ end
153
+
154
+ before do
155
+ selector["field"] = initial
156
+ end
157
+
158
+ context "when merging in a new $in with an intersecting value" do
159
+
160
+ let(:other) do
161
+ { "field" => { :$in => [1] } }
162
+ end
163
+
164
+ before do
165
+ selector.merge!(other)
166
+ end
167
+
168
+ it "intersects the $in values" do
169
+ expect(selector).to eq({
170
+ "field" => { :$in => [1] }
171
+ })
172
+ end
173
+ end
174
+
175
+ context "when merging in a new $in with no intersecting values" do
176
+
177
+ let(:other) do
178
+ { "field" => { :$in => [3] } }
179
+ end
180
+
181
+ before do
182
+ selector.merge!(other)
183
+ end
184
+
185
+ it "intersects the $in values" do
186
+ expect(selector).to eq({
187
+ "field" => { :$in => [] }
188
+ })
189
+ end
190
+ end
191
+ end
192
+
120
193
  context "when selector is not nested" do
121
194
 
122
195
  before do
@@ -210,7 +210,79 @@ describe Mongoid::Criteria::Queryable::Storable do
210
210
  }
211
211
  end
212
212
  end
213
+
214
+ context 'when value is a hash combine values with different operator keys' do
215
+ let(:base) do
216
+ query.add_field_expression('foo', {'$in' => ['bar']})
217
+ end
218
+
219
+ let(:modified) do
220
+ base.add_field_expression('foo', {'$nin' => ['zoom']})
221
+ end
222
+
223
+ it 'combines the conditions using $and' do
224
+ modified.selector.should == {
225
+ 'foo' => {
226
+ '$in' => ['bar'],
227
+ '$nin' => ['zoom']
228
+ }
229
+ }
230
+ end
231
+ end
232
+
233
+ context 'when value is a hash with symbol operator key combine values with different operator keys' do
234
+ let(:base) do
235
+ query.add_field_expression('foo', {:$in => ['bar']})
236
+ end
237
+
238
+ let(:modified) do
239
+ base.add_field_expression('foo', {:$nin => ['zoom']})
240
+ end
241
+
242
+ it 'combines the conditions using $and' do
243
+ modified.selector.should == {
244
+ 'foo' => {
245
+ :$in => ['bar'],
246
+ :$nin => ['zoom']
247
+ }
248
+ }
249
+ end
250
+ end
251
+
252
+ context 'when value is a hash add values with same operator keys using $and' do
253
+ let(:base) do
254
+ query.add_field_expression('foo', {'$in' => ['bar']})
255
+ end
256
+
257
+ let(:modified) do
258
+ base.add_field_expression('foo', {'$in' => ['zoom']})
259
+ end
260
+
261
+ it 'adds the new condition using $and' do
262
+ modified.selector.should == {
263
+ 'foo' => {'$in' => ['bar']},
264
+ '$and' => ['foo' => {'$in' => ['zoom']}]
265
+ }
266
+ end
267
+ end
268
+
269
+ context 'when value is a hash with symbol operator key add values with same operator keys using $and' do
270
+ let(:base) do
271
+ query.add_field_expression('foo', {:$in => ['bar']})
272
+ end
273
+
274
+ let(:modified) do
275
+ base.add_field_expression('foo', {:$in => ['zoom']})
276
+ end
277
+
278
+ it 'adds the new condition using $and' do
279
+ modified.selector.should == {
280
+ 'foo' => {:$in => ['bar']},
281
+ '$and' => ['foo' => {:$in => ['zoom']}]
282
+ }
283
+ end
213
284
  end
285
+ end
214
286
 
215
287
  describe '#add_operator_expression' do
216
288
  let(:query_method) { :add_operator_expression }
@@ -4,6 +4,7 @@ require "spec_helper"
4
4
  require 'mongoid/association/referenced/has_many_models'
5
5
 
6
6
  describe Mongoid::QueryCache do
7
+ require_mri
7
8
 
8
9
  around do |spec|
9
10
  Mongoid::QueryCache.clear_cache
@@ -21,7 +22,7 @@ describe Mongoid::QueryCache do
21
22
  end
22
23
 
23
24
  after do
24
- Mrss::SessionRegistry.instance.verify_sessions_ended!
25
+ # Mrss::SessionRegistry.instance.verify_sessions_ended!
25
26
  end
26
27
 
27
28
  let(:reset_legacy_qc_warning) do
@@ -528,13 +528,11 @@ describe Mongoid::Serializable do
528
528
  end
529
529
 
530
530
  it "includes the first relation" do
531
- expect(relation_hash[0]).to include
532
- { "_id" => "kudamm", "street" => "Kudamm" }
531
+ expect(relation_hash[0]).to include({ "_id" => "kudamm", "street" => "Kudamm" })
533
532
  end
534
533
 
535
534
  it "includes the second relation" do
536
- expect(relation_hash[1]).to include
537
- { "_id" => "tauentzienstr", "street" => "Tauentzienstr" }
535
+ expect(relation_hash[1]).to include( "_id" => "tauentzienstr", "street" => "Tauentzienstr" )
538
536
  end
539
537
  end
540
538
 
@@ -545,13 +543,11 @@ describe Mongoid::Serializable do
545
543
  end
546
544
 
547
545
  it "includes the first relation" do
548
- expect(relation_hash[0]).to include
549
- { "_id" => "kudamm", "street" => "Kudamm" }
546
+ expect(relation_hash[0]).to include({ "_id" => "kudamm", "street" => "Kudamm" })
550
547
  end
551
548
 
552
549
  it "includes the second relation" do
553
- expect(relation_hash[1]).to include
554
- { "_id" => "tauentzienstr", "street" => "Tauentzienstr" }
550
+ expect(relation_hash[1]).to include({ "_id" => "tauentzienstr", "street" => "Tauentzienstr" })
555
551
  end
556
552
  end
557
553
 
@@ -670,8 +666,7 @@ describe Mongoid::Serializable do
670
666
  end
671
667
 
672
668
  it "includes the specified relation" do
673
- expect(relation_hash).to include
674
- { "_id" => "leo-marvin", "first_name" => "Leo", "last_name" => "Marvin" }
669
+ expect(relation_hash).to include({ "_id" => "Leo-Marvin", "first_name" => "Leo", "last_name" => "Marvin" })
675
670
  end
676
671
  end
677
672
 
@@ -682,8 +677,7 @@ describe Mongoid::Serializable do
682
677
  end
683
678
 
684
679
  it "includes the specified relation" do
685
- expect(relation_hash).to include
686
- { "_id" => "leo-marvin", "first_name" => "Leo", "last_name" => "Marvin" }
680
+ expect(relation_hash).to include({ "_id" => "Leo-Marvin", "first_name" => "Leo", "last_name" => "Marvin" })
687
681
  end
688
682
  end
689
683
 
@@ -694,8 +688,7 @@ describe Mongoid::Serializable do
694
688
  end
695
689
 
696
690
  it "includes the specified relation sans exceptions" do
697
- expect(relation_hash).to include
698
- { "first_name" => "Leo", "last_name" => "Marvin" }
691
+ expect(relation_hash).to include({ "first_name" => "Leo", "last_name" => "Marvin" })
699
692
  end
700
693
  end
701
694
  end
@@ -0,0 +1,28 @@
1
+ # Candidate Tasks
2
+
3
+ When using the `candidate` rake tasks, you must make sure:
4
+
5
+ 1. You are using at least `git` version 2.49.0.
6
+ 2. You have the `gh` CLI tool installed.
7
+ 3. You are logged into `gh` with an account that has collaborator access to the repository.
8
+ 4. You have run `gh repo set-default` from the root of your local checkout to set the default repository to the canonical MongoDB repo.
9
+ 5. The `origin` remote for your local checkout is set to your own fork.
10
+ 6. The `upstream` remote for your local checkout is set to the canonical
11
+ MongoDB repo.
12
+
13
+ Once configured, you can use the following commands:
14
+
15
+ 1. `rake candidate:prs` - This will list all pull requests that will be included in the next release. Any with `[?]` are unlabelled (or are not labelled with a recognized label). Otherwise, `[b]` means `bug`, `[f]` means `feature`, and `[x]` means `bcbreak`.
16
+ 2. `rake candidate:preview` - This will generate and display the release notes for the next release, based on the associated pull requests.
17
+ 3. `rake candidate:create` - This will create a new PR against the default repository, using the generated release notes as the description. The new PR will be given the `release-candidate` label.
18
+
19
+ Then, after the release candidate PR is approved and merged, the release process will automatically bundle, sign, and release the new version.
20
+
21
+ Once you've merged the PR, you can switch to the "Actions" tab for the repository on GitHub and look for the "Release" workflow (might be named differently), which should have triggered automatically. You can monitor the progress of the release there. If there are any problems, the workflow is generally safe to re-run after you've addressed them.
22
+
23
+ Things to do after the release succeeds:
24
+
25
+ 1. Copy the release notes from the PR and create a new release announcement on the forums (https://www.mongodb.com/community/forums/c/announcements/driver-releases/110).
26
+ 2. If the release was not automatically announced in #ruby, copy a link to the GitHub release or MongoDB forum post there.
27
+ 3. Close the release in Jira.
28
+
@@ -195,12 +195,15 @@ module Mrss
195
195
  'debian81' => 'debian:jessie',
196
196
  'debian92' => 'debian:stretch',
197
197
  'debian10' => 'debian:buster',
198
+ 'debian11' => 'debian:bullseye',
198
199
  'ubuntu1404' => 'ubuntu:trusty',
199
200
  'ubuntu1604' => 'ubuntu:xenial',
200
201
  'ubuntu1804' => 'ubuntu:bionic',
201
202
  'ubuntu2004' => 'ubuntu:focal',
203
+ 'ubuntu2204' => 'ubuntu:jammy',
202
204
  'rhel62' => 'centos:6',
203
205
  'rhel70' => 'centos:7',
206
+ 'rhel80' => 'rockylinux:8',
204
207
  }.freeze
205
208
 
206
209
  def base_image
@@ -231,6 +234,10 @@ module Mrss
231
234
  distro =~ /debian|ubuntu/
232
235
  end
233
236
 
237
+ def ubuntu?
238
+ distro=~ /ubuntu/
239
+ end
240
+
234
241
  def preload?
235
242
  !!@options[:preload]
236
243
  end
@@ -275,7 +282,7 @@ module Mrss
275
282
 
276
283
  def num_exposed_ports
277
284
  case @env['TOPOLOGY'] || 'standalone'
278
- when 'standalone'
285
+ when 'standalone', 'replica-set-single-node'
279
286
  1
280
287
  when 'replica-set'
281
288
  3
@@ -98,8 +98,8 @@ module Mrss
98
98
  def min_libmongocrypt_version(version)
99
99
  require_libmongocrypt
100
100
  before(:all) do
101
- actual_version = Gem::Version.new(Mongo::Crypt::Binding.mongocrypt_version(nil))
102
- min_version = Gem::Version.new(version)
101
+ actual_version = Utils.parse_version(Mongo::Crypt::Binding.mongocrypt_version(nil))
102
+ min_version = Utils.parse_version(version)
103
103
  unless actual_version >= min_version
104
104
  skip "libmongocrypt version #{min_version} required, but version #{actual_version} is available"
105
105
  end