airbrake 10.0.1 → 10.1.0.rc.1

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: f6ebb0d64b92742b80afe65583bf19f6c3fc7352d146e95765b8c5b7d2d1949b
4
- data.tar.gz: 2e02317eeb64c7f4ece9173b88af2033c13d630dc9072232d39a697495da3f19
3
+ metadata.gz: f48599a614943c56ab453213a73d26bb81656e675b9fe66ef8da6f742b31f5f0
4
+ data.tar.gz: aca5987ae07c235fb6db4b852d9259cc583f38779d9e65169ceed8b1a66857a9
5
5
  SHA512:
6
- metadata.gz: b69a9609edd060362d33626f715696ce41a49f05a796ad314f7cb7258d3e7b03274ebeb7ef8c4c17fc004f64cdd56f3af51ba5c59f62acaeb2416ee7517d3af2
7
- data.tar.gz: 99b1645d2b95c0d73d2bad8a2bc04960334e14e8d0d13f613d30f7666f250b05d5e0567944113302e8c6a6dc40a17fc8e897d6fc578af41af96426f07b79efc3
6
+ metadata.gz: 6b3a3223c947c6e69a58b7a0f2a37651dd3e796638fbc6223bd839dd9c3ac29eeba64eba9dba3c9d97cb51f9f4b92518b2de0a1172276384dffba6580a902e89
7
+ data.tar.gz: 5d6e5dca29361d99beb97e2d71e13e9d721526312346b36e2b9668a9d81590e5825f912b5793771402c4afb20b6a16db39c058295366dd20ed1f5da9ec74f5fe
@@ -28,7 +28,7 @@ module Delayed
28
28
  notice[:context][:action] = action
29
29
  end
30
30
 
31
- ::Airbrake.notify_queue_sync(
31
+ ::Airbrake.notify_queue(
32
32
  queue: action,
33
33
  error_count: 1,
34
34
  timing: 0.01,
@@ -36,7 +36,7 @@ module Delayed
36
36
 
37
37
  raise exception
38
38
  else
39
- ::Airbrake.notify_queue_sync(
39
+ ::Airbrake.notify_queue(
40
40
  queue: job_class || job.payload_object.class.name,
41
41
  error_count: 0,
42
42
  timing: timing,
@@ -6,15 +6,7 @@ module Airbrake
6
6
  module ActiveJob
7
7
  extend ActiveSupport::Concern
8
8
 
9
- # @return [Array<Regexp>] the list of known adapters
10
- ADAPTERS = [/Resque/, /Sidekiq/, /DelayedJob/].freeze
11
-
12
9
  def self.notify_airbrake(exception, job)
13
- queue_adapter = job.class.queue_adapter.to_s
14
-
15
- # Do not notify twice if a queue_adapter is configured already.
16
- raise exception if ADAPTERS.any? { |a| a =~ queue_adapter }
17
-
18
10
  notice = Airbrake.build_notice(exception)
19
11
  notice[:context][:component] = 'active_job'
20
12
  notice[:context][:action] = job.class.name
@@ -30,14 +22,14 @@ module Airbrake
30
22
  block.call
31
23
  end
32
24
  rescue StandardError => exception
33
- Airbrake.notify_queue_sync(
25
+ Airbrake.notify_queue(
34
26
  queue: job.class.name,
35
27
  error_count: 1,
36
28
  timing: 0.01,
37
29
  )
38
30
  raise exception
39
31
  else
40
- Airbrake.notify_queue_sync(
32
+ Airbrake.notify_queue(
41
33
  queue: job.class.name,
42
34
  error_count: 0,
43
35
  timing: timing,
@@ -26,6 +26,16 @@ module Airbrake
26
26
  # * `Marketing::Engine` recognizes it as `marketing#/pricing` (correct)
27
27
  engines.each do |engine|
28
28
  engine.routes.router.recognize(request_copy) do |route, _params|
29
+ # Skip "catch-all" routes such as:
30
+ # get '*path => 'pages#about'
31
+ #
32
+ # @todo The `glob?` method was added in Rails v4.2.0.beta1. We
33
+ # should remove the `respond_to?` check once we drop old Rails
34
+ # versions support.
35
+ #
36
+ # https://github.com/rails/rails/commit/5460591f0226a9d248b7b4f89186bd5553e7768f
37
+ next if route.respond_to?(:glob?) && route.glob?
38
+
29
39
  path =
30
40
  if engine == ::Rails.application
31
41
  route.path.spec.to_s
@@ -4,9 +4,20 @@ module Airbrake
4
4
  module Rails
5
5
  # BacktraceCleaner is a wrapper around Rails.backtrace_cleaner.
6
6
  class BacktraceCleaner
7
+ # @return [Regexp]
8
+ AIRBRAKE_FRAME_PATTERN = %r{/airbrake/lib/airbrake/}
9
+
7
10
  def self.clean(backtrace)
8
11
  ::Rails.backtrace_cleaner.clean(backtrace).first(1)
9
12
  end
10
13
  end
11
14
  end
12
15
  end
16
+
17
+ if defined?(Rails)
18
+ # Silence own frames to let the cleaner proceed to the next line (and probably
19
+ # find the correct call-site coming from the app code rather this library).
20
+ Rails.backtrace_cleaner.add_silencer do |line|
21
+ line =~ Airbrake::Rails::BacktraceCleaner::AIRBRAKE_FRAME_PATTERN
22
+ end
23
+ end
@@ -1,12 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Monkey-patch Net::HTTP to benchmark it.
4
- Net::HTTP.class_eval do
5
- alias_method :request_without_airbrake, :request
6
-
7
- def request(request, *args, &block)
8
- Airbrake::Rack.capture_timing(:http) do
9
- request_without_airbrake(request, *args, &block)
3
+ module Airbrake
4
+ module Rails
5
+ # Monkey-patch Net::HTTP to benchmark it.
6
+ # @api private
7
+ # @since v10.0.2
8
+ module NetHttp
9
+ def request(request, *args, &block)
10
+ Airbrake::Rack.capture_timing(:http) do
11
+ super(request, *args, &block)
12
+ end
13
+ end
10
14
  end
11
15
  end
12
16
  end
17
+
18
+ Net::HTTP.prepend(Airbrake::Rails::NetHttp)
@@ -5,6 +5,8 @@ module Airbrake
5
5
  # This railtie works for any Rails application that supports railties (Rails
6
6
  # 3.2+ apps). It makes Airbrake Ruby work with Rails and report errors
7
7
  # occurring in the application automatically.
8
+ #
9
+ # rubocop:disable Metrics/ClassLength, Metrics/BlockLength
8
10
  class Railtie < ::Rails::Railtie
9
11
  initializer('airbrake.middleware', after: :load_config_initializers) do |app|
10
12
  # Since Rails 3.2 the ActionDispatch::DebugExceptions middleware is
@@ -44,7 +46,6 @@ module Airbrake
44
46
  require 'airbrake/rake/tasks'
45
47
  end
46
48
 
47
- # rubocop:disable Metrics/BlockLength
48
49
  initializer('airbrake.action_controller') do
49
50
  ActiveSupport.on_load(:action_controller, run_once: true) do
50
51
  # Patches ActionController with methods that allow us to retrieve
@@ -92,7 +93,6 @@ module Airbrake
92
93
  end
93
94
  end
94
95
  end
95
- # rubocop:enable Metrics/BlockLength
96
96
 
97
97
  initializer('airbrake.active_record') do
98
98
  ActiveSupport.on_load(:active_record, run_once: true) do
@@ -112,11 +112,21 @@ module Airbrake
112
112
  )
113
113
 
114
114
  # Filter out parameters from SQL body.
115
- Airbrake.add_performance_filter(
116
- Airbrake::Filters::SqlFilter.new(
117
- ::ActiveRecord::Base.connection_config[:adapter],
118
- ),
119
- )
115
+ if ::ActiveRecord::Base.respond_to?(:connection_db_config)
116
+ # Rails 6.1+ deprecates "connection_config" in favor of
117
+ # "connection_db_config", so we need an updated call.
118
+ Airbrake.add_performance_filter(
119
+ Airbrake::Filters::SqlFilter.new(
120
+ ::ActiveRecord::Base.connection_db_config.configuration_hash[:adapter],
121
+ ),
122
+ )
123
+ else
124
+ Airbrake.add_performance_filter(
125
+ Airbrake::Filters::SqlFilter.new(
126
+ ::ActiveRecord::Base.connection_config[:adapter],
127
+ ),
128
+ )
129
+ end
120
130
  end
121
131
  end
122
132
  end
@@ -142,5 +152,6 @@ module Airbrake
142
152
  end
143
153
  end
144
154
  end
155
+ # rubocop:enable Metrics/ClassLength, Metrics/BlockLength
145
156
  end
146
157
  end
@@ -29,7 +29,7 @@ module Airbrake
29
29
  private
30
30
 
31
31
  def notify_airbrake(exception, context)
32
- Airbrake.notify(exception, context) do |notice|
32
+ Airbrake.notify(exception, job: context) do |notice|
33
33
  notice[:context][:component] = 'sidekiq'
34
34
  notice[:context][:action] = action(context)
35
35
  end
@@ -3,5 +3,5 @@
3
3
  # We use Semantic Versioning v2.0.0
4
4
  # More information: http://semver.org/
5
5
  module Airbrake
6
- AIRBRAKE_VERSION = '10.0.1'.freeze
6
+ AIRBRAKE_VERSION = '10.1.0.rc.1'.freeze
7
7
  end
@@ -54,12 +54,12 @@ Airbrake.configure do |c|
54
54
  # A list of parameters that should be filtered out of what is sent to
55
55
  # Airbrake. By default, all "password" attributes will have their contents
56
56
  # replaced.
57
- # https://github.com/airbrake/airbrake-ruby#blacklist_keys
58
- c.blacklist_keys = [/password/i, /authorization/i]
57
+ # https://github.com/airbrake/airbrake-ruby#blocklist_keys
58
+ c.blocklist_keys = [/password/i, /authorization/i]
59
59
 
60
60
  # Alternatively, you can integrate with Rails' filter_parameters.
61
61
  # Read more: https://goo.gl/gqQ1xS
62
- # c.blacklist_keys = Rails.application.config.filter_parameters
62
+ # c.blocklist_keys = Rails.application.config.filter_parameters
63
63
  end
64
64
 
65
65
  # A filter that collects request body information. Enable it if you are sure you
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.1
4
+ version: 10.1.0.rc.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-29 00:00:00.000000000 Z
11
+ date: 2020-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: airbrake-ruby
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.13'
19
+ version: 5.0.0.rc.1
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: '4.13'
26
+ version: 5.0.0.rc.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: appraisal
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '2'
89
+ version: 2.2.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '2'
96
+ version: 2.2.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rack
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -268,6 +268,20 @@ dependencies:
268
268
  - - '='
269
269
  - !ruby/object:Gem::Version
270
270
  version: 1.6.0
271
+ - !ruby/object:Gem::Dependency
272
+ name: ffi
273
+ requirement: !ruby/object:Gem::Requirement
274
+ requirements:
275
+ - - '='
276
+ - !ruby/object:Gem::Version
277
+ version: 1.12.2
278
+ type: :development
279
+ prerelease: false
280
+ version_requirements: !ruby/object:Gem::Requirement
281
+ requirements:
282
+ - - '='
283
+ - !ruby/object:Gem::Version
284
+ version: 1.12.2
271
285
  - !ruby/object:Gem::Dependency
272
286
  name: sidekiq
273
287
  requirement: !ruby/object:Gem::Requirement
@@ -431,9 +445,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
431
445
  version: '2.1'
432
446
  required_rubygems_version: !ruby/object:Gem::Requirement
433
447
  requirements:
434
- - - ">="
448
+ - - ">"
435
449
  - !ruby/object:Gem::Version
436
- version: '0'
450
+ version: 1.3.1
437
451
  requirements: []
438
452
  rubygems_version: 3.1.2
439
453
  signing_key: