hutch 0.26.0 → 0.27.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 +4 -4
- data/.travis.yml +5 -5
- data/CHANGELOG.md +30 -2
- data/Gemfile +2 -1
- data/README.md +1 -1
- data/hutch.gemspec +2 -2
- data/lib/hutch/error_handlers.rb +1 -0
- data/lib/hutch/error_handlers/rollbar.rb +28 -0
- data/lib/hutch/version.rb +1 -1
- data/spec/hutch/error_handlers/rollbar_spec.rb +45 -0
- data/spec/hutch/waiter_spec.rb +2 -2
- metadata +10 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07e4ec8d85eefed7b25ae9bb43fb3c0ff8ffe0a4f24526b986686906aaa0f5cc
|
4
|
+
data.tar.gz: 94062cdf67c00e9224d3fee9be1fa294ba0e234f8400ec4efc640eaecc07a2df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5a9ef9a749741aee734246701cde0a99f1c36f02e730eb1e888d2a125dba6e4ed9f9cdf945656ebbf8dcd118775c4717110c4d542b6547df84119baeb29f0a4
|
7
|
+
data.tar.gz: 8a929dafd7c168256da9c349e4bf60a052456f2d34db4e717e3c46a08e461dac60f95ea6903a76a54bb934fbbcabb62a1c2e24b662469d3e5afd9e459a165b2c
|
data/.travis.yml
CHANGED
@@ -7,15 +7,15 @@ before_script:
|
|
7
7
|
- until sudo lsof -i:5672; do echo "Waiting for RabbitMQ to start..."; sleep 1; done
|
8
8
|
matrix:
|
9
9
|
include:
|
10
|
-
- rvm: "2.6.
|
11
|
-
- rvm: "2.5.
|
12
|
-
- rvm: "2.4.
|
10
|
+
- rvm: "2.6.4"
|
11
|
+
- rvm: "2.5.6"
|
12
|
+
- rvm: "2.4.7"
|
13
13
|
- rvm: "2.3.8"
|
14
|
-
- rvm: "jruby-9.2.
|
14
|
+
- rvm: "jruby-9.2.8.0"
|
15
15
|
- rvm: "ruby-head"
|
16
16
|
allow_failures:
|
17
17
|
rvm:
|
18
|
-
- "jruby-9.2.
|
18
|
+
- "jruby-9.2.8.0"
|
19
19
|
- ruby-head
|
20
20
|
|
21
21
|
services:
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,34 @@
|
|
1
|
-
## 0.
|
1
|
+
## 0.28.0 (under development)
|
2
2
|
|
3
|
-
No
|
3
|
+
No chages yet.
|
4
|
+
|
5
|
+
|
6
|
+
## 0.27.0 (September 9th, 2019)
|
7
|
+
|
8
|
+
### Enhancements
|
9
|
+
|
10
|
+
* Error handler for Rollback.
|
11
|
+
|
12
|
+
GitHub issue: [gocardless/hutch#332](https://github.com/gocardless/hutch/pull/332)
|
13
|
+
|
14
|
+
Contributed by Johan Kok.
|
15
|
+
|
16
|
+
### Bug Fixes
|
17
|
+
|
18
|
+
* Allow for the latest ActiveSupport version.
|
19
|
+
|
20
|
+
GitHub issue: [gocardless/hutch#334](https://github.com/gocardless/hutch/pull/334)
|
21
|
+
|
22
|
+
* Signal tests are now skipped on JRuby.
|
23
|
+
|
24
|
+
Contributed by Olle Jonsson.
|
25
|
+
|
26
|
+
GitHub issue: [gocardless/hutch#326](https://github.com/gocardless/hutch/pull/326)
|
27
|
+
|
28
|
+
### Dependency Bumps
|
29
|
+
|
30
|
+
Bunny and other dependencies were updated to their latest release
|
31
|
+
series.
|
4
32
|
|
5
33
|
|
6
34
|
## 0.26.0 (February 13th, 2019)
|
data/Gemfile
CHANGED
data/README.md
CHANGED
data/hutch.gemspec
CHANGED
@@ -6,11 +6,11 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.add_runtime_dependency 'march_hare', '>= 3.0.0'
|
7
7
|
else
|
8
8
|
gem.platform = Gem::Platform::RUBY
|
9
|
-
gem.add_runtime_dependency 'bunny', '>= 2.
|
9
|
+
gem.add_runtime_dependency 'bunny', '>= 2.13', '< 2.15'
|
10
10
|
end
|
11
11
|
gem.add_runtime_dependency 'carrot-top', '~> 0.0.7'
|
12
12
|
gem.add_runtime_dependency 'multi_json', '~> 1.12'
|
13
|
-
gem.add_runtime_dependency 'activesupport', '>= 4.2', '<
|
13
|
+
gem.add_runtime_dependency 'activesupport', '>= 4.2', '< 7'
|
14
14
|
|
15
15
|
gem.name = 'hutch'
|
16
16
|
gem.summary = 'Easy inter-service communication using RabbitMQ.'
|
data/lib/hutch/error_handlers.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'hutch/logging'
|
2
|
+
require 'rollbar'
|
3
|
+
require 'hutch/error_handlers/base'
|
4
|
+
|
5
|
+
module Hutch
|
6
|
+
module ErrorHandlers
|
7
|
+
class Rollbar < Base
|
8
|
+
def handle(properties, payload, consumer, ex)
|
9
|
+
message_id = properties.message_id
|
10
|
+
prefix = "message(#{message_id || '-'}):"
|
11
|
+
logger.error "#{prefix} Logging event to Rollbar"
|
12
|
+
logger.error "#{prefix} #{ex.class} - #{ex.message}"
|
13
|
+
|
14
|
+
::Rollbar.error(ex,
|
15
|
+
payload: payload,
|
16
|
+
consumer: consumer
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
def handle_setup_exception(ex)
|
21
|
+
logger.error "Logging setup exception to Rollbar"
|
22
|
+
logger.error "#{ex.class} - #{ex.message}"
|
23
|
+
|
24
|
+
::Rollbar.error(ex)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/hutch/version.rb
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hutch::ErrorHandlers::Rollbar do
|
4
|
+
let(:error_handler) { Hutch::ErrorHandlers::Rollbar.new }
|
5
|
+
|
6
|
+
describe '#handle' do
|
7
|
+
let(:error) do
|
8
|
+
begin
|
9
|
+
raise "Stuff went wrong"
|
10
|
+
rescue RuntimeError => err
|
11
|
+
err
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it "logs the error to Rollbar" do
|
16
|
+
message_id = "1"
|
17
|
+
properties = OpenStruct.new(message_id: message_id)
|
18
|
+
payload = "{}"
|
19
|
+
consumer = double
|
20
|
+
ex = error
|
21
|
+
message = {
|
22
|
+
payload: payload,
|
23
|
+
consumer: consumer
|
24
|
+
}
|
25
|
+
expect(::Rollbar).to receive(:error).with(ex, message)
|
26
|
+
error_handler.handle(properties, payload, consumer, ex)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#handle_setup_exception' do
|
31
|
+
let(:error) do
|
32
|
+
begin
|
33
|
+
raise "Stuff went wrong"
|
34
|
+
rescue RuntimeError => err
|
35
|
+
err
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it "logs the error to Rollbar" do
|
40
|
+
ex = error
|
41
|
+
expect(::Rollbar).to receive(:error).with(ex)
|
42
|
+
error_handler.handle_setup_exception(ex)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/spec/hutch/waiter_spec.rb
CHANGED
@@ -22,7 +22,7 @@ RSpec.describe Hutch::Waiter do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
context 'a TERM signal is received' do
|
25
|
+
context 'a TERM signal is received', if: !defined?(JRUBY_VERSION) do
|
26
26
|
it 'logs that hutch is stopping' do
|
27
27
|
expect(Hutch::Logging.logger).to receive(:info)
|
28
28
|
.with('caught SIGTERM, stopping hutch...')
|
@@ -32,7 +32,7 @@ RSpec.describe Hutch::Waiter do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
context 'a INT signal is received' do
|
35
|
+
context 'a INT signal is received', if: !defined?(JRUBY_VERSION) do
|
36
36
|
it 'logs that hutch is stopping' do
|
37
37
|
expect(Hutch::Logging.logger).to receive(:info)
|
38
38
|
.with('caught SIGINT, stopping hutch...')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hutch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harry Marr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.13'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '2.15'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '2.
|
29
|
+
version: '2.13'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2.15'
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
version: '4.2'
|
68
68
|
- - "<"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: '
|
70
|
+
version: '7'
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -77,7 +77,7 @@ dependencies:
|
|
77
77
|
version: '4.2'
|
78
78
|
- - "<"
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
80
|
+
version: '7'
|
81
81
|
description: Hutch is a Ruby library for enabling asynchronous inter-service communication
|
82
82
|
using RabbitMQ.
|
83
83
|
email:
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/hutch/error_handlers/base.rb
|
118
118
|
- lib/hutch/error_handlers/honeybadger.rb
|
119
119
|
- lib/hutch/error_handlers/logger.rb
|
120
|
+
- lib/hutch/error_handlers/rollbar.rb
|
120
121
|
- lib/hutch/error_handlers/sentry.rb
|
121
122
|
- lib/hutch/exceptions.rb
|
122
123
|
- lib/hutch/logging.rb
|
@@ -139,6 +140,7 @@ files:
|
|
139
140
|
- spec/hutch/error_handlers/airbrake_spec.rb
|
140
141
|
- spec/hutch/error_handlers/honeybadger_spec.rb
|
141
142
|
- spec/hutch/error_handlers/logger_spec.rb
|
143
|
+
- spec/hutch/error_handlers/rollbar_spec.rb
|
142
144
|
- spec/hutch/error_handlers/sentry_spec.rb
|
143
145
|
- spec/hutch/logger_spec.rb
|
144
146
|
- spec/hutch/message_spec.rb
|
@@ -175,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
177
|
- !ruby/object:Gem::Version
|
176
178
|
version: '0'
|
177
179
|
requirements: []
|
178
|
-
rubygems_version: 3.0.
|
180
|
+
rubygems_version: 3.0.3
|
179
181
|
signing_key:
|
180
182
|
specification_version: 4
|
181
183
|
summary: Easy inter-service communication using RabbitMQ.
|
@@ -187,6 +189,7 @@ test_files:
|
|
187
189
|
- spec/hutch/error_handlers/airbrake_spec.rb
|
188
190
|
- spec/hutch/error_handlers/honeybadger_spec.rb
|
189
191
|
- spec/hutch/error_handlers/logger_spec.rb
|
192
|
+
- spec/hutch/error_handlers/rollbar_spec.rb
|
190
193
|
- spec/hutch/error_handlers/sentry_spec.rb
|
191
194
|
- spec/hutch/logger_spec.rb
|
192
195
|
- spec/hutch/message_spec.rb
|