exception_handling 2.17.0.pre.tstarck.1 → 3.0.0.pre.2

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: 4074e67f0ede6cb73665a058c3cd09b02e7518e0fb4d0860d0ce4378aa4023b6
4
- data.tar.gz: e2d3726622a44753b679de1f645d3bbf40780c8d8829f46e7803661a7f583100
3
+ metadata.gz: ac0b3024c051127bd91c798fe917137f450b3db8ebc315434ecfade3b8775279
4
+ data.tar.gz: 829cd3c05ca289525a789a5b8b93e61a1b996a7a407d91a182f0a126a5a15344
5
5
  SHA512:
6
- metadata.gz: aa6b1574ba37ac1aee58bfb3bbfc9c15a083d255fa031c1b61dc205dad06c7a1bbee62c6fc6a1e5d24d341f88fa01806cef133cba8beb9f1ad34f0278dbe2848
7
- data.tar.gz: e1f4e2e4dc2ff78d948a31eabc2091d7c853f117f2f03c300ee90b4d2b362d59dfe89590d5ae3f8b2949d40e40a09d60ed418786c4dbee9180fb188b590296b9
6
+ metadata.gz: a6ff724591f83d687cd332e35b18a9407a97fd99182e7d255ec34e4a0eaed2dd729446df7c8639734d0338c816c12ed4803adf040a1252a0912e8d0c8035d4b2
7
+ data.tar.gz: aac19d62e8bd367eed9bb5dd3e80903161af053410f0ab4a5c251f5115e520ebf3d73d3f86e3789968234f2df2ed69b86454483ff029938854805c733246017e
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.5
1
+ 3.1.2
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.7.5
1
+ ruby 3.1.2
data/Appraisals CHANGED
@@ -1,19 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  appraise "rails-5" do
4
- gem 'actionmailer', '~> 5.2'
5
- gem 'actionpack', '~> 5.2'
6
4
  gem 'activesupport', '~> 5.2'
7
5
  end
8
6
 
9
7
  appraise "rails-6" do
10
- gem 'actionmailer', '~> 6.0'
11
- gem 'actionpack', '~> 6.0'
12
8
  gem 'activesupport', '~> 6.0'
13
9
  end
14
10
 
15
11
  appraise "rails-7" do
16
- gem 'actionmailer', '~> 7.0'
17
- gem 'actionpack', '~> 7.0'
18
12
  gem 'activesupport', '~> 7.0'
19
13
  end
data/CHANGELOG.md CHANGED
@@ -4,18 +4,19 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  **Note:** this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [2.17.0] - Unreleased
7
+ ## [3.0.0] - Unreleased
8
8
  ### Added
9
- - Add interface for tagging exceptions sent to honeybadger with values from the log context.
10
- - `ExceptionHandling.add_honeybadger_tag_from_log_context`
11
- - Added Ruby 3.2 and 3.3 to the CI test matrix
9
+ - Added explicit testing and support for Ruby 3.2 and 3.3
12
10
 
13
11
  ### Changed
14
- - Require ruby version 2.7 or greater
12
+ - Changed `ExceptionHandling.email_environment` configuration to `ExceptionHandling.environment`
15
13
 
16
14
  ### Removed
17
- - Removed Ruby versions 2.5 and 2.6 from the CI test matrix.
18
-
15
+ - Removed explicit testing of Rails 5
16
+ - Removed all emailing logic from the gem
17
+ - Removed all sensu alerting logic from the gem
18
+ - Removed `Methods` module
19
+ - Removed functionality from `ExceptionHandling.logger=` will implicitly extend the logger with `ContextualLogger::LoggerMixin`
19
20
 
20
21
  ## [2.16.0] - 2023-05-01
21
22
  ### Added
data/Gemfile CHANGED
@@ -4,9 +4,7 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
- gem 'actionmailer', '~> 6.0'
8
- gem 'actionpack', '~> 6.0'
9
- gem 'activesupport', '~> 6.0'
7
+ gem 'activesupport'
10
8
  gem 'appraisal', '~> 2.2'
11
9
  gem 'honeybadger', '~> 4.11'
12
10
  gem 'pry'
data/Gemfile.lock CHANGED
@@ -1,172 +1,94 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- exception_handling (2.17.0.pre.tstarck.1)
5
- actionmailer (>= 5.2)
6
- actionpack (>= 5.2)
4
+ exception_handling (3.0.0.pre.2)
7
5
  activesupport (>= 5.2)
8
6
  contextual_logger (~> 1.0)
9
7
  escalate (~> 0.3)
10
- eventmachine (~> 1.0)
11
8
  invoca-utils (~> 0.3)
12
- net-smtp
13
9
  psych (~> 3.0)
14
10
 
15
11
  GEM
16
12
  remote: https://rubygems.org/
17
13
  specs:
18
- actionmailer (6.1.7.6)
19
- actionpack (= 6.1.7.6)
20
- actionview (= 6.1.7.6)
21
- activejob (= 6.1.7.6)
22
- activesupport (= 6.1.7.6)
23
- mail (~> 2.5, >= 2.5.4)
24
- rails-dom-testing (~> 2.0)
25
- actionpack (6.1.7.6)
26
- actionview (= 6.1.7.6)
27
- activesupport (= 6.1.7.6)
28
- rack (~> 2.0, >= 2.0.9)
29
- rack-test (>= 0.6.3)
30
- rails-dom-testing (~> 2.0)
31
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
32
- actionview (6.1.7.6)
33
- activesupport (= 6.1.7.6)
34
- builder (~> 3.1)
35
- erubi (~> 1.4)
36
- rails-dom-testing (~> 2.0)
37
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
38
- activejob (6.1.7.6)
39
- activesupport (= 6.1.7.6)
40
- globalid (>= 0.3.6)
41
- activesupport (6.1.7.6)
14
+ activesupport (6.0.4.7)
42
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
43
- i18n (>= 1.6, < 2)
44
- minitest (>= 5.1)
45
- tzinfo (~> 2.0)
46
- zeitwerk (~> 2.3)
47
- appraisal (2.5.0)
16
+ i18n (>= 0.7, < 2)
17
+ minitest (~> 5.1)
18
+ tzinfo (~> 1.1)
19
+ zeitwerk (~> 2.2, >= 2.2.2)
20
+ appraisal (2.2.0)
48
21
  bundler
49
22
  rake
50
23
  thor (>= 0.14.0)
51
- ast (2.4.2)
52
- builder (3.2.4)
24
+ ast (2.4.0)
53
25
  byebug (11.1.3)
54
26
  coderay (1.1.3)
55
- concurrent-ruby (1.2.3)
27
+ concurrent-ruby (1.1.10)
56
28
  contextual_logger (1.3.0)
57
29
  activesupport (< 7.1)
58
30
  json
59
- crass (1.0.6)
60
- date (3.3.4)
61
- diff-lcs (1.5.1)
62
- erubi (1.12.0)
31
+ diff-lcs (1.5.0)
63
32
  escalate (0.3.0)
64
- eventmachine (1.2.7)
65
- globalid (1.2.1)
66
- activesupport (>= 6.1)
67
- honeybadger (4.12.2)
68
- i18n (1.14.1)
33
+ honeybadger (4.11.0)
34
+ i18n (1.10.0)
69
35
  concurrent-ruby (~> 1.0)
70
36
  invoca-utils (0.5.1)
71
37
  activesupport (>= 5.0)
38
+ jaro_winkler (1.5.3)
72
39
  json (2.7.1)
73
- language_server-protocol (3.17.0.3)
74
- loofah (2.22.0)
75
- crass (~> 1.0.2)
76
- nokogiri (>= 1.12.0)
77
- mail (2.8.1)
78
- mini_mime (>= 0.1.1)
79
- net-imap
80
- net-pop
81
- net-smtp
82
40
  method_source (1.0.0)
83
- mini_mime (1.1.5)
84
- mini_portile2 (2.8.5)
85
- minitest (5.22.2)
86
- net-imap (0.4.10)
87
- date
88
- net-protocol
89
- net-pop (0.1.2)
90
- net-protocol
91
- net-protocol (0.2.2)
92
- timeout
93
- net-smtp (0.4.0.1)
94
- net-protocol
95
- nokogiri (1.15.5)
96
- mini_portile2 (~> 2.8.2)
97
- racc (~> 1.4)
98
- parallel (1.24.0)
99
- parser (3.3.0.5)
100
- ast (~> 2.4.1)
101
- racc
102
- power_assert (2.0.3)
41
+ minitest (5.15.0)
42
+ parallel (1.17.0)
43
+ parser (2.6.3.0)
44
+ ast (~> 2.4.0)
45
+ power_assert (1.2.0)
103
46
  pry (0.14.2)
104
47
  coderay (~> 1.1)
105
48
  method_source (~> 1.0)
106
- pry-byebug (3.10.1)
49
+ pry-byebug (3.8.0)
107
50
  byebug (~> 11.0)
108
- pry (>= 0.13, < 0.15)
51
+ pry (~> 0.10)
109
52
  psych (3.3.4)
110
- racc (1.7.3)
111
- rack (2.2.8)
112
- rack-test (2.1.0)
113
- rack (>= 1.3)
114
- rails-dom-testing (2.2.0)
115
- activesupport (>= 5.0.0)
116
- minitest
117
- nokogiri (>= 1.6)
118
- rails-html-sanitizer (1.6.0)
119
- loofah (~> 2.21)
120
- nokogiri (~> 1.14)
121
- rainbow (3.1.1)
122
- rake (13.1.0)
123
- regexp_parser (2.9.0)
124
- rexml (3.2.6)
125
- rspec (3.13.0)
126
- rspec-core (~> 3.13.0)
127
- rspec-expectations (~> 3.13.0)
128
- rspec-mocks (~> 3.13.0)
129
- rspec-core (3.13.0)
130
- rspec-support (~> 3.13.0)
131
- rspec-expectations (3.13.0)
53
+ rainbow (3.0.0)
54
+ rake (13.0.1)
55
+ rspec (3.9.0)
56
+ rspec-core (~> 3.9.0)
57
+ rspec-expectations (~> 3.9.0)
58
+ rspec-mocks (~> 3.9.0)
59
+ rspec-core (3.9.2)
60
+ rspec-support (~> 3.9.3)
61
+ rspec-expectations (3.9.2)
132
62
  diff-lcs (>= 1.2.0, < 2.0)
133
- rspec-support (~> 3.13.0)
134
- rspec-mocks (3.13.0)
63
+ rspec-support (~> 3.9.0)
64
+ rspec-mocks (3.9.1)
135
65
  diff-lcs (>= 1.2.0, < 2.0)
136
- rspec-support (~> 3.13.0)
137
- rspec-support (3.13.0)
138
- rspec_junit_formatter (0.6.0)
66
+ rspec-support (~> 3.9.0)
67
+ rspec-support (3.9.4)
68
+ rspec_junit_formatter (0.4.1)
139
69
  rspec-core (>= 2, < 4, != 2.12.0)
140
- rubocop (1.60.2)
141
- json (~> 2.3)
142
- language_server-protocol (>= 3.17.0)
70
+ rubocop (0.74.0)
71
+ jaro_winkler (~> 1.5.1)
143
72
  parallel (~> 1.10)
144
- parser (>= 3.3.0.2)
73
+ parser (>= 2.6)
145
74
  rainbow (>= 2.2.2, < 4.0)
146
- regexp_parser (>= 1.8, < 3.0)
147
- rexml (>= 3.2.5, < 4.0)
148
- rubocop-ast (>= 1.30.0, < 2.0)
149
75
  ruby-progressbar (~> 1.7)
150
- unicode-display_width (>= 2.4.0, < 3.0)
151
- rubocop-ast (1.30.0)
152
- parser (>= 3.2.1.0)
153
- ruby-progressbar (1.13.0)
154
- test-unit (3.6.1)
76
+ unicode-display_width (>= 1.4.0, < 1.7)
77
+ ruby-progressbar (1.10.1)
78
+ test-unit (3.3.6)
155
79
  power_assert
156
- thor (1.3.0)
157
- timeout (0.4.1)
158
- tzinfo (2.0.6)
159
- concurrent-ruby (~> 1.0)
160
- unicode-display_width (2.5.0)
161
- zeitwerk (2.6.13)
80
+ thor (1.0.1)
81
+ thread_safe (0.3.6)
82
+ tzinfo (1.2.9)
83
+ thread_safe (~> 0.1)
84
+ unicode-display_width (1.6.0)
85
+ zeitwerk (2.5.4)
162
86
 
163
87
  PLATFORMS
164
88
  ruby
165
89
 
166
90
  DEPENDENCIES
167
- actionmailer (~> 6.0)
168
- actionpack (~> 6.0)
169
- activesupport (~> 6.0)
91
+ activesupport
170
92
  appraisal (~> 2.2)
171
93
  exception_handling!
172
94
  honeybadger (~> 4.11)
data/README.md CHANGED
@@ -30,21 +30,12 @@ require "exception_handling"
30
30
 
31
31
  # required
32
32
  ExceptionHandling.server_name = Cluster['server_name']
33
- ExceptionHandling.sender_address = %("Exceptions" <exceptions@example.com>)
34
- ExceptionHandling.exception_recipients = ['exceptions@example.com']
35
33
  ExceptionHandling.logger = Rails.logger
36
34
 
37
35
  # optional
38
- ExceptionHandling.escalation_recipients = ['escalation@example.com']
39
36
  ExceptionHandling.filter_list_filename = "#{Rails.root}/config/exception_filters.yml"
40
- ExceptionHandling.email_environment = Rails.env
41
- ExceptionHandling.eventmachine_safe = false
42
- ExceptionHandling.eventmachine_synchrony = false
43
- ExceptionHandling.sensu_host = "127.0.0.1"
44
- ExceptionHandling.sensu_port = 3030
45
- ExceptionHandling.sensu_prefix = ""
37
+ ExceptionHandling.environment = Rails.env
46
38
  ExceptionHandling.honeybadger_auto_tagger = ->(exception) { [] } # See "Automatically Tagging Exceptions" section below for examples
47
- ExceptionHandling.add_honeybadger_tag_from_log_context("tag-name", path: ["path", "in", "log", "context"])
48
39
  ```
49
40
 
50
41
  ## Usage
@@ -81,7 +72,7 @@ log_error(ex, "A specific error occurred.", honeybadger_tags: ["critical", "sequ
81
72
 
82
73
  **Note**: Manual tags will be merged with any automatic tags.
83
74
 
84
- #### Automatically Tagging Exceptions via Proc (`honeybadger_auto_tagger=`)
75
+ #### Automatically Tagging Exceptions (`honeybadger_auto_tagger=`)
85
76
 
86
77
  Configure exception handling so that you can automatically apply multiple tags to exceptions sent to honeybadger.
87
78
 
@@ -99,34 +90,6 @@ Example to disable auto-tagging:
99
90
  ExceptionHandling.honeybadger_auto_tagger = nil
100
91
  ```
101
92
 
102
- #### Automatically Tagging Exceptions from Log Context (`add_honeybadger_tag_from_log_context`)
103
-
104
- Add a tag to exceptions sent to honeybadger based on a value in the log context.
105
-
106
- To configure this, use the `add_honeybadger_tag_from_log_context` method.
107
- ```ruby
108
- ExceptionHandling.add_honeybadger_tag_from_log_context("kubernetes_context", path: ["kubernetes", "context"])
109
- ```
110
-
111
- This will add a tag to the exception if the log context contains a value at the specified path: "kubernetes" => { "context" => "value" }.
112
-
113
- For example:
114
- ```ruby
115
- ExceptionHandling.logger.with_context("kubernetes" => { "context" => "local" }) do
116
- log_error(ex, "A specific error occurred.")
117
- end
118
- ```
119
-
120
- This will add the following tag to the exception sent to honeybadger:
121
- ```
122
- kubernetes_context:local
123
- ```
124
-
125
- To clear all automated tagging from the log context, use the `clear_honeybadger_tags_from_log_context` method.
126
- ```ruby
127
- ExceptionHandling.clear_honeybadger_tags_from_log_context
128
- ```
129
-
130
93
  ## Custom Hooks
131
94
 
132
95
  ### custom_data_hook
@@ -5,8 +5,8 @@ require File.expand_path('lib/exception_handling/version', __dir__)
5
5
  Gem::Specification.new do |spec|
6
6
  spec.authors = ["Invoca"]
7
7
  spec.email = ["development@invoca.com"]
8
- spec.description = 'Exception handling logger/emailer'
9
- spec.summary = "Invoca's exception handling logger/emailer layer, based on exception_notifier. Works with Rails or EventMachine or EventMachine+Synchrony."
8
+ spec.description = 'Exception handling logger'
9
+ spec.summary = "Invoca's exception handling logger layer, based on exception_notifier."
10
10
  spec.homepage = "https://github.com/Invoca/exception_handling"
11
11
 
12
12
  spec.files = `git ls-files`.split("\n")
@@ -15,20 +15,14 @@ Gem::Specification.new do |spec|
15
15
  spec.name = "exception_handling"
16
16
  spec.require_paths = ["lib"]
17
17
  spec.version = ExceptionHandling::VERSION
18
- spec.metadata = {
18
+ spec.metadata = {
19
19
  "source_code_uri" => "https://github.com/Invoca/exception_handling",
20
20
  "allowed_push_host" => "https://rubygems.org"
21
21
  }
22
22
 
23
- spec.required_ruby_version = '>= 2.7.0'
24
-
25
- spec.add_dependency 'actionmailer', '>= 5.2'
26
- spec.add_dependency 'actionpack', '>= 5.2'
27
23
  spec.add_dependency 'activesupport', '>= 5.2'
28
24
  spec.add_dependency 'contextual_logger', '~> 1.0'
29
25
  spec.add_dependency 'escalate', '~> 0.3'
30
- spec.add_dependency 'eventmachine', '~> 1.0'
31
26
  spec.add_dependency 'invoca-utils', '~> 0.3'
32
27
  spec.add_dependency 'psych', '~> 3.0'
33
- spec.add_dependency 'net-smtp'
34
28
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "activesupport", "~> 5.2"
5
6
  gem "appraisal", "~> 2.2"
6
7
  gem "honeybadger", "~> 4.11"
7
8
  gem "pry"
@@ -11,8 +12,5 @@ gem "rspec"
11
12
  gem "rspec_junit_formatter"
12
13
  gem "rubocop"
13
14
  gem "test-unit"
14
- gem "actionmailer", "~> 5.2"
15
- gem "actionpack", "~> 5.2"
16
- gem "activesupport", "~> 5.2"
17
15
 
18
16
  gemspec path: "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "activesupport", "~> 6.0"
5
6
  gem "appraisal", "~> 2.2"
6
7
  gem "honeybadger", "~> 4.11"
7
8
  gem "pry"
@@ -11,8 +12,5 @@ gem "rspec"
11
12
  gem "rspec_junit_formatter"
12
13
  gem "rubocop"
13
14
  gem "test-unit"
14
- gem "actionmailer", "~> 6.0"
15
- gem "actionpack", "~> 6.0"
16
- gem "activesupport", "~> 6.0"
17
15
 
18
16
  gemspec path: "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "activesupport", "~> 7.0"
5
6
  gem "appraisal", "~> 2.2"
6
7
  gem "honeybadger", "~> 4.11"
7
8
  gem "pry"
@@ -11,8 +12,5 @@ gem "rspec"
11
12
  gem "rspec_junit_formatter"
12
13
  gem "rubocop"
13
14
  gem "test-unit"
14
- gem "actionmailer", "~> 7.0"
15
- gem "actionpack", "~> 7.0"
16
- gem "activesupport", "~> 7.0"
17
15
 
18
16
  gemspec path: "../"
@@ -9,7 +9,7 @@ module ExceptionHandling
9
9
 
10
10
  protected
11
11
 
12
- delegate :log_error_rack, :log_warning, :log_info, :log_debug, :escalate_error, :escalate_warning, :ensure_escalation, :alert_warning, :log_error, to: ExceptionHandling
12
+ delegate :log_error_rack, :log_warning, :log_info, :log_debug, :log_error, to: ExceptionHandling
13
13
 
14
14
  def ensure_safe(exception_context = "")
15
15
  yield
@@ -17,11 +17,5 @@ module ExceptionHandling
17
17
  log_error ex, exception_context
18
18
  nil
19
19
  end
20
-
21
- def ensure_alert(*args)
22
- ExceptionHandling.ensure_alert(*args) do
23
- yield
24
- end
25
- end
26
20
  end
27
21
  end
@@ -60,18 +60,5 @@ module ExceptionHandling
60
60
  "LoggingMethodsControllerStub"
61
61
  end
62
62
  end
63
-
64
- class MethodsControllerStub < ControllerStubBase
65
- include ExceptionHandling::Methods
66
- set_long_controller_action_timeout 2
67
-
68
- def simulate_around_filter(&block)
69
- set_current_controller(&block)
70
- end
71
-
72
- def controller_name
73
- "MethodsControllerStub"
74
- end
75
- end
76
63
  end
77
64
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ExceptionHandling
4
- VERSION = '2.17.0.pre.tstarck.1'
4
+ VERSION = '3.0.0.pre.2'
5
5
  end