sanger_warren 0.4.0 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdb0a5a3497a84b68ad0be1b01bfb80167452b6a3209badf12d5bba8cb9e3390
4
- data.tar.gz: 8271f438b3ad81320a3a1530292edefdc66a40b4e858a908568b151f22a3ae3c
3
+ metadata.gz: fdfbee5936ea1a0d909d947261f055d698f4b9b4d343559a9d2fe3432846de95
4
+ data.tar.gz: 752cf1b26528d531f12786f935526f349d2d9d003c05c9d1c9dba7be5908b062
5
5
  SHA512:
6
- metadata.gz: 517e0e58370945acc610974a4657fc424ee2483d4e794ce74ebe026580aad2fa47e23643304cedc6df99e6354e1a06a430387f70da71c877ec80bc022c7b3118
7
- data.tar.gz: 6bbdfe62aa22ea3bc42106800c79fe1f8b3a16a5d50898479ce17ab1b1bf3854ce02a65a83d641d07295dfb138df5ae2d43a60762a6f82c40f10cc1054877579
6
+ metadata.gz: cbbfd251869fa87a7a3fac8f96ee4f2b5ae0417e6df780ebf6add5a3610fa4502b1f3d72cbf9ac97af27099f3c54801c37d222f9d326211c73217f11fbcb4988
7
+ data.tar.gz: 834caca1dbd68fea25c1e64da6a2facdc6a68e40cda4a09dc7fb200889445e84f070f66215de6e5bea525ee46c4e7475205c9fd32dfed4360b039d8052e99fab
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
  strategy:
12
12
  matrix:
13
- ruby: [ '2.6', '2.7', '3.0' ]
13
+ ruby: [ '3.1' ]
14
14
  name: Ruby Test ${{ matrix.ruby }}
15
15
 
16
16
  steps:
@@ -32,7 +32,7 @@ jobs:
32
32
  - name: Set up Ruby
33
33
  uses: ruby/setup-ruby@v1
34
34
  with:
35
- ruby-version: 3.0
35
+ ruby-version: 3.1
36
36
  bundler-cache: true # Runs bundle install and caches gems. See the ruby_test.yml
37
37
  # example if you need more control over bundler.
38
38
  - name: Run lint
data/.rubocop.yml CHANGED
@@ -13,7 +13,7 @@ require:
13
13
  - rubocop-rspec
14
14
 
15
15
  AllCops:
16
- TargetRubyVersion: 2.6
16
+ TargetRubyVersion: 3.1
17
17
  NewCops: enable
18
18
  # Blocks are used to structure tests and are part of the shoulda dsl.
19
19
  # The standard BlockLength limits are too stringent for this purpose.
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1.6
data/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ Unreleased section to make new releases easy.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ### Changed
9
+
10
+ - The WARREN_TYPE environmental variable can now fully replace the config yaml
11
+
12
+ ## [0.4.1] - 2022-01-04
13
+
14
+ ### Changed
15
+
16
+ - Relaxed version constraints on dependencies
17
+
8
18
  ## [0.4.0] - 2021-06-09
9
19
 
10
20
  ### Fixed
@@ -25,7 +35,7 @@ Unreleased section to make new releases easy.
25
35
  - Warren::Handler::Test and Warren::Handler::Test::Channel no loner respond to
26
36
  `add_exchange`. These methods were undocumented, and unused internally.
27
37
 
28
- ## Changed
38
+ ### Changed
29
39
 
30
40
  - Messages must now implement `#headers`, although simply returning an empty
31
41
  hash is sufficient.
data/Gemfile CHANGED
@@ -15,4 +15,4 @@ gem 'simplecov'
15
15
  gem 'yard'
16
16
 
17
17
  # Used to provide instance_doubles for more robust testing
18
- gem 'activerecord', '~>5.2.0', require: false
18
+ gem 'activerecord', '~>7.2.2.1', require: false
data/Gemfile.lock CHANGED
@@ -1,40 +1,52 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sanger_warren (0.4.0)
5
- bunny (~> 2.17.0)
6
- connection_pool (~> 2.2.0)
4
+ sanger_warren (0.5.0)
5
+ bunny (~> 2.17)
6
+ connection_pool (~> 2.2)
7
7
  multi_json (~> 1.0)
8
- thor (~> 1.1.0)
8
+ thor (~> 1.1)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activemodel (5.2.6)
14
- activesupport (= 5.2.6)
15
- activerecord (5.2.6)
16
- activemodel (= 5.2.6)
17
- activesupport (= 5.2.6)
18
- arel (>= 9.0)
19
- activesupport (5.2.6)
20
- concurrent-ruby (~> 1.0, >= 1.0.2)
21
- i18n (>= 0.7, < 2)
22
- minitest (~> 5.1)
23
- tzinfo (~> 1.1)
24
- amq-protocol (2.3.2)
25
- arel (9.0.0)
13
+ activemodel (7.2.2.1)
14
+ activesupport (= 7.2.2.1)
15
+ activerecord (7.2.2.1)
16
+ activemodel (= 7.2.2.1)
17
+ activesupport (= 7.2.2.1)
18
+ timeout (>= 0.4.0)
19
+ activesupport (7.2.2.1)
20
+ base64
21
+ benchmark (>= 0.3)
22
+ bigdecimal
23
+ concurrent-ruby (~> 1.0, >= 1.3.1)
24
+ connection_pool (>= 2.2.5)
25
+ drb
26
+ i18n (>= 1.6, < 2)
27
+ logger (>= 1.4.2)
28
+ minitest (>= 5.1)
29
+ securerandom (>= 0.3)
30
+ tzinfo (~> 2.0, >= 2.0.5)
31
+ amq-protocol (2.3.3)
26
32
  ast (2.4.2)
27
- bunny (2.17.0)
28
- amq-protocol (~> 2.3, >= 2.3.1)
33
+ base64 (0.2.0)
34
+ benchmark (0.4.0)
35
+ bigdecimal (3.1.9)
36
+ bunny (2.24.0)
37
+ amq-protocol (~> 2.3)
38
+ sorted_set (~> 1, >= 1.0.2)
29
39
  coderay (1.1.3)
30
- concurrent-ruby (1.1.8)
31
- connection_pool (2.2.5)
40
+ concurrent-ruby (1.3.5)
41
+ connection_pool (2.5.0)
32
42
  diff-lcs (1.4.4)
33
43
  docile (1.4.0)
34
- i18n (1.8.10)
44
+ drb (2.2.1)
45
+ i18n (1.14.7)
35
46
  concurrent-ruby (~> 1.0)
47
+ logger (1.7.0)
36
48
  method_source (1.0.0)
37
- minitest (5.14.4)
49
+ minitest (5.25.5)
38
50
  multi_json (1.15.0)
39
51
  parallel (1.20.1)
40
52
  parser (3.0.1.1)
@@ -44,8 +56,9 @@ GEM
44
56
  method_source (~> 1.0)
45
57
  rainbow (3.0.0)
46
58
  rake (13.0.3)
59
+ rbtree (0.4.6)
47
60
  regexp_parser (2.1.1)
48
- rexml (3.2.5)
61
+ rexml (3.3.9)
49
62
  rspec (3.10.0)
50
63
  rspec-core (~> 3.10.0)
51
64
  rspec-expectations (~> 3.10.0)
@@ -76,25 +89,30 @@ GEM
76
89
  rubocop (~> 1.0)
77
90
  rubocop-ast (>= 1.1.0)
78
91
  ruby-progressbar (1.11.0)
92
+ securerandom (0.4.1)
93
+ set (1.1.1)
79
94
  simplecov (0.21.2)
80
95
  docile (~> 1.1)
81
96
  simplecov-html (~> 0.11)
82
97
  simplecov_json_formatter (~> 0.1)
83
98
  simplecov-html (0.12.3)
84
99
  simplecov_json_formatter (0.1.3)
85
- thor (1.1.0)
86
- thread_safe (0.3.6)
87
- tzinfo (1.2.9)
88
- thread_safe (~> 0.1)
100
+ sorted_set (1.0.3)
101
+ rbtree
102
+ set (~> 1.0)
103
+ thor (1.3.2)
104
+ timeout (0.4.3)
105
+ tzinfo (2.0.6)
106
+ concurrent-ruby (~> 1.0)
89
107
  unicode-display_width (2.0.0)
90
- yard (0.9.26)
108
+ yard (0.9.35)
91
109
 
92
110
  PLATFORMS
93
111
  ruby
94
112
  x86_64-darwin-19
95
113
 
96
114
  DEPENDENCIES
97
- activerecord (~> 5.2.0)
115
+ activerecord (~> 7.2.2.1)
98
116
  pry
99
117
  rake (~> 13.0)
100
118
  rspec (~> 3.0)
data/README.md CHANGED
@@ -9,7 +9,7 @@ RabbitMQ via the bunny gem.
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'sanger-warren'
12
+ gem 'sanger_warren'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -156,15 +156,22 @@ some testing examples can be found in the documentation for the
156
156
 
157
157
  ## Development
158
158
 
159
- After checking out the repo, run `bin/setup` to install dependencies. Then, run
160
- `rake spec` to run the tests. You can also run `bin/console` for an interactive
161
- prompt that will allow you to experiment.
159
+ Install the required ruby version as specified in `sanger-warren.gemspec`.
162
160
 
163
- To install this gem onto your local machine, run `bundle exec rake install`. To
164
- release a new version, update the version number in `version.rb`, and then run
165
- `bundle exec rake release`, which will create a git tag for the version, push
166
- git commits and tags, and push the `.gem` file to
167
- [rubygems.org](https://rubygems.org).
161
+ Install the required bundler version as specified by `BUNDLED WITH` in `Gemfile.lock`.
162
+
163
+ After checking out the repo, run `bin/setup` to install dependencies.
164
+
165
+ Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
166
+
167
+ To install this gem onto your local machine, run `bundle exec rake install`.
168
+
169
+ To release a new version:
170
+
171
+ - update the version number in `version.rb`
172
+ - run `bundle exec rake release` (which will create a git tag for the version)
173
+ - push git commits and tags
174
+ - push the `.gem` file to [rubygems.org](https://rubygems.org) (how?)
168
175
 
169
176
  ## Contributing
170
177
 
@@ -100,7 +100,15 @@ module Warren
100
100
 
101
101
  yield
102
102
  ensure
103
- ActiveRecord::Base.clear_active_connections!
103
+ # Although Rails 7.2 recommends using `ActiveRecord::Base.connection_handler.clear_active_connections!`
104
+ # to clear all active connections (especially in applications with multiple databases),
105
+ # Y25-234 investigated the performance and applicability of this versus
106
+ # `ActiveRecord::Base.connection_pool.release_connection`.
107
+ #
108
+ # Since Unified Warehouse (the primary Warren consumer) does not use multiple databases,
109
+ # `release_connection` was found to be more targeted and performant.
110
+ # Using `clear_active_connections!` would be redundant and potentially less efficient in this context.
111
+ ActiveRecord::Base.connection_pool.release_connection
104
112
  end
105
113
 
106
114
  # Returns the rails environment
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Warren
4
4
  # Gem version number. Bump prior to release of new version
5
- VERSION = '0.4.0'
5
+ VERSION = '0.5.0'
6
6
  end
data/lib/warren.rb CHANGED
@@ -29,7 +29,7 @@ module Warren
29
29
  #
30
30
  # @return [Warren::Handler::Base] Exact class determined by the type passed in
31
31
  #
32
- def self.construct(type:, config: {})
32
+ def self.construct(type: 'UNSPECIFIED', config: {})
33
33
  warren_type = ENV.fetch(WARREN_TYPE, type)
34
34
  case warren_type
35
35
  when 'test' then Warren::Handler::Test.new
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  the ability to switch in different adapters during testing and development.
15
15
  DESCRIPTION
16
16
  spec.homepage = 'https://github.com/sanger/warren'
17
- spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
17
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.1.0')
18
18
  spec.license = 'GPL'
19
19
 
20
20
  spec.metadata['homepage_uri'] = spec.homepage
@@ -32,8 +32,9 @@ Gem::Specification.new do |spec|
32
32
  spec.require_paths = ['lib']
33
33
 
34
34
  # Dependencies
35
- spec.add_runtime_dependency 'bunny', '~> 2.17.0'
36
- spec.add_runtime_dependency 'connection_pool', '~> 2.2.0'
35
+ spec.add_runtime_dependency 'bunny', '~> 2.17'
36
+ spec.add_runtime_dependency 'connection_pool', '~> 2.2'
37
37
  spec.add_runtime_dependency 'multi_json', '~> 1.0'
38
- spec.add_runtime_dependency 'thor', '~> 1.1.0'
38
+ spec.add_runtime_dependency 'thor', '~> 1.1'
39
+ spec.metadata['rubygems_mfa_required'] = 'true'
39
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanger_warren
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Glover
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-09 00:00:00.000000000 Z
11
+ date: 2025-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.17.0
19
+ version: '2.17'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.17.0
26
+ version: '2.17'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: connection_pool
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.2.0
33
+ version: '2.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.2.0
40
+ version: '2.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: multi_json
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.1.0
61
+ version: '1.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.1.0
68
+ version: '1.1'
69
69
  description: |
70
70
  Warren provides connection pooling for RabbitMQ connections. It also adds
71
71
  the ability to switch in different adapters during testing and development.
@@ -80,6 +80,7 @@ files:
80
80
  - ".gitignore"
81
81
  - ".rspec"
82
82
  - ".rubocop.yml"
83
+ - ".ruby-version"
83
84
  - ".yardopts"
84
85
  - CHANGELOG.md
85
86
  - Gemfile
@@ -140,7 +141,8 @@ metadata:
140
141
  source_code_uri: https://github.com/sanger/warren
141
142
  changelog_uri: https://github.com/sanger/warren/blob/master/CHANGELOG.md
142
143
  documentation_uri: https://rubydoc.info/gems/sanger_warren
143
- post_install_message:
144
+ rubygems_mfa_required: 'true'
145
+ post_install_message:
144
146
  rdoc_options: []
145
147
  require_paths:
146
148
  - lib
@@ -148,15 +150,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
150
  requirements:
149
151
  - - ">="
150
152
  - !ruby/object:Gem::Version
151
- version: 2.6.0
153
+ version: 3.1.0
152
154
  required_rubygems_version: !ruby/object:Gem::Requirement
153
155
  requirements:
154
156
  - - ">="
155
157
  - !ruby/object:Gem::Version
156
158
  version: '0'
157
159
  requirements: []
158
- rubygems_version: 3.1.4
159
- signing_key:
160
+ rubygems_version: 3.3.27
161
+ signing_key:
160
162
  specification_version: 4
161
163
  summary: Configuring and managing bunny RabbitMQ connections
162
164
  test_files: []