honeybadger 4.7.2 → 4.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -1
- data/README.md +0 -1
- data/lib/honeybadger/agent.rb +23 -0
- data/lib/honeybadger/backend/base.rb +9 -0
- data/lib/honeybadger/cli/install.rb +26 -0
- data/lib/honeybadger/config/defaults.rb +1 -0
- data/lib/honeybadger/config/yaml.rb +5 -1
- data/lib/honeybadger/plugins/sidekiq.rb +6 -4
- data/lib/honeybadger/singleton.rb +1 -0
- data/lib/honeybadger/util/lambda.rb +1 -1
- data/lib/honeybadger/util/revision.rb +1 -1
- data/lib/honeybadger/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 322f40e4f8b6fc9f0b9318a15e35c9fa1226dde665a22a89c52f0b28da58b7d4
|
4
|
+
data.tar.gz: 29b93815603f2e06c5c5c4fef6cb9113a6bf0ec77d5377f5f41c5272523105a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 725684978008ad0a72b8ffe519fa12f81205f0e9ad97bc2a15d5f44f9a3bb55e8923508103425b5569ee535c5a4f6f0e35f51c54303c6404d2b94365639e8659
|
7
|
+
data.tar.gz: cd59816ca1d77a29c599d89bfc897aeb798d37fc566ee3cabad19b3f1233d3cae637fc209bf983a7248349e1d2a4a0d8623da2d14debbe1445f24c1ab41fb960
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,33 @@ adheres to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [4.10.0] - 2022-01-19
|
9
|
+
### Added
|
10
|
+
- Add more items to the default config file
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
- Fix a Ruby 3.1 bug that breaks regexp classes in honeybadger.yml (#418)
|
14
|
+
|
15
|
+
## [4.9.0] - 2021-06-28
|
16
|
+
### Fixed
|
17
|
+
- Replaced fixed number for retries in Sidekiq Plugin with Sidekiq::JobRetry constant
|
18
|
+
- Properly set environment in deployment tracking (#404, @stmllr)
|
19
|
+
|
20
|
+
### Added
|
21
|
+
- Added 'ActionDispatch::Http::MimeNegotiation::InvalidType' (Rails 6.1) to
|
22
|
+
default ignore list. (#402, @jrochkind)
|
23
|
+
|
24
|
+
## [4.8.0] - 2021-03-16
|
25
|
+
### Fixed
|
26
|
+
- Suppress any error output from the `git rev-parse` command. ([#394](https://github.com/honeybadger-io/honeybadger-ruby/pull/394))
|
27
|
+
|
28
|
+
### Added
|
29
|
+
- Support deployment tracking in code (#397, @danleyden)
|
30
|
+
|
31
|
+
## [4.7.3] - 2021-02-10
|
32
|
+
### Fixed
|
33
|
+
- Don't enable Lambda plugin in non-Lambda execution environments
|
34
|
+
|
8
35
|
## [4.7.2] - 2020-08-17
|
9
36
|
### Fixed
|
10
37
|
- Remove usage of `ActiveRecord::Base.connection` (thanks @jcoyne for testing)
|
@@ -32,7 +59,7 @@ adheres to [Semantic Versioning](http://semver.org/).
|
|
32
59
|
### Fixed
|
33
60
|
- Fixed issue where Sidekiq.attempt_threshold was triggering 2 attempts ahead
|
34
61
|
of the setting
|
35
|
-
-
|
62
|
+
- Dupe notify opts before mutating (#345)
|
36
63
|
|
37
64
|
### Changed
|
38
65
|
- Breadcrumbs on by default
|
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
![Ruby](https://github.com/honeybadger-io/honeybadger-ruby/workflows/Ruby/badge.svg)
|
4
4
|
![JRuby](https://github.com/honeybadger-io/honeybadger-ruby/workflows/JRuby/badge.svg)
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/honeybadger.svg)](http://badge.fury.io/rb/honeybadger)
|
6
|
-
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=honeybadger&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=honeybadger&package-manager=bundler&version-scheme=semver)
|
7
6
|
|
8
7
|
This is the notifier gem for integrating apps with the :zap: [Honeybadger Exception Notifier for Ruby and Rails](http://honeybadger.io).
|
9
8
|
|
data/lib/honeybadger/agent.rb
CHANGED
@@ -190,6 +190,29 @@ module Honeybadger
|
|
190
190
|
response.success?
|
191
191
|
end
|
192
192
|
|
193
|
+
# Track a new deployment
|
194
|
+
#
|
195
|
+
# @example
|
196
|
+
# Honeybadger.track_deployment(revision: 'be2ceb6')
|
197
|
+
#
|
198
|
+
# @param [String] :environment The environment name. Defaults to the current configured environment.
|
199
|
+
# @param [String] :revision The VCS revision being deployed. Defaults to the currently configured revision.
|
200
|
+
# @param [String] :local_username The name of the user who performed the deploy.
|
201
|
+
# @param [String] :repository The base URL of the VCS repository. It should be HTTPS-style.
|
202
|
+
#
|
203
|
+
# @return [Boolean] true if the deployment was successfully tracked and false
|
204
|
+
# otherwise.
|
205
|
+
def track_deployment(environment: nil, revision: nil, local_username: nil, repository: nil)
|
206
|
+
opts = {
|
207
|
+
environment: environment || config[:env],
|
208
|
+
revision: revision || config[:revision],
|
209
|
+
local_username: local_username,
|
210
|
+
repository: repository
|
211
|
+
}
|
212
|
+
response = backend.track_deployment(opts)
|
213
|
+
response.success?
|
214
|
+
end
|
215
|
+
|
193
216
|
# Save global context for the current request.
|
194
217
|
#
|
195
218
|
# @example
|
@@ -99,6 +99,15 @@ module Honeybadger
|
|
99
99
|
raise NotImplementedError, 'must define #check_in on subclass.'
|
100
100
|
end
|
101
101
|
|
102
|
+
# Track a deployment
|
103
|
+
# @example
|
104
|
+
# backend.track_deployment({ revision: 'be2ceb6' })
|
105
|
+
#
|
106
|
+
# @param [#to_json] payload The JSON payload containing all deployment data.
|
107
|
+
def track_deployment(payload)
|
108
|
+
notify(:deploys, payload)
|
109
|
+
end
|
110
|
+
|
102
111
|
private
|
103
112
|
|
104
113
|
attr_reader :config
|
@@ -43,10 +43,36 @@ module Honeybadger
|
|
43
43
|
exit(1)
|
44
44
|
end
|
45
45
|
|
46
|
+
default_env = defined?(::Rails.application) ? "Rails.env" : "ENV['RUBY_ENV'] || ENV['RACK_ENV']"
|
47
|
+
default_root = defined?(::Rails.application) ? "Rails.root.to_s" : "Dir.pwd"
|
46
48
|
File.open(path, 'w+') do |file|
|
47
49
|
file.write(<<-CONFIG)
|
48
50
|
---
|
51
|
+
# For more options, see https://docs.honeybadger.io/lib/ruby/gem-reference/configuration
|
52
|
+
|
49
53
|
api_key: '#{api_key}'
|
54
|
+
|
55
|
+
# The environment your app is running in.
|
56
|
+
env: "<%= #{default_env} %>"
|
57
|
+
|
58
|
+
# The absolute path to your project folder.
|
59
|
+
root: "<%= #{default_root} %>"
|
60
|
+
|
61
|
+
# Honeybadger won't report errors in these environments.
|
62
|
+
development_environments:
|
63
|
+
- test
|
64
|
+
- development
|
65
|
+
- cucumber
|
66
|
+
|
67
|
+
# By default, Honeybadger won't report errors in the development_environments.
|
68
|
+
# You can override this by explicitly setting report_data to true or false.
|
69
|
+
# report_data: true
|
70
|
+
|
71
|
+
# The current Git revision of your project. Defaults to the last commit hash.
|
72
|
+
# revision: null
|
73
|
+
|
74
|
+
# Enable verbose debug logging (useful for troubleshooting).
|
75
|
+
debug: false
|
50
76
|
CONFIG
|
51
77
|
end
|
52
78
|
end
|
@@ -23,6 +23,7 @@ module Honeybadger
|
|
23
23
|
'ActionController::ParameterMissing',
|
24
24
|
'ActiveRecord::RecordNotFound',
|
25
25
|
'ActionController::UnknownAction',
|
26
|
+
'ActionDispatch::Http::MimeNegotiation::InvalidType',
|
26
27
|
'Rack::QueryParser::ParameterTypeError',
|
27
28
|
'Rack::QueryParser::InvalidParameterError',
|
28
29
|
'CGI::Session::CookieStore::TamperedWithCookie',
|
@@ -26,7 +26,11 @@ module Honeybadger
|
|
26
26
|
|
27
27
|
def self.load_yaml(path)
|
28
28
|
begin
|
29
|
-
|
29
|
+
# This uses `YAML.unsafe_load` to support loading arbitrary Ruby
|
30
|
+
# classes, such as !ruby/regexp. This was the default behavior prior
|
31
|
+
# to Psych 4. https://bugs.ruby-lang.org/issues/17866
|
32
|
+
method = YAML.respond_to?(:unsafe_load) ? :unsafe_load : :load
|
33
|
+
yaml = YAML.send(method, ERB.new(path.read).result)
|
30
34
|
rescue => e
|
31
35
|
config_error = ConfigError.new(e.to_s)
|
32
36
|
|
@@ -5,7 +5,7 @@ module Honeybadger
|
|
5
5
|
module Plugins
|
6
6
|
module Sidekiq
|
7
7
|
class Middleware
|
8
|
-
def call(
|
8
|
+
def call(_worker, _msg, _queue)
|
9
9
|
Honeybadger.clear!
|
10
10
|
yield
|
11
11
|
end
|
@@ -23,7 +23,7 @@ module Honeybadger
|
|
23
23
|
|
24
24
|
if defined?(::Sidekiq::VERSION) && ::Sidekiq::VERSION > '3'
|
25
25
|
::Sidekiq.configure_server do |sidekiq|
|
26
|
-
sidekiq.error_handlers << lambda {|ex, params|
|
26
|
+
sidekiq.error_handlers << lambda { |ex, params|
|
27
27
|
job = params[:job] || params
|
28
28
|
job_retry = job['retry'.freeze]
|
29
29
|
|
@@ -37,13 +37,15 @@ module Honeybadger
|
|
37
37
|
attempt = retry_count ? retry_count + 1 : 0
|
38
38
|
|
39
39
|
# Ensure we account for modified max_retries setting
|
40
|
-
|
40
|
+
default_max_retry_attempts = defined?(::Sidekiq::JobRetry::DEFAULT_MAX_RETRY_ATTEMPTS) ? ::Sidekiq::JobRetry::DEFAULT_MAX_RETRY_ATTEMPTS : 25
|
41
|
+
retry_limit = job_retry == true ? (sidekiq.options[:max_retries] || default_max_retry_attempts) : job_retry.to_i
|
42
|
+
|
41
43
|
limit = [retry_limit, threshold].min
|
42
44
|
|
43
45
|
return if attempt < limit
|
44
46
|
end
|
45
47
|
|
46
|
-
opts = {parameters: params}
|
48
|
+
opts = { parameters: params }
|
47
49
|
if config[:'sidekiq.use_component']
|
48
50
|
opts[:component] = job['wrapped'.freeze] || job['class'.freeze]
|
49
51
|
opts[:action] = 'perform' if opts[:component]
|
@@ -37,6 +37,7 @@ module Honeybadger
|
|
37
37
|
def_delegator :'Honeybadger::Agent.instance', :add_breadcrumb
|
38
38
|
def_delegator :'Honeybadger::Agent.instance', :breadcrumbs
|
39
39
|
def_delegator :'Honeybadger::Agent.instance', :clear!
|
40
|
+
def_delegator :'Honeybadger::Agent.instance', :track_deployment
|
40
41
|
|
41
42
|
# @!macro [attach] def_delegator
|
42
43
|
# @!method $2(...)
|
data/lib/honeybadger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeybadger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Honeybadger Industries LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Make managing application errors a more pleasant experience.
|
14
14
|
email:
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
|
-
rubygems_version: 3.
|
156
|
+
rubygems_version: 3.3.3
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Error reports you can be happy about.
|