airbrake-ruby 4.13.3-java → 5.0.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/lib/airbrake-ruby.rb +23 -32
  3. data/lib/airbrake-ruby/async_sender.rb +1 -1
  4. data/lib/airbrake-ruby/backtrace.rb +6 -5
  5. data/lib/airbrake-ruby/config.rb +37 -13
  6. data/lib/airbrake-ruby/config/processor.rb +84 -0
  7. data/lib/airbrake-ruby/config/validator.rb +6 -0
  8. data/lib/airbrake-ruby/file_cache.rb +1 -1
  9. data/lib/airbrake-ruby/filter_chain.rb +16 -1
  10. data/lib/airbrake-ruby/filters/dependency_filter.rb +1 -0
  11. data/lib/airbrake-ruby/filters/gem_root_filter.rb +1 -0
  12. data/lib/airbrake-ruby/filters/git_last_checkout_filter.rb +3 -3
  13. data/lib/airbrake-ruby/filters/git_repository_filter.rb +3 -0
  14. data/lib/airbrake-ruby/filters/git_revision_filter.rb +2 -0
  15. data/lib/airbrake-ruby/filters/{keys_whitelist.rb → keys_allowlist.rb} +3 -3
  16. data/lib/airbrake-ruby/filters/{keys_blacklist.rb → keys_blocklist.rb} +3 -3
  17. data/lib/airbrake-ruby/filters/keys_filter.rb +26 -18
  18. data/lib/airbrake-ruby/filters/root_directory_filter.rb +1 -0
  19. data/lib/airbrake-ruby/filters/sql_filter.rb +4 -4
  20. data/lib/airbrake-ruby/filters/system_exit_filter.rb +1 -0
  21. data/lib/airbrake-ruby/filters/thread_filter.rb +2 -0
  22. data/lib/airbrake-ruby/ignorable.rb +1 -0
  23. data/lib/airbrake-ruby/notice.rb +1 -8
  24. data/lib/airbrake-ruby/notice_notifier.rb +7 -0
  25. data/lib/airbrake-ruby/performance_breakdown.rb +1 -6
  26. data/lib/airbrake-ruby/performance_notifier.rb +2 -15
  27. data/lib/airbrake-ruby/promise.rb +1 -0
  28. data/lib/airbrake-ruby/query.rb +1 -6
  29. data/lib/airbrake-ruby/queue.rb +1 -8
  30. data/lib/airbrake-ruby/remote_settings.rb +145 -0
  31. data/lib/airbrake-ruby/remote_settings/settings_data.rb +120 -0
  32. data/lib/airbrake-ruby/request.rb +1 -8
  33. data/lib/airbrake-ruby/stat.rb +1 -12
  34. data/lib/airbrake-ruby/sync_sender.rb +3 -2
  35. data/lib/airbrake-ruby/tdigest.rb +2 -0
  36. data/lib/airbrake-ruby/thread_pool.rb +2 -0
  37. data/lib/airbrake-ruby/truncator.rb +8 -2
  38. data/lib/airbrake-ruby/version.rb +11 -1
  39. data/spec/airbrake_spec.rb +71 -36
  40. data/spec/backtrace_spec.rb +26 -26
  41. data/spec/code_hunk_spec.rb +2 -2
  42. data/spec/config/processor_spec.rb +209 -0
  43. data/spec/config/validator_spec.rb +18 -1
  44. data/spec/config_spec.rb +13 -6
  45. data/spec/filter_chain_spec.rb +27 -0
  46. data/spec/filters/gem_root_filter_spec.rb +4 -4
  47. data/spec/filters/git_last_checkout_filter_spec.rb +20 -3
  48. data/spec/filters/{keys_whitelist_spec.rb → keys_allowlist_spec.rb} +11 -10
  49. data/spec/filters/{keys_blacklist_spec.rb → keys_blocklist_spec.rb} +20 -10
  50. data/spec/filters/root_directory_filter_spec.rb +4 -4
  51. data/spec/filters/sql_filter_spec.rb +5 -5
  52. data/spec/notice_notifier/options_spec.rb +6 -6
  53. data/spec/notice_notifier_spec.rb +2 -2
  54. data/spec/notice_spec.rb +1 -1
  55. data/spec/performance_breakdown_spec.rb +0 -12
  56. data/spec/performance_notifier_spec.rb +2 -27
  57. data/spec/query_spec.rb +1 -11
  58. data/spec/queue_spec.rb +1 -13
  59. data/spec/remote_settings/settings_data_spec.rb +365 -0
  60. data/spec/remote_settings_spec.rb +230 -0
  61. data/spec/request_spec.rb +1 -13
  62. data/spec/spec_helper.rb +4 -4
  63. data/spec/stat_spec.rb +0 -9
  64. data/spec/sync_sender_spec.rb +3 -1
  65. data/spec/thread_pool_spec.rb +25 -5
  66. metadata +22 -14
@@ -1,21 +1,9 @@
1
1
  RSpec.describe Airbrake::Request do
2
2
  describe "#stash" do
3
3
  subject do
4
- described_class.new(
5
- method: 'GET', route: '/', status_code: 200, start_time: Time.now,
6
- )
4
+ described_class.new(method: 'GET', route: '/', status_code: 200)
7
5
  end
8
6
 
9
7
  it { is_expected.to respond_to(:stash) }
10
8
  end
11
-
12
- describe "#end_time" do
13
- it "is always equal to start_time + 1 second by default" do
14
- time = Time.now
15
- request = described_class.new(
16
- method: 'GET', route: '/', status_code: 200, start_time: time,
17
- )
18
- expect(request.end_time).to eq(time + 1)
19
- end
20
- end
21
9
  end
@@ -33,7 +33,7 @@ class AirbrakeTestError < RuntimeError
33
33
 
34
34
  def initialize(*)
35
35
  super
36
- # rubocop:disable Metrics/LineLength
36
+ # rubocop:disable Layout/LineLength
37
37
  @backtrace = [
38
38
  "/home/kyrylo/code/airbrake/ruby/spec/spec_helper.rb:23:in `<top (required)>'",
39
39
  "/opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'",
@@ -49,7 +49,7 @@ class AirbrakeTestError < RuntimeError
49
49
  "/home/kyrylo/.gem/ruby/2.2.2/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in `invoke'",
50
50
  "/home/kyrylo/.gem/ruby/2.2.2/gems/rspec-core-3.3.2/exe/rspec:4:in `<main>'",
51
51
  ]
52
- # rubocop:enable Metrics/LineLength
52
+ # rubocop:enable Layout/LineLength
53
53
  end
54
54
 
55
55
  # rubocop:disable Naming/AccessorMethodName
@@ -66,7 +66,7 @@ end
66
66
  class JavaAirbrakeTestError < AirbrakeTestError
67
67
  def initialize(*)
68
68
  super
69
- # rubocop:disable Metrics/LineLength
69
+ # rubocop:disable Layout/LineLength
70
70
  @backtrace = [
71
71
  "org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:26)",
72
72
  "org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:126)",
@@ -80,7 +80,7 @@ class JavaAirbrakeTestError < AirbrakeTestError
80
80
  "org.jruby.Main.run(Main.java:225)",
81
81
  "org.jruby.Main.main(Main.java:197)",
82
82
  ]
83
- # rubocop:enable Metrics/LineLength
83
+ # rubocop:enable Layout/LineLength
84
84
  end
85
85
 
86
86
  def is_a?(*)
@@ -10,15 +10,6 @@ RSpec.describe Airbrake::Stat do
10
10
  end
11
11
  end
12
12
 
13
- describe "#increment" do
14
- let(:start_time) { Time.new(2018, 1, 1, 0, 0, 20, 0) }
15
- let(:end_time) { Time.new(2018, 1, 1, 0, 0, 22, 0) }
16
-
17
- before { subject.increment(start_time, end_time) }
18
-
19
- its(:sum) { is_expected.to eq(2000) }
20
- end
21
-
22
13
  describe "#increment_ms" do
23
14
  before { subject.increment_ms(1000) }
24
15
 
@@ -27,7 +27,9 @@ RSpec.describe Airbrake::SyncSender do
27
27
  expect(
28
28
  a_request(:post, endpoint).with(
29
29
  headers: {
30
- 'User-Agent' => %r{airbrake-ruby/\d+\.\d+\.\d+ Ruby/\d+\.\d+\.\d+},
30
+ 'User-Agent' => %r{
31
+ airbrake-ruby/\d+\.\d+\.\d+(\.rc\.\d+)?\sRuby/\d+\.\d+\.\d+
32
+ }x,
31
33
  },
32
34
  ),
33
35
  ).to have_been_made.once
@@ -85,11 +85,31 @@ RSpec.describe Airbrake::ThreadPool do
85
85
  expect(subject).not_to have_workers
86
86
  end
87
87
 
88
- it "respawns workers on fork()", skip: %w[jruby].include?(RUBY_ENGINE) do
89
- pid = fork { expect(subject).to have_workers }
90
- Process.wait(pid)
91
- subject.close
92
- expect(subject).not_to have_workers
88
+ describe "forking behavior" do
89
+ before do
90
+ skip('fork() is unsupported on JRuby') if %w[jruby].include?(RUBY_ENGINE)
91
+ unless Process.respond_to?(:last_status)
92
+ skip('Process.last_status is unsupported on this Ruby')
93
+ end
94
+ end
95
+
96
+ it "respawns workers on fork()" do
97
+ pid = fork { expect(subject).to have_workers }
98
+ Process.wait(pid)
99
+ subject.close
100
+
101
+ expect(Process.last_status).to be_success
102
+ expect(subject).not_to have_workers
103
+ end
104
+
105
+ it "ensures that a new thread group is created per process" do
106
+ subject << 1
107
+ pid = fork { subject.has_workers? }
108
+ Process.wait(pid)
109
+ subject.close
110
+
111
+ expect(Process.last_status).to be_success
112
+ end
93
113
  end
94
114
  end
95
115
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.13.3
4
+ version: 5.0.0
5
5
  platform: java
6
6
  authors:
7
7
  - Airbrake Technologies, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-02 00:00:00.000000000 Z
11
+ date: 2020-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbtree-jruby
@@ -44,6 +44,7 @@ files:
44
44
  - lib/airbrake-ruby/benchmark.rb
45
45
  - lib/airbrake-ruby/code_hunk.rb
46
46
  - lib/airbrake-ruby/config.rb
47
+ - lib/airbrake-ruby/config/processor.rb
47
48
  - lib/airbrake-ruby/config/validator.rb
48
49
  - lib/airbrake-ruby/deploy_notifier.rb
49
50
  - lib/airbrake-ruby/file_cache.rb
@@ -55,9 +56,9 @@ files:
55
56
  - lib/airbrake-ruby/filters/git_last_checkout_filter.rb
56
57
  - lib/airbrake-ruby/filters/git_repository_filter.rb
57
58
  - lib/airbrake-ruby/filters/git_revision_filter.rb
58
- - lib/airbrake-ruby/filters/keys_blacklist.rb
59
+ - lib/airbrake-ruby/filters/keys_allowlist.rb
60
+ - lib/airbrake-ruby/filters/keys_blocklist.rb
59
61
  - lib/airbrake-ruby/filters/keys_filter.rb
60
- - lib/airbrake-ruby/filters/keys_whitelist.rb
61
62
  - lib/airbrake-ruby/filters/root_directory_filter.rb
62
63
  - lib/airbrake-ruby/filters/sql_filter.rb
63
64
  - lib/airbrake-ruby/filters/system_exit_filter.rb
@@ -77,6 +78,8 @@ files:
77
78
  - lib/airbrake-ruby/promise.rb
78
79
  - lib/airbrake-ruby/query.rb
79
80
  - lib/airbrake-ruby/queue.rb
81
+ - lib/airbrake-ruby/remote_settings.rb
82
+ - lib/airbrake-ruby/remote_settings/settings_data.rb
80
83
  - lib/airbrake-ruby/request.rb
81
84
  - lib/airbrake-ruby/response.rb
82
85
  - lib/airbrake-ruby/stashable.rb
@@ -93,6 +96,7 @@ files:
93
96
  - spec/backtrace_spec.rb
94
97
  - spec/benchmark_spec.rb
95
98
  - spec/code_hunk_spec.rb
99
+ - spec/config/processor_spec.rb
96
100
  - spec/config/validator_spec.rb
97
101
  - spec/config_spec.rb
98
102
  - spec/deploy_notifier_spec.rb
@@ -105,8 +109,8 @@ files:
105
109
  - spec/filters/git_last_checkout_filter_spec.rb
106
110
  - spec/filters/git_repository_filter.rb
107
111
  - spec/filters/git_revision_filter_spec.rb
108
- - spec/filters/keys_blacklist_spec.rb
109
- - spec/filters/keys_whitelist_spec.rb
112
+ - spec/filters/keys_allowlist_spec.rb
113
+ - spec/filters/keys_blocklist_spec.rb
110
114
  - spec/filters/root_directory_filter_spec.rb
111
115
  - spec/filters/sql_filter_spec.rb
112
116
  - spec/filters/system_exit_filter_spec.rb
@@ -131,6 +135,8 @@ files:
131
135
  - spec/promise_spec.rb
132
136
  - spec/query_spec.rb
133
137
  - spec/queue_spec.rb
138
+ - spec/remote_settings/settings_data_spec.rb
139
+ - spec/remote_settings_spec.rb
134
140
  - spec/request_spec.rb
135
141
  - spec/response_spec.rb
136
142
  - spec/spec_helper.rb
@@ -146,7 +152,7 @@ homepage: https://airbrake.io
146
152
  licenses:
147
153
  - MIT
148
154
  metadata: {}
149
- post_install_message:
155
+ post_install_message:
150
156
  rdoc_options: []
151
157
  require_paths:
152
158
  - lib
@@ -154,16 +160,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
160
  requirements:
155
161
  - - ">="
156
162
  - !ruby/object:Gem::Version
157
- version: '2.1'
163
+ version: '2.3'
158
164
  required_rubygems_version: !ruby/object:Gem::Requirement
159
165
  requirements:
160
166
  - - ">="
161
167
  - !ruby/object:Gem::Version
162
168
  version: '0'
163
169
  requirements: []
164
- rubyforge_project:
165
- rubygems_version: 2.7.6.2
166
- signing_key:
170
+ rubygems_version: 3.1.2
171
+ signing_key:
167
172
  specification_version: 4
168
173
  summary: Ruby notifier for https://airbrake.io
169
174
  test_files:
@@ -173,14 +178,14 @@ test_files:
173
178
  - spec/filters/exception_attributes_filter_spec.rb
174
179
  - spec/filters/root_directory_filter_spec.rb
175
180
  - spec/filters/sql_filter_spec.rb
176
- - spec/filters/keys_whitelist_spec.rb
177
181
  - spec/filters/system_exit_filter_spec.rb
178
182
  - spec/filters/thread_filter_spec.rb
183
+ - spec/filters/keys_allowlist_spec.rb
179
184
  - spec/filters/dependency_filter_spec.rb
180
185
  - spec/filters/context_filter_spec.rb
181
186
  - spec/filters/git_last_checkout_filter_spec.rb
182
187
  - spec/filters/git_revision_filter_spec.rb
183
- - spec/filters/keys_blacklist_spec.rb
188
+ - spec/filters/keys_blocklist_spec.rb
184
189
  - spec/filters/gem_root_filter_spec.rb
185
190
  - spec/filters/git_repository_filter.rb
186
191
  - spec/spec_helper.rb
@@ -197,6 +202,7 @@ test_files:
197
202
  - spec/promise_spec.rb
198
203
  - spec/thread_pool_spec.rb
199
204
  - spec/config/validator_spec.rb
205
+ - spec/config/processor_spec.rb
200
206
  - spec/sync_sender_spec.rb
201
207
  - spec/ignorable_spec.rb
202
208
  - spec/deploy_notifier_spec.rb
@@ -208,6 +214,7 @@ test_files:
208
214
  - spec/request_spec.rb
209
215
  - spec/notice_notifier/options_spec.rb
210
216
  - spec/filter_chain_spec.rb
217
+ - spec/remote_settings/settings_data_spec.rb
211
218
  - spec/response_spec.rb
212
219
  - spec/queue_spec.rb
213
220
  - spec/code_hunk_spec.rb
@@ -221,3 +228,4 @@ test_files:
221
228
  - spec/inspectable_spec.rb
222
229
  - spec/stashable_spec.rb
223
230
  - spec/query_spec.rb
231
+ - spec/remote_settings_spec.rb