bugsnag 4.2.1 → 6.27.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 +5 -5
- data/.yardopts +12 -0
- data/CHANGELOG.md +814 -0
- data/README.md +21 -25
- data/VERSION +1 -1
- data/bugsnag.gemspec +19 -8
- data/lib/bugsnag/breadcrumb_type.rb +14 -0
- data/lib/bugsnag/breadcrumbs/breadcrumb.rb +109 -0
- data/lib/bugsnag/breadcrumbs/breadcrumbs.rb +13 -0
- data/lib/bugsnag/breadcrumbs/on_breadcrumb_callback_list.rb +48 -0
- data/lib/bugsnag/breadcrumbs/validator.rb +29 -0
- data/lib/bugsnag/cleaner.rb +170 -59
- data/lib/bugsnag/code_extractor.rb +137 -0
- data/lib/bugsnag/configuration.rb +670 -45
- data/lib/bugsnag/delivery/synchronous.rb +31 -14
- data/lib/bugsnag/delivery/thread_queue.rb +23 -6
- data/lib/bugsnag/delivery.rb +13 -0
- data/lib/bugsnag/endpoint_configuration.rb +11 -0
- data/lib/bugsnag/endpoint_validator.rb +80 -0
- data/lib/bugsnag/error.rb +25 -0
- data/lib/bugsnag/event.rb +5 -0
- data/lib/bugsnag/feature_flag.rb +74 -0
- data/lib/bugsnag/helpers.rb +121 -25
- data/lib/bugsnag/integrations/delayed_job.rb +51 -0
- data/lib/bugsnag/integrations/mailman.rb +43 -0
- data/lib/bugsnag/integrations/mongo.rb +133 -0
- data/lib/bugsnag/integrations/que.rb +53 -0
- data/lib/bugsnag/integrations/rack.rb +83 -0
- data/lib/bugsnag/integrations/rails/active_job.rb +100 -0
- data/lib/bugsnag/{rails → integrations/rails}/active_record_rescue.rb +10 -1
- data/lib/bugsnag/{rails → integrations/rails}/controller_methods.rb +1 -9
- data/lib/bugsnag/integrations/rails/rails_breadcrumbs.rb +115 -0
- data/lib/bugsnag/integrations/railtie.rb +153 -0
- data/lib/bugsnag/integrations/rake.rb +74 -0
- data/lib/bugsnag/integrations/resque.rb +94 -0
- data/lib/bugsnag/integrations/shoryuken.rb +50 -0
- data/lib/bugsnag/integrations/sidekiq.rb +68 -0
- data/lib/bugsnag/meta_data.rb +1 -0
- data/lib/bugsnag/middleware/active_job.rb +18 -0
- data/lib/bugsnag/middleware/breadcrumbs.rb +21 -0
- data/lib/bugsnag/middleware/callbacks.rb +6 -8
- data/lib/bugsnag/middleware/classify_error.rb +50 -0
- data/lib/bugsnag/middleware/clearance_user.rb +33 -0
- data/lib/bugsnag/middleware/delayed_job.rb +93 -0
- data/lib/bugsnag/middleware/discard_error_class.rb +30 -0
- data/lib/bugsnag/middleware/exception_meta_data.rb +42 -0
- data/lib/bugsnag/middleware/ignore_error_class.rb +26 -0
- data/lib/bugsnag/middleware/mailman.rb +6 -4
- data/lib/bugsnag/middleware/rack_request.rb +126 -30
- data/lib/bugsnag/middleware/rails3_request.rb +15 -17
- data/lib/bugsnag/middleware/rake.rb +7 -5
- data/lib/bugsnag/middleware/session_data.rb +25 -0
- data/lib/bugsnag/middleware/sidekiq.rb +9 -4
- data/lib/bugsnag/middleware/suggestion_data.rb +34 -0
- data/lib/bugsnag/middleware/warden_user.rb +11 -6
- data/lib/bugsnag/middleware_stack.rb +62 -9
- data/lib/bugsnag/on_error_callbacks.rb +33 -0
- data/lib/bugsnag/report.rb +516 -0
- data/lib/bugsnag/session_tracker.rb +182 -0
- data/lib/bugsnag/stacktrace.rb +82 -0
- data/lib/bugsnag/tasks/bugsnag.rake +2 -70
- data/lib/bugsnag/utility/circular_buffer.rb +62 -0
- data/lib/bugsnag/utility/duplicator.rb +124 -0
- data/lib/bugsnag/utility/feature_data_store.rb +41 -0
- data/lib/bugsnag/utility/feature_flag_delegate.rb +89 -0
- data/lib/bugsnag/utility/metadata_delegate.rb +102 -0
- data/lib/bugsnag.rb +528 -80
- metadata +61 -123
- data/.document +0 -5
- data/.gitignore +0 -52
- data/.rspec +0 -3
- data/.travis.yml +0 -14
- data/CONTRIBUTING.md +0 -47
- data/Gemfile +0 -2
- data/Rakefile +0 -29
- data/lib/bugsnag/capistrano.rb +0 -7
- data/lib/bugsnag/capistrano2.rb +0 -32
- data/lib/bugsnag/delay/resque.rb +0 -21
- data/lib/bugsnag/delayed_job.rb +0 -57
- data/lib/bugsnag/deploy.rb +0 -34
- data/lib/bugsnag/mailman.rb +0 -28
- data/lib/bugsnag/middleware/rails2_request.rb +0 -52
- data/lib/bugsnag/notification.rb +0 -459
- data/lib/bugsnag/rack.rb +0 -53
- data/lib/bugsnag/rails/action_controller_rescue.rb +0 -62
- data/lib/bugsnag/rails.rb +0 -66
- data/lib/bugsnag/railtie.rb +0 -80
- data/lib/bugsnag/rake.rb +0 -25
- data/lib/bugsnag/resque.rb +0 -40
- data/lib/bugsnag/sidekiq.rb +0 -42
- data/lib/bugsnag/tasks/bugsnag.cap +0 -48
- data/rails/init.rb +0 -7
- data/spec/cleaner_spec.rb +0 -138
- data/spec/code_spec.rb +0 -86
- data/spec/fixtures/crashes/end_of_file.rb +0 -9
- data/spec/fixtures/crashes/short_file.rb +0 -1
- data/spec/fixtures/crashes/start_of_file.rb +0 -9
- data/spec/fixtures/middleware/internal_info_setter.rb +0 -11
- data/spec/fixtures/middleware/public_info_setter.rb +0 -11
- data/spec/fixtures/tasks/Rakefile +0 -15
- data/spec/helper_spec.rb +0 -163
- data/spec/integration_spec.rb +0 -132
- data/spec/middleware_spec.rb +0 -181
- data/spec/notification_spec.rb +0 -877
- data/spec/rack_spec.rb +0 -56
- data/spec/spec_helper.rb +0 -53
data/spec/rack_spec.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Bugsnag::Rack do
|
4
|
-
it "calls the upstream rack app with the environment" do
|
5
|
-
rack_env = {"key" => "value"}
|
6
|
-
app = lambda { |env| ['response', {}, env] }
|
7
|
-
rack_stack = Bugsnag::Rack.new(app)
|
8
|
-
|
9
|
-
response = rack_stack.call(rack_env)
|
10
|
-
|
11
|
-
expect(response).to eq(['response', {}, rack_env])
|
12
|
-
end
|
13
|
-
|
14
|
-
context "when an exception is raised in rack middleware" do
|
15
|
-
# Build a fake crashing rack app
|
16
|
-
exception = BugsnagTestException.new("It crashed")
|
17
|
-
rack_env = {"key" => "value"}
|
18
|
-
app = lambda { |env| raise exception }
|
19
|
-
rack_stack = Bugsnag::Rack.new(app)
|
20
|
-
|
21
|
-
it "re-raises the exception" do
|
22
|
-
expect { rack_stack.call(rack_env) }.to raise_error(BugsnagTestException)
|
23
|
-
end
|
24
|
-
|
25
|
-
it "delivers an exception if auto_notify is enabled" do
|
26
|
-
rack_stack.call(rack_env) rescue nil
|
27
|
-
|
28
|
-
expect(Bugsnag).to have_sent_notification{ |payload|
|
29
|
-
exception_class = payload["events"].first["exceptions"].first["errorClass"]
|
30
|
-
expect(exception_class).to eq(exception.class.to_s)
|
31
|
-
}
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
it "does not deliver an exception if auto_notify is disabled" do
|
36
|
-
Bugsnag.configure do |config|
|
37
|
-
config.auto_notify = false
|
38
|
-
end
|
39
|
-
|
40
|
-
rack_stack.call(rack_env) rescue nil
|
41
|
-
|
42
|
-
expect(Bugsnag::Notification).not_to have_sent_notification
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
it "don't mess with middlewares list on each req" do
|
47
|
-
stub_const('Rack', nil)
|
48
|
-
app = lambda { |env| ['200', {}, ['']] }
|
49
|
-
|
50
|
-
Bugsnag::Rack.new(app)
|
51
|
-
|
52
|
-
expect { 2.times { Bugsnag::Rack.new(app) } }.not_to change {
|
53
|
-
Bugsnag.configuration.middleware.instance_variable_get(:@middlewares)
|
54
|
-
}
|
55
|
-
end
|
56
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'bugsnag'
|
2
|
-
|
3
|
-
require 'webmock/rspec'
|
4
|
-
require 'rspec/expectations'
|
5
|
-
|
6
|
-
class BugsnagTestException < RuntimeError; end
|
7
|
-
|
8
|
-
def get_event_from_payload(payload)
|
9
|
-
expect(payload["events"].size).to eq(1)
|
10
|
-
payload["events"].first
|
11
|
-
end
|
12
|
-
|
13
|
-
def get_exception_from_payload(payload)
|
14
|
-
event = get_event_from_payload(payload)
|
15
|
-
expect(event["exceptions"].size).to eq(1)
|
16
|
-
event["exceptions"].last
|
17
|
-
end
|
18
|
-
|
19
|
-
def notify_test_exception(*args)
|
20
|
-
Bugsnag.notify(RuntimeError.new("test message"), *args)
|
21
|
-
end
|
22
|
-
|
23
|
-
RSpec.configure do |config|
|
24
|
-
config.order = "random"
|
25
|
-
|
26
|
-
config.before(:each) do
|
27
|
-
WebMock.stub_request(:post, "https://notify.bugsnag.com/")
|
28
|
-
|
29
|
-
Bugsnag.instance_variable_set(:@configuration, Bugsnag::Configuration.new)
|
30
|
-
Bugsnag.configure do |bugsnag|
|
31
|
-
bugsnag.api_key = "c9d60ae4c7e70c4b6c4ebd3e8056d2b8"
|
32
|
-
bugsnag.release_stage = "production"
|
33
|
-
bugsnag.delivery_method = :synchronous
|
34
|
-
# silence logger in tests
|
35
|
-
bugsnag.logger = Logger.new(StringIO.new)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
config.after(:each) do
|
40
|
-
Bugsnag.configuration.clear_request_data
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def have_sent_notification(&matcher)
|
45
|
-
have_requested(:post, "https://notify.bugsnag.com/").with do |request|
|
46
|
-
if matcher
|
47
|
-
matcher.call JSON.parse(request.body)
|
48
|
-
true
|
49
|
-
else
|
50
|
-
raise "no matcher provided to have_sent_notification (did you use { })"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|