hutch 0.26.0 → 0.27.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: eeb0e500b415b5c125335f93c9bdf6d7c44faf8588514cc0d9ff0d11d35e831c
4
- data.tar.gz: 4b96383eb819a42a9ce517e05499c85dcdde49602eec5a00dcf40a65b915239d
3
+ metadata.gz: 07e4ec8d85eefed7b25ae9bb43fb3c0ff8ffe0a4f24526b986686906aaa0f5cc
4
+ data.tar.gz: 94062cdf67c00e9224d3fee9be1fa294ba0e234f8400ec4efc640eaecc07a2df
5
5
  SHA512:
6
- metadata.gz: 4988b67c0057b9bb06273a87bb824741f735c549b39535030d9acbeec246bb9d746a93306291907776c8582eef171a883e162c9dc94488f6360d3333af17051f
7
- data.tar.gz: 863ec55200be7dfc18bf5c350f0dbf707e85b74c8397628113779a6c7858911ff9b65cd995e76526452811de32c05be0c94d6cf53d2387525735115faa35c777
6
+ metadata.gz: e5a9ef9a749741aee734246701cde0a99f1c36f02e730eb1e888d2a125dba6e4ed9f9cdf945656ebbf8dcd118775c4717110c4d542b6547df84119baeb29f0a4
7
+ data.tar.gz: 8a929dafd7c168256da9c349e4bf60a052456f2d34db4e717e3c46a08e461dac60f95ea6903a76a54bb934fbbcabb62a1c2e24b662469d3e5afd9e459a165b2c
@@ -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.1"
11
- - rvm: "2.5.3"
12
- - rvm: "2.4.5"
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.6.0"
14
+ - rvm: "jruby-9.2.8.0"
15
15
  - rvm: "ruby-head"
16
16
  allow_failures:
17
17
  rvm:
18
- - "jruby-9.2.6.0"
18
+ - "jruby-9.2.8.0"
19
19
  - ruby-head
20
20
 
21
21
  services:
@@ -1,6 +1,34 @@
1
- ## 0.27.0
1
+ ## 0.28.0 (under development)
2
2
 
3
- No changes yet.
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
@@ -23,7 +23,8 @@ group :development, :test do
23
23
  gem "honeybadger"
24
24
  gem "coveralls", "~> 0.8.15", require: false
25
25
  gem "newrelic_rpm"
26
- gem "airbrake", "~> 8.0"
26
+ gem "airbrake", "~> 9.0"
27
+ gem "rollbar"
27
28
  end
28
29
 
29
30
  group :development, :darwin do
data/README.md CHANGED
@@ -39,7 +39,7 @@ gem install hutch
39
39
 
40
40
  ## Requirements
41
41
 
42
- - Hutch requires Ruby 2.2+ or JRuby 9K.
42
+ - Hutch requires Ruby 2.3+ or JRuby 9K.
43
43
  - Hutch requires RabbitMQ 3.3 or later.
44
44
 
45
45
  ## Overview
@@ -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.12', '< 2.15'
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', '< 6'
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.'
@@ -4,5 +4,6 @@ module Hutch
4
4
  autoload :Sentry, 'hutch/error_handlers/sentry'
5
5
  autoload :Honeybadger, 'hutch/error_handlers/honeybadger'
6
6
  autoload :Airbrake, 'hutch/error_handlers/airbrake'
7
+ autoload :Rollbar, 'hutch/error_handlers/rollbar'
7
8
  end
8
9
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Hutch
2
- VERSION = '0.26.0'.freeze
2
+ VERSION = '0.27.0'.freeze
3
3
  end
@@ -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
@@ -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.26.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-02-13 00:00:00.000000000 Z
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.12'
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.12'
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: '6'
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: '6'
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.2
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