airbrake-ruby 4.8.0 → 4.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/airbrake-ruby.rb +101 -25
- data/lib/airbrake-ruby/async_sender.rb +3 -3
- data/lib/airbrake-ruby/backtrace.rb +2 -2
- data/lib/airbrake-ruby/benchmark.rb +1 -1
- data/lib/airbrake-ruby/code_hunk.rb +1 -1
- data/lib/airbrake-ruby/config.rb +1 -1
- data/lib/airbrake-ruby/config/validator.rb +3 -3
- data/lib/airbrake-ruby/deploy_notifier.rb +1 -1
- data/lib/airbrake-ruby/filters/exception_attributes_filter.rb +2 -2
- data/lib/airbrake-ruby/filters/git_last_checkout_filter.rb +2 -2
- data/lib/airbrake-ruby/filters/keys_filter.rb +1 -1
- data/lib/airbrake-ruby/filters/sql_filter.rb +3 -3
- data/lib/airbrake-ruby/filters/thread_filter.rb +1 -1
- data/lib/airbrake-ruby/grouppable.rb +12 -0
- data/lib/airbrake-ruby/inspectable.rb +2 -2
- data/lib/airbrake-ruby/mergeable.rb +12 -0
- data/lib/airbrake-ruby/notice.rb +7 -7
- data/lib/airbrake-ruby/notice_notifier.rb +3 -2
- data/lib/airbrake-ruby/performance_breakdown.rb +12 -6
- data/lib/airbrake-ruby/performance_notifier.rb +69 -22
- data/lib/airbrake-ruby/query.rb +15 -11
- data/lib/airbrake-ruby/queue.rb +56 -0
- data/lib/airbrake-ruby/request.rb +14 -12
- data/lib/airbrake-ruby/stat.rb +1 -1
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/airbrake_spec.rb +135 -45
- data/spec/async_sender_spec.rb +4 -4
- data/spec/backtrace_spec.rb +18 -18
- data/spec/code_hunk_spec.rb +9 -9
- data/spec/config/validator_spec.rb +5 -5
- data/spec/config_spec.rb +5 -9
- data/spec/deploy_notifier_spec.rb +2 -2
- data/spec/filter_chain_spec.rb +1 -1
- data/spec/filters/dependency_filter_spec.rb +1 -1
- data/spec/filters/gem_root_filter_spec.rb +5 -5
- data/spec/filters/git_last_checkout_filter_spec.rb +1 -1
- data/spec/filters/git_repository_filter.rb +1 -1
- data/spec/filters/git_revision_filter_spec.rb +10 -10
- data/spec/filters/keys_blacklist_spec.rb +22 -22
- data/spec/filters/keys_whitelist_spec.rb +21 -21
- data/spec/filters/root_directory_filter_spec.rb +5 -5
- data/spec/filters/sql_filter_spec.rb +53 -55
- data/spec/filters/system_exit_filter_spec.rb +1 -1
- data/spec/filters/thread_filter_spec.rb +28 -28
- data/spec/fixtures/project_root/code.rb +9 -9
- data/spec/notice_notifier/options_spec.rb +12 -12
- data/spec/notice_notifier_spec.rb +18 -18
- data/spec/notice_spec.rb +5 -5
- data/spec/performance_breakdown_spec.rb +11 -0
- data/spec/performance_notifier_spec.rb +243 -72
- data/spec/query_spec.rb +11 -1
- data/spec/queue_spec.rb +21 -0
- data/spec/request_spec.rb +11 -1
- data/spec/response_spec.rb +8 -8
- data/spec/spec_helper.rb +2 -2
- data/spec/stat_spec.rb +2 -2
- data/spec/sync_sender_spec.rb +12 -12
- data/spec/tdigest_spec.rb +6 -6
- data/spec/thread_pool_spec.rb +5 -5
- data/spec/timed_trace_spec.rb +1 -1
- data/spec/truncator_spec.rb +12 -12
- metadata +7 -2
@@ -10,7 +10,7 @@ RSpec.describe Airbrake::Filters::RootDirectoryFilter do
|
|
10
10
|
{ file: "/home/kyrylo/code/airbrake/ruby/spec/spec_helper.rb" },
|
11
11
|
{ file: "#{root_directory}/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb " },
|
12
12
|
{ file: "/opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb" },
|
13
|
-
{ file: "#{root_directory}/gems/rspec-core-3.3.2/exe/rspec" }
|
13
|
+
{ file: "#{root_directory}/gems/rspec-core-3.3.2/exe/rspec" },
|
14
14
|
]
|
15
15
|
# rubocop:enable Metrics/LineLength
|
16
16
|
|
@@ -23,9 +23,9 @@ RSpec.describe Airbrake::Filters::RootDirectoryFilter do
|
|
23
23
|
{ file: "/home/kyrylo/code/airbrake/ruby/spec/spec_helper.rb" },
|
24
24
|
{ file: "/PROJECT_ROOT/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb " },
|
25
25
|
{ file: "/opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb" },
|
26
|
-
{ file: "/PROJECT_ROOT/gems/rspec-core-3.3.2/exe/rspec" }
|
27
|
-
]
|
28
|
-
)
|
26
|
+
{ file: "/PROJECT_ROOT/gems/rspec-core-3.3.2/exe/rspec" },
|
27
|
+
],
|
28
|
+
),
|
29
29
|
)
|
30
30
|
# rubocop:enable Metrics/LineLength
|
31
31
|
end
|
@@ -33,7 +33,7 @@ RSpec.describe Airbrake::Filters::RootDirectoryFilter do
|
|
33
33
|
it "does not filter file when it is nil" do
|
34
34
|
expect(notice[:errors].first[:file]).to be_nil
|
35
35
|
expect { subject.call(notice) }.not_to(
|
36
|
-
change { notice[:errors].first[:file] }
|
36
|
+
change { notice[:errors].first[:file] },
|
37
37
|
)
|
38
38
|
end
|
39
39
|
end
|
@@ -13,9 +13,7 @@ RSpec.describe Airbrake::Filters::SqlFilter do
|
|
13
13
|
shared_examples "query blacklisting" do |query, opts|
|
14
14
|
it "ignores '#{query}'" do
|
15
15
|
filter = described_class.new('postgres')
|
16
|
-
q = Airbrake::Query.new(
|
17
|
-
query: query, method: 'GET', route: '/', start_time: Time.now
|
18
|
-
)
|
16
|
+
q = Airbrake::Query.new(query: query, method: 'GET', route: '/', timing: 1)
|
19
17
|
filter.call(q)
|
20
18
|
|
21
19
|
expect(q.ignored?).to eq(opts[:should_ignore])
|
@@ -29,204 +27,204 @@ RSpec.describe Airbrake::Filters::SqlFilter do
|
|
29
27
|
{
|
30
28
|
input: 'SELECT * FROM things;',
|
31
29
|
output: 'SELECT * FROM things;',
|
32
|
-
dialects: ALL_DIALECTS
|
30
|
+
dialects: ALL_DIALECTS,
|
33
31
|
}, {
|
34
32
|
input: "SELECT `t001`.`c2` FROM `t001` WHERE `t001`.`c2` = 'value' AND c3=\"othervalue\" LIMIT ?",
|
35
33
|
output: "SELECT `t001`.`c2` FROM `t001` WHERE `t001`.`c2` = ? AND c3=? LIMIT ?",
|
36
|
-
dialects: %i[mysql]
|
34
|
+
dialects: %i[mysql],
|
37
35
|
}, {
|
38
36
|
input: "SELECT * FROM t WHERE foo=\"bar/*\" AND baz=\"whatever */qux\"",
|
39
37
|
output: "SELECT * FROM t WHERE foo=? AND baz=?",
|
40
|
-
dialects: %i[mysql]
|
38
|
+
dialects: %i[mysql],
|
41
39
|
}, {
|
42
40
|
input: "SELECT * FROM t WHERE foo='bar/*' AND baz='whatever */qux'",
|
43
41
|
output: "SELECT * FROM t WHERE foo=? AND baz=?",
|
44
|
-
dialects: ALL_DIALECTS
|
42
|
+
dialects: ALL_DIALECTS,
|
45
43
|
}, {
|
46
44
|
input: "SELECT \"t001\".\"c2\" FROM \"t001\" WHERE \"t001\".\"c2\" = 'value' AND c3=1234 LIMIT 1",
|
47
45
|
output: "SELECT \"t001\".\"c2\" FROM \"t001\" WHERE \"t001\".\"c2\" = ? AND c3=? LIMIT ?",
|
48
|
-
dialects: %i[postgres oracle]
|
46
|
+
dialects: %i[postgres oracle],
|
49
47
|
}, {
|
50
48
|
input: "SELECT * FROM t WHERE foo=\"bar--\" AND\n baz=\"qux--\"",
|
51
49
|
output: "SELECT * FROM t WHERE foo=? AND\n baz=?",
|
52
|
-
dialects: %i[mysql]
|
50
|
+
dialects: %i[mysql],
|
53
51
|
}, {
|
54
52
|
input: "SELECT * FROM t WHERE foo='bar--' AND\n baz='qux--'",
|
55
53
|
output: "SELECT * FROM t WHERE foo=? AND\n baz=?",
|
56
|
-
dialects: ALL_DIALECTS
|
54
|
+
dialects: ALL_DIALECTS,
|
57
55
|
}, {
|
58
56
|
input: "SELECT * FROM foo WHERE bar='baz' /* Hide Me */",
|
59
57
|
output: "SELECT * FROM foo WHERE bar=? ?",
|
60
|
-
dialects: ALL_DIALECTS
|
58
|
+
dialects: ALL_DIALECTS,
|
61
59
|
}, {
|
62
60
|
input: "SELECT * FROM foobar WHERE password='hunter2'\n-- No peeking!",
|
63
61
|
output: "SELECT * FROM foobar WHERE password=?\n?",
|
64
|
-
dialects: ALL_DIALECTS
|
62
|
+
dialects: ALL_DIALECTS,
|
65
63
|
}, {
|
66
64
|
input: "SELECT foo, bar FROM baz WHERE password='hunter2' # Secret",
|
67
65
|
output: "SELECT foo, bar FROM baz WHERE password=? ?",
|
68
|
-
dialects: ALL_DIALECTS
|
66
|
+
dialects: ALL_DIALECTS,
|
69
67
|
}, {
|
70
68
|
input: "SELECT \"col1\", \"col2\" from \"table\" WHERE \"col3\"=E'foo\\'bar\\\\baz' AND country=e'foo\\'bar\\\\baz'",
|
71
69
|
output: "SELECT \"col1\", \"col2\" from \"table\" WHERE \"col3\"=E?",
|
72
|
-
dialects: %i[postgres]
|
70
|
+
dialects: %i[postgres],
|
73
71
|
}, {
|
74
72
|
input: "INSERT INTO `X` values(\"test\",0, 1 , 2, 'test')",
|
75
73
|
output: "INSERT INTO `X` values(?)",
|
76
|
-
dialects: %i[mysql]
|
74
|
+
dialects: %i[mysql],
|
77
75
|
}, {
|
78
76
|
input: "INSERT INTO `X` values(\"test\",0, 1 , 2, 'test')",
|
79
77
|
output: "INSERT INTO `X` values(?)",
|
80
|
-
dialects: %i[mysql]
|
78
|
+
dialects: %i[mysql],
|
81
79
|
}, {
|
82
80
|
input: "SELECT c11.col1, c22.col2 FROM table c11, table c22 WHERE value='nothing'",
|
83
81
|
output: "SELECT c11.col1, c22.col2 FROM table c11, table c22 WHERE value=?",
|
84
|
-
dialects: ALL_DIALECTS
|
82
|
+
dialects: ALL_DIALECTS,
|
85
83
|
}, {
|
86
84
|
input: "INSERT INTO X VALUES(1, 23456, 123.456, 99+100)",
|
87
85
|
output: "INSERT INTO X VALUES(?)",
|
88
|
-
dialects: ALL_DIALECTS
|
86
|
+
dialects: ALL_DIALECTS,
|
89
87
|
}, {
|
90
88
|
input: "SELECT * FROM table WHERE name=\"foo\" AND value=\"don't\"",
|
91
89
|
output: "SELECT * FROM table WHERE name=? AND value=?",
|
92
|
-
dialects: %i[mysql]
|
90
|
+
dialects: %i[mysql],
|
93
91
|
}, {
|
94
92
|
input: "SELECT * FROM table WHERE name='foo' AND value = 'bar'",
|
95
93
|
output: "SELECT * FROM table WHERE name=? AND value = ?",
|
96
|
-
dialects: ALL_DIALECTS
|
94
|
+
dialects: ALL_DIALECTS,
|
97
95
|
}, {
|
98
96
|
input: "SELECT * FROM table WHERE col='foo\\''bar'",
|
99
97
|
output: "SELECT * FROM table WHERE col=?",
|
100
|
-
dialects: ALL_DIALECTS
|
98
|
+
dialects: ALL_DIALECTS,
|
101
99
|
}, {
|
102
100
|
input: "SELECT * FROM table WHERE col1='foo\"bar' AND col2='what\"ever'",
|
103
101
|
output: "SELECT * FROM table WHERE col1=? AND col2=?",
|
104
|
-
dialects: ALL_DIALECTS
|
102
|
+
dialects: ALL_DIALECTS,
|
105
103
|
}, {
|
106
104
|
input: "select * from accounts where accounts.name != 'dude\n newline' order by accounts.name",
|
107
105
|
output: "select * from accounts where accounts.name != ? order by accounts.name",
|
108
|
-
dialects: ALL_DIALECTS
|
106
|
+
dialects: ALL_DIALECTS,
|
109
107
|
}, {
|
110
108
|
input: "SELECT * FROM table WHERE col1=\"don't\" AND col2=\"won't\"",
|
111
109
|
output: "SELECT * FROM table WHERE col1=? AND col2=?",
|
112
|
-
dialects: %i[mysql]
|
110
|
+
dialects: %i[mysql],
|
113
111
|
}, {
|
114
112
|
input: "INSERT INTO X values('', 'jim''s ssn',0, 1 , 'jim''s son''s son', \"\"\"jim''s\"\" hat\", \"\\\"jim''s secret\\\"\")",
|
115
113
|
output: "INSERT INTO X values(?, ?,?, ? , ?, ?, ?",
|
116
|
-
dialects: %i[mysql]
|
114
|
+
dialects: %i[mysql],
|
117
115
|
}, {
|
118
116
|
input: "SELECT * FROM table WHERE name='foo\\' AND color='blue'",
|
119
117
|
output: "SELECT * FROM table WHERE name=?",
|
120
|
-
dialects: ALL_DIALECTS
|
118
|
+
dialects: ALL_DIALECTS,
|
121
119
|
}, {
|
122
120
|
input: "SELECT * FROM table WHERE foo=\"this string ends with a backslash\\\\\"",
|
123
121
|
output: "SELECT * FROM table WHERE foo=?",
|
124
|
-
dialects: %i[mysql]
|
122
|
+
dialects: %i[mysql],
|
125
123
|
}, {
|
126
124
|
input: "SELECT * FROM table WHERE foo='this string ends with a backslash\\\\'",
|
127
125
|
output: "SELECT * FROM table WHERE foo=?",
|
128
|
-
dialects: ALL_DIALECTS
|
126
|
+
dialects: ALL_DIALECTS,
|
129
127
|
}, {
|
130
128
|
# TODO: fix this example.
|
131
129
|
input: "SELECT * FROM table WHERE name='foo\'' AND color='blue'",
|
132
130
|
output: "Error: Airbrake::Query was not filtered",
|
133
|
-
dialects: ALL_DIALECTS
|
131
|
+
dialects: ALL_DIALECTS,
|
134
132
|
}, {
|
135
133
|
input: "INSERT INTO X values('', 'a''b c',0, 1 , 'd''e f''s h')",
|
136
134
|
output: "INSERT INTO X values(?)",
|
137
|
-
dialects: ALL_DIALECTS
|
135
|
+
dialects: ALL_DIALECTS,
|
138
136
|
}, {
|
139
137
|
input: "SELECT * FROM t WHERE -- '\n bar='baz' -- '",
|
140
138
|
output: "SELECT * FROM t WHERE ?\n bar=? ?",
|
141
|
-
dialects: ALL_DIALECTS
|
139
|
+
dialects: ALL_DIALECTS,
|
142
140
|
}, {
|
143
141
|
input: "SELECT * FROM t WHERE /* ' */\n bar='baz' -- '",
|
144
142
|
output: "SELECT * FROM t WHERE ?\n bar=? ?",
|
145
|
-
dialects: ALL_DIALECTS
|
143
|
+
dialects: ALL_DIALECTS,
|
146
144
|
}, {
|
147
145
|
input: "SELECT * FROM t WHERE -- '\n /* ' */ c2='xxx' /* ' */\n c='x\n xx' -- '",
|
148
146
|
output: "SELECT * FROM t WHERE ?\n ? c2=? ?\n c=? ?",
|
149
|
-
dialects: ALL_DIALECTS
|
147
|
+
dialects: ALL_DIALECTS,
|
150
148
|
}, {
|
151
149
|
input: "SELECT * FROM t WHERE -- '\n c='x\n xx' -- '",
|
152
150
|
output: "SELECT * FROM t WHERE ?\n c=? ?",
|
153
|
-
dialects: ALL_DIALECTS
|
151
|
+
dialects: ALL_DIALECTS,
|
154
152
|
}, {
|
155
153
|
input: "SELECT * FROM foo WHERE col='value1' AND /* don't */ col2='value1' /* won't */",
|
156
154
|
output: "SELECT * FROM foo WHERE col=? AND ? col2=? ?",
|
157
|
-
dialects: ALL_DIALECTS
|
155
|
+
dialects: ALL_DIALECTS,
|
158
156
|
}, {
|
159
157
|
input: "SELECT * FROM table WHERE foo='bar' AND baz=\"nothing to see here'",
|
160
158
|
output: "Error: Airbrake::Query was not filtered",
|
161
|
-
dialects: %i[mysql]
|
159
|
+
dialects: %i[mysql],
|
162
160
|
}, {
|
163
161
|
input: "SELECT * FROM table WHERE foo='bar' AND baz='nothing to see here",
|
164
162
|
output: "Error: Airbrake::Query was not filtered",
|
165
|
-
dialects: ALL_DIALECTS
|
163
|
+
dialects: ALL_DIALECTS,
|
166
164
|
}, {
|
167
165
|
input: "SELECT * FROM \"foo\" WHERE \"foo\" = $a$dollar quotes can be $b$nested$b$$a$ and bar = 'baz'",
|
168
166
|
output: "SELECT * FROM \"foo\" WHERE \"foo\" = ? and bar = ?",
|
169
|
-
dialects: %i[postgres]
|
167
|
+
dialects: %i[postgres],
|
170
168
|
}, {
|
171
169
|
input: "INSERT INTO \"foo\" (\"bar\", \"baz\", \"qux\") VALUES ($1, $2, $3) RETURNING \"id\"",
|
172
170
|
output: "INSERT INTO \"foo\" (?) RETURNING \"id\"",
|
173
|
-
dialects: %i[postgres]
|
171
|
+
dialects: %i[postgres],
|
174
172
|
}, {
|
175
173
|
input: "select * from foo where bar = 'some\\tthing' and baz = 10",
|
176
174
|
output: "select * from foo where bar = ? and baz = ?",
|
177
|
-
dialects: ALL_DIALECTS
|
175
|
+
dialects: ALL_DIALECTS,
|
178
176
|
}, {
|
179
177
|
input: "select * from users where user = 'user1\\' password = 'hunter 2' -- ->don't count this quote",
|
180
178
|
output: "select * from users where user = ?",
|
181
|
-
dialects: ALL_DIALECTS
|
179
|
+
dialects: ALL_DIALECTS,
|
182
180
|
}, {
|
183
181
|
input: "select * from foo where bar=q'[baz's]' and x=5",
|
184
182
|
output: "select * from foo where bar=? and x=?",
|
185
|
-
dialects: %i[oracle]
|
183
|
+
dialects: %i[oracle],
|
186
184
|
}, {
|
187
185
|
input: "select * from foo where bar=q'{baz's}' and x=5",
|
188
186
|
output: "select * from foo where bar=? and x=?",
|
189
|
-
dialects: %i[oracle]
|
187
|
+
dialects: %i[oracle],
|
190
188
|
}, {
|
191
189
|
input: "select * from foo where bar=q'<baz's>' and x=5",
|
192
190
|
output: "select * from foo where bar=? and x=?",
|
193
|
-
dialects: %i[oracle]
|
191
|
+
dialects: %i[oracle],
|
194
192
|
}, {
|
195
193
|
input: "select * from foo where bar=q'(baz's)' and x=5",
|
196
194
|
output: "select * from foo where bar=? and x=?",
|
197
|
-
dialects: %i[oracle]
|
195
|
+
dialects: %i[oracle],
|
198
196
|
}, {
|
199
197
|
input: "select * from foo where bar=0xabcdef123 and x=5",
|
200
198
|
output: "select * from foo where bar=? and x=?",
|
201
|
-
dialects: %i[cassandra sqlite]
|
199
|
+
dialects: %i[cassandra sqlite],
|
202
200
|
}, {
|
203
201
|
input: "select * from foo where bar=0x2F and x=5",
|
204
202
|
output: "select * from foo where bar=? and x=?",
|
205
|
-
dialects: %i[mysql cassandra sqlite]
|
203
|
+
dialects: %i[mysql cassandra sqlite],
|
206
204
|
}, {
|
207
205
|
input: "select * from foo where bar=1.234e-5 and x=5",
|
208
206
|
output: "select * from foo where bar=? and x=?",
|
209
|
-
dialects: ALL_DIALECTS
|
207
|
+
dialects: ALL_DIALECTS,
|
210
208
|
}, {
|
211
209
|
input: "select * from foo where bar=01234567-89ab-cdef-0123-456789abcdef and x=5",
|
212
210
|
output: "select * from foo where bar=? and x=?",
|
213
|
-
dialects: %i[postgres cassandra]
|
211
|
+
dialects: %i[postgres cassandra],
|
214
212
|
}, {
|
215
213
|
input: "select * from foo where bar={01234567-89ab-cdef-0123-456789abcdef} and x=5",
|
216
214
|
output: "select * from foo where bar=? and x=?",
|
217
|
-
dialects: %i[postgres]
|
215
|
+
dialects: %i[postgres],
|
218
216
|
}, {
|
219
217
|
input: "select * from foo where bar=0123456789abcdef0123456789abcdef and x=5",
|
220
218
|
output: "select * from foo where bar=? and x=?",
|
221
|
-
dialects: %i[postgtes]
|
219
|
+
dialects: %i[postgtes],
|
222
220
|
}, {
|
223
221
|
input: "select * from foo where bar={012-345678-9abc-def012345678-9abcdef} and x=5",
|
224
222
|
output: "select * from foo where bar=? and x=?",
|
225
|
-
dialects: %i[postgres]
|
223
|
+
dialects: %i[postgres],
|
226
224
|
}, {
|
227
225
|
input: "select * from foo where bar=true and x=FALSE",
|
228
226
|
output: "select * from foo where bar=? and x=?",
|
229
|
-
dialects: %i[mysql postgres cassandra sqlite]
|
227
|
+
dialects: %i[mysql postgres cassandra sqlite],
|
230
228
|
}
|
231
229
|
].each do |test|
|
232
230
|
include_examples 'query filtering', test
|
@@ -263,13 +261,13 @@ RSpec.describe Airbrake::Filters::SqlFilter do
|
|
263
261
|
'oid = rngtypid WHERE t.typname IN (?) OR t.typtype IN (?) OR t.typinput ' \
|
264
262
|
'= ?::regprocedure OR t.typelem != ?',
|
265
263
|
|
266
|
-
'SELECT t.oid, t.typname FROM pg_type as t WHERE t.typname IN (?)'
|
264
|
+
'SELECT t.oid, t.typname FROM pg_type as t WHERE t.typname IN (?)',
|
267
265
|
].each do |query|
|
268
266
|
include_examples 'query blacklisting', query, should_ignore: true
|
269
267
|
end
|
270
268
|
|
271
269
|
[
|
272
|
-
'UPDATE "users" SET "last_sign_in_at" = ? WHERE "users"."id" = ?'
|
270
|
+
'UPDATE "users" SET "last_sign_in_at" = ? WHERE "users"."id" = ?',
|
273
271
|
].each do |query|
|
274
272
|
include_examples 'query blacklisting', query, should_ignore: false
|
275
273
|
end
|
@@ -2,7 +2,7 @@ RSpec.describe Airbrake::Filters::SystemExitFilter do
|
|
2
2
|
it "marks SystemExit exceptions as ignored" do
|
3
3
|
notice = Airbrake::Notice.new(SystemExit.new)
|
4
4
|
expect { subject.call(notice) }.to(
|
5
|
-
change { notice.ignored? }.from(false).to(true)
|
5
|
+
change { notice.ignored? }.from(false).to(true),
|
6
6
|
)
|
7
7
|
end
|
8
8
|
|
@@ -77,13 +77,13 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
77
77
|
{
|
78
78
|
bish: {
|
79
79
|
bash: 'foo',
|
80
|
-
bosh: Object.new
|
81
|
-
}
|
82
|
-
}
|
83
|
-
]
|
84
|
-
}
|
80
|
+
bosh: Object.new,
|
81
|
+
},
|
82
|
+
},
|
83
|
+
],
|
84
|
+
},
|
85
85
|
},
|
86
|
-
123
|
86
|
+
123,
|
87
87
|
]
|
88
88
|
end
|
89
89
|
|
@@ -103,15 +103,15 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
103
103
|
{
|
104
104
|
bish: {
|
105
105
|
bash: 'foo',
|
106
|
-
bosh: /\A#<Object:.+>\z
|
107
|
-
}
|
108
|
-
}
|
109
|
-
]
|
110
|
-
}
|
106
|
+
bosh: /\A#<Object:.+>\z/,
|
107
|
+
},
|
108
|
+
},
|
109
|
+
],
|
110
|
+
},
|
111
111
|
},
|
112
|
-
123
|
113
|
-
]
|
114
|
-
)
|
112
|
+
123,
|
113
|
+
],
|
114
|
+
),
|
115
115
|
)
|
116
116
|
end
|
117
117
|
end
|
@@ -194,13 +194,13 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
194
194
|
{
|
195
195
|
bish: {
|
196
196
|
bash: 'foo',
|
197
|
-
bosh: Object.new
|
198
|
-
}
|
199
|
-
}
|
200
|
-
]
|
201
|
-
}
|
197
|
+
bosh: Object.new,
|
198
|
+
},
|
199
|
+
},
|
200
|
+
],
|
201
|
+
},
|
202
202
|
},
|
203
|
-
123
|
203
|
+
123,
|
204
204
|
]
|
205
205
|
end
|
206
206
|
|
@@ -220,15 +220,15 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
220
220
|
{
|
221
221
|
bish: {
|
222
222
|
bash: 'foo',
|
223
|
-
bosh: /\A#<Object:.+>\z
|
224
|
-
}
|
225
|
-
}
|
226
|
-
]
|
227
|
-
}
|
223
|
+
bosh: /\A#<Object:.+>\z/,
|
224
|
+
},
|
225
|
+
},
|
226
|
+
],
|
227
|
+
},
|
228
228
|
},
|
229
|
-
123
|
230
|
-
]
|
231
|
-
)
|
229
|
+
123,
|
230
|
+
],
|
231
|
+
),
|
232
232
|
)
|
233
233
|
end
|
234
234
|
end
|
@@ -10,7 +10,7 @@ module Airbrake
|
|
10
10
|
NOTIFIER = {
|
11
11
|
name: 'airbrake-ruby'.freeze,
|
12
12
|
version: Airbrake::AIRBRAKE_RUBY_VERSION,
|
13
|
-
url: 'https://github.com/airbrake/airbrake-ruby'.freeze
|
13
|
+
url: 'https://github.com/airbrake/airbrake-ruby'.freeze,
|
14
14
|
}.freeze
|
15
15
|
|
16
16
|
##
|
@@ -19,7 +19,7 @@ module Airbrake
|
|
19
19
|
CONTEXT = {
|
20
20
|
os: RUBY_PLATFORM,
|
21
21
|
language: "#{RUBY_ENGINE}/#{RUBY_VERSION}".freeze,
|
22
|
-
notifier: NOTIFIER
|
22
|
+
notifier: NOTIFIER,
|
23
23
|
}.freeze
|
24
24
|
|
25
25
|
##
|
@@ -38,7 +38,7 @@ module Airbrake
|
|
38
38
|
IOError,
|
39
39
|
NotImplementedError,
|
40
40
|
JSON::GeneratorError,
|
41
|
-
Encoding::UndefinedConversionError
|
41
|
+
Encoding::UndefinedConversionError,
|
42
42
|
].freeze
|
43
43
|
|
44
44
|
# @return [Array<Symbol>] the list of keys that can be be overwritten with
|
@@ -71,10 +71,10 @@ module Airbrake
|
|
71
71
|
errors: NestedException.new(config, exception).as_json,
|
72
72
|
context: context,
|
73
73
|
environment: {
|
74
|
-
program_name: $PROGRAM_NAME
|
74
|
+
program_name: $PROGRAM_NAME,
|
75
75
|
},
|
76
76
|
session: {},
|
77
|
-
params: params
|
77
|
+
params: params,
|
78
78
|
}
|
79
79
|
@stash = { exception: exception }
|
80
80
|
@truncator = Airbrake::Truncator.new(PAYLOAD_MAX_SIZE)
|
@@ -170,7 +170,7 @@ module Airbrake
|
|
170
170
|
# Make sure we always send hostname.
|
171
171
|
hostname: HOSTNAME,
|
172
172
|
|
173
|
-
severity: DEFAULT_SEVERITY
|
173
|
+
severity: DEFAULT_SEVERITY,
|
174
174
|
}.merge(CONTEXT).delete_if { |_key, val| val.nil? || val.empty? }
|
175
175
|
end
|
176
176
|
|
@@ -187,7 +187,7 @@ module Airbrake
|
|
187
187
|
@config.logger.error(
|
188
188
|
"#{LOG_LABEL} truncation failed. File an issue at " \
|
189
189
|
"https://github.com/airbrake/airbrake-ruby " \
|
190
|
-
"and attach the following payload: #{@payload}"
|
190
|
+
"and attach the following payload: #{@payload}",
|
191
191
|
)
|
192
192
|
end
|
193
193
|
|
@@ -202,7 +202,7 @@ module Airbrake
|
|
202
202
|
attributes = exception.to_airbrake
|
203
203
|
rescue StandardError => ex
|
204
204
|
@config.logger.error(
|
205
|
-
"#{LOG_LABEL} #{exception.class}#to_airbrake failed: #{ex.class}: #{ex}"
|
205
|
+
"#{LOG_LABEL} #{exception.class}#to_airbrake failed: #{ex.class}: #{ex}",
|
206
206
|
)
|
207
207
|
end
|
208
208
|
|
@@ -213,7 +213,7 @@ module Airbrake
|
|
213
213
|
rescue TypeError
|
214
214
|
@config.logger.error(
|
215
215
|
"#{LOG_LABEL} #{exception.class}#to_airbrake failed:" \
|
216
|
-
" #{attributes} must be a Hash"
|
216
|
+
" #{attributes} must be a Hash",
|
217
217
|
)
|
218
218
|
end
|
219
219
|
end
|