airbrake 3.0.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +75 -38
- data/INSTALL +8 -8
- data/README.md +12 -10
- data/Rakefile +1 -1
- data/SUPPORTED_RAILS_VERSIONS +2 -6
- data/TESTING.md +1 -1
- data/airbrake.gemspec +2 -2
- data/features/rails_with_js_notifier.feature +1 -1
- data/features/rake.feature +4 -0
- data/features/step_definitions/airbrake_shim.rb.template +2 -2
- data/features/step_definitions/rails_application_steps.rb +3 -3
- data/features/support/airbrake_shim.rb.template +2 -2
- data/features/support/rake/Rakefile +11 -0
- data/lib/airbrake.rb +2 -5
- data/lib/airbrake/capistrano.rb +14 -3
- data/lib/airbrake/configuration.rb +3 -3
- data/lib/airbrake/notice.rb +1 -1
- data/lib/airbrake/rails/javascript_notifier.rb +7 -1
- data/lib/airbrake/railtie.rb +4 -4
- data/lib/airbrake/rake_handler.rb +3 -2
- data/lib/airbrake/sender.rb +13 -1
- data/lib/airbrake/shared_tasks.rb +1 -1
- data/lib/airbrake/user_informer.rb +4 -2
- data/lib/airbrake/version.rb +1 -1
- data/lib/airbrake_tasks.rb +9 -3
- data/lib/templates/rescue.erb +2 -2
- data/resources/README.md +34 -0
- data/resources/ca-bundle.crt +3376 -0
- data/script/integration_test.rb +1 -1
- data/test/airbrake_tasks_test.rb +35 -25
- data/test/capistrano_test.rb +2 -1
- data/test/configuration_test.rb +2 -2
- data/test/notice_test.rb +7 -0
- data/test/notifier_test.rb +13 -0
- data/test/sender_test.rb +9 -9
- metadata +112 -183
data/CHANGELOG
CHANGED
@@ -1,3 +1,78 @@
|
|
1
|
+
Version 3.0.5 - 2011-11-08 23:02:07 -0800
|
2
|
+
===============================================================================
|
3
|
+
|
4
|
+
Benjamin Quorning (1):
|
5
|
+
README updated to reflect name change from Hoptoad to Airbrake
|
6
|
+
|
7
|
+
Darcy Laycock (1):
|
8
|
+
Explicitly scope calls to Rails.env and such to prevent loading issues when manually requiring parts of airbrake.
|
9
|
+
|
10
|
+
David Czarnecki (6):
|
11
|
+
Using the Capistrano logger for great justice
|
12
|
+
Using the Capistrano logger for great justice
|
13
|
+
Re-organized capistrano task to allow for testing
|
14
|
+
Fixing conflict
|
15
|
+
Fixed the name of the capistrano task in the test to be correct. Updated the cucumber feature to look for the right task name.
|
16
|
+
Change airbrake:notify to airbrake:deploy to be more clear that it is a deploy notification
|
17
|
+
|
18
|
+
Florent Guilleux (1):
|
19
|
+
Change Hoptoad references to Airbrake.
|
20
|
+
|
21
|
+
Gabe Berke-Williams (1):
|
22
|
+
Merge pull request #10 from Florent2/patch-1
|
23
|
+
|
24
|
+
Harold Giménez (10):
|
25
|
+
Heroku is still using HOPTOAD_API_KEY, so expect that for now
|
26
|
+
Bumping to version 3.0
|
27
|
+
Bumping to version 3.0.1
|
28
|
+
Fix bug in defining the Airbrake javascript object
|
29
|
+
Bumping to version 3.0.2
|
30
|
+
Ensure a valid configuration object is always available on Airbrake.configuration
|
31
|
+
Merge remote-tracking branch 'agoragames/master'
|
32
|
+
Bumping to version 3.0.3
|
33
|
+
Minor fix to Gemfile instructions on README
|
34
|
+
Bumping to version 3.0.4
|
35
|
+
|
36
|
+
Jonathan Siegel (15):
|
37
|
+
Removed class-level caching per jkraemer: Hi,
|
38
|
+
Integrated pulls and updated tests.
|
39
|
+
Integrated: https://github.com/thoughtbot/hoptoad_notifier/pull/37
|
40
|
+
Corrected test.
|
41
|
+
Consistent operation.
|
42
|
+
Consistent callout during test generation.
|
43
|
+
Fixed typo.
|
44
|
+
Refreshed supported.
|
45
|
+
Resolved: http://help.airbrakeapp.com/discussions/questions/587-airbrake_javascript_notifier-is-escaped-rails-31-haml
|
46
|
+
Now running airbrake deploy notifications on the REMOTE machine.
|
47
|
+
Added first rev of PEER cert resolution.
|
48
|
+
Bumped 3.0.5
|
49
|
+
Updated README, fixed JS rescue template missed HT reference.
|
50
|
+
Crosslinked docs...
|
51
|
+
Fixes for tests.
|
52
|
+
|
53
|
+
Leonid Shevtsov (1):
|
54
|
+
fixed rake handler failing when exception happens before Airbrake has been configured (for example, when running an unknown Rake task)
|
55
|
+
|
56
|
+
Matt Fawcett (1):
|
57
|
+
Call #close on the old body after building the new body to prevent thread joining errors
|
58
|
+
|
59
|
+
Roman Shterenzon (1):
|
60
|
+
Use either Airbrake or Hoptoad object.
|
61
|
+
|
62
|
+
Stuart Chaney (1):
|
63
|
+
point towards airbrake.io
|
64
|
+
|
65
|
+
Thomas Jachmann (1):
|
66
|
+
handles exceptions with #to_hash properly
|
67
|
+
|
68
|
+
usiegj00 (4):
|
69
|
+
Merge pull request #21 from mattfawcett/master
|
70
|
+
Merge pull request #12 from leonid-shevtsov/master
|
71
|
+
Merge pull request #14 from thomasjachmann/master
|
72
|
+
Merge pull request #28 from Sutto/patch-1
|
73
|
+
|
74
|
+
|
75
|
+
|
1
76
|
Version 3.0.4 - Mon Sep 12 08:25:04 -0400 2011
|
2
77
|
===============================================================================
|
3
78
|
David Czarnecki(1):
|
@@ -445,41 +520,3 @@ Nick Quaranto (3):
|
|
445
520
|
Adding rake changeling:push
|
446
521
|
|
447
522
|
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
data/INSTALL
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
=== Configuration
|
2
2
|
|
3
|
-
You should have something like this in config/initializers/
|
3
|
+
You should have something like this in config/initializers/airbrake.rb.
|
4
4
|
|
5
|
-
|
5
|
+
Airbrake.configure do |config|
|
6
6
|
config.api_key = '1234567890abcdef'
|
7
7
|
end
|
8
8
|
|
9
9
|
(Please note that this configuration should be in a global configuration, and
|
10
|
-
is *not* environment-specific.
|
10
|
+
is *not* environment-specific. Airbrake is smart enough to know what errors are
|
11
11
|
caused by what environments, so your staging errors don't get mixed in with
|
12
12
|
your production errors.)
|
13
13
|
|
14
|
-
You can test that
|
14
|
+
You can test that Airbrake is working in your production environment by using
|
15
15
|
this rake task (from RAILS_ROOT):
|
16
16
|
|
17
|
-
rake
|
17
|
+
rake airbrake:test
|
18
18
|
|
19
|
-
If everything is configured properly, that task will send a notice to
|
19
|
+
If everything is configured properly, that task will send a notice to Airbrake
|
20
20
|
which will be visible immediately.
|
21
21
|
|
22
22
|
NOTE FOR RAILS 1.2.* USERS:
|
23
23
|
|
24
|
-
You will need to copy the
|
25
|
-
RAILS_ROOT/lib/tasks directory in order for the rake
|
24
|
+
You will need to copy the airbrake_tasks.rb file into your
|
25
|
+
RAILS_ROOT/lib/tasks directory in order for the rake airbrake:test task to work.
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Airbrake
|
2
2
|
========
|
3
3
|
|
4
|
-
This is the notifier gem for integrating apps with [Airbrake](http://
|
4
|
+
This is the notifier gem for integrating apps with [Airbrake](http://airbrake.io).
|
5
5
|
|
6
6
|
When an uncaught exception occurs, Airbrake will POST the relevant data
|
7
7
|
to the Airbrake server specified in your environment.
|
@@ -9,22 +9,24 @@ to the Airbrake server specified in your environment.
|
|
9
9
|
Help
|
10
10
|
----
|
11
11
|
|
12
|
-
For help with using Airbrake and this notifier visit [our support site](http://help.
|
12
|
+
For help with using Airbrake and this notifier visit [our support site](http://help.airbrake.io).
|
13
13
|
|
14
|
-
For discussion of Airbrake development check out the [mailing list](http://groups.google.com/group/hoptoad-notifier-dev)
|
14
|
+
For discussion of Airbrake development check out the [mailing list](http://groups.google.com/group/hoptoad-notifier-dev).
|
15
|
+
|
16
|
+
For SSL verification see the [Resources](resources/README.md).
|
15
17
|
|
16
18
|
Rails Installation
|
17
19
|
------------------
|
18
20
|
|
19
|
-
### Remove
|
21
|
+
### Remove hoptoad_notifier
|
20
22
|
|
21
23
|
in your ApplicationController, REMOVE this line:
|
22
24
|
|
23
|
-
include
|
25
|
+
include HoptoadNotifiable
|
24
26
|
|
25
|
-
In your config/environment* files, remove all references to
|
27
|
+
In your config/environment* files, remove all references to HoptoadNotifier
|
26
28
|
|
27
|
-
Remove the vendor/plugins/
|
29
|
+
Remove the vendor/plugins/hoptoad_notifier directory.
|
28
30
|
|
29
31
|
### Remove hoptoad_notifier plugin
|
30
32
|
|
@@ -86,7 +88,7 @@ If it does, remove it. The new catcher is automatically included by the gem
|
|
86
88
|
version of Airbrake.
|
87
89
|
|
88
90
|
Before running the airbrake generator, you need to find your project's API key.
|
89
|
-
Log in to your account at
|
91
|
+
Log in to your account at airbrake.io, and click on the "Projects" button.
|
90
92
|
Then, find your project in the list, and click on its name. In the left-hand
|
91
93
|
column, you'll see an "Edit this project" button. Click on that to get your
|
92
94
|
project's API key. If you accidentally use your personal API auth_token,
|
@@ -203,7 +205,7 @@ Informing the User
|
|
203
205
|
------------------
|
204
206
|
|
205
207
|
The airbrake gem is capable of telling the user information about the error that just happened
|
206
|
-
via the user_information option. They can give this error number in bug
|
208
|
+
via the user_information option. They can give this error number in bug reports, for example.
|
207
209
|
By default, if your 500.html contains the text
|
208
210
|
|
209
211
|
<!-- AIRBRAKE ERROR -->
|
@@ -382,7 +384,7 @@ Supported Rails versions
|
|
382
384
|
See SUPPORTED_RAILS_VERSIONS for a list of official supported versions of
|
383
385
|
Rails.
|
384
386
|
|
385
|
-
Please open up a support ticket ( http://help.
|
387
|
+
Please open up a support ticket ( http://help.airbrake.io ) if
|
386
388
|
you're using a version of Rails that is listed above and the notifier is
|
387
389
|
not working properly.
|
388
390
|
|
data/Rakefile
CHANGED
@@ -48,7 +48,7 @@ namespace :changeling do
|
|
48
48
|
|
49
49
|
version = [major, minor, patch, build].compact.join('.')
|
50
50
|
|
51
|
-
File.open(File.join("lib", "airbrake", "
|
51
|
+
File.open(File.join("lib", "airbrake", "version.rb"), "w") do |f|
|
52
52
|
f.write <<EOF
|
53
53
|
module Airbrake
|
54
54
|
VERSION = "#{version}".freeze
|
data/SUPPORTED_RAILS_VERSIONS
CHANGED
data/TESTING.md
CHANGED
@@ -19,7 +19,7 @@ Note: do NOT use 'bundle exec rake'.
|
|
19
19
|
For Maintainers
|
20
20
|
================
|
21
21
|
|
22
|
-
When developing the
|
22
|
+
When developing the Airbrake Notifier, be sure to use the integration test against an existing project on staging before pushing to master.
|
23
23
|
|
24
24
|
./script/integration_test.rb <test project's api key> <staging server hostname>
|
25
25
|
|
data/airbrake.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_development_dependency("capistrano", "~> 2.8.0")
|
28
28
|
|
29
29
|
s.authors = ["thoughtbot, inc"]
|
30
|
-
s.email = %q{support@
|
31
|
-
s.homepage = "http://www.
|
30
|
+
s.email = %q{support@airbrake.io}
|
31
|
+
s.homepage = "http://www.airbrake.io"
|
32
32
|
|
33
33
|
s.platform = Gem::Platform::RUBY
|
34
34
|
end
|
@@ -19,7 +19,7 @@ Feature: Install the Gem in a Rails application and enable the JavaScript notifi
|
|
19
19
|
And I perform a request to "http://example.com:123/test/index"
|
20
20
|
Then I should see the notifier JavaScript for the following:
|
21
21
|
| api_key | environment | host |
|
22
|
-
| myapikey | production |
|
22
|
+
| myapikey | production | airbrake.io |
|
23
23
|
And the notifier JavaScript should provide the following errorDefaults:
|
24
24
|
| url | component | action |
|
25
25
|
| http://example.com:123/test/index | test | index |
|
data/features/rake.feature
CHANGED
@@ -6,6 +6,10 @@ Feature: Use the Gem to catch errors in a Rake application
|
|
6
6
|
When I run rake with airbrake
|
7
7
|
Then Airbrake should catch the exception
|
8
8
|
|
9
|
+
Scenario: Falling back to default handler before Airbrake is configured
|
10
|
+
When I run rake with airbrake not yet configured
|
11
|
+
Then Airbrake should not catch the exception
|
12
|
+
|
9
13
|
Scenario: Disabling Rake exception catcher
|
10
14
|
When I run rake with airbrake disabled
|
11
15
|
Then Airbrake should not catch the exception
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'sham_rack'
|
2
2
|
|
3
|
-
ShamRack.at("
|
3
|
+
ShamRack.at("airbrake.io") do |env|
|
4
4
|
xml = env['rack.input'].read
|
5
5
|
puts "Recieved the following exception:\n#{xml}"
|
6
6
|
response = <<-end_xml
|
7
7
|
<?xml version="1.0" encoding="UTF-8"?>
|
8
8
|
<notice>
|
9
9
|
<error-id type="integer">3799307</error-id>
|
10
|
-
<url>http://sample.
|
10
|
+
<url>http://sample.airbrake.io/errors/3799307/notices/643732254</url>
|
11
11
|
<id type="integer">643732254</id>
|
12
12
|
</notice>
|
13
13
|
end_xml
|
@@ -31,9 +31,9 @@ end
|
|
31
31
|
|
32
32
|
When /^I run the airbrake generator with "([^\"]*)"$/ do |generator_args|
|
33
33
|
if rails3?
|
34
|
-
When %{I run "script/rails generate airbrake #{generator_args}"}
|
34
|
+
When %{I run "./script/rails generate airbrake #{generator_args}"}
|
35
35
|
else
|
36
|
-
When %{I run "script/generate airbrake #{generator_args}"}
|
36
|
+
When %{I run "./script/generate airbrake #{generator_args}"}
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -363,7 +363,7 @@ end
|
|
363
363
|
|
364
364
|
Then /^I should see the notifier JavaScript for the following:$/ do |table|
|
365
365
|
hash = table.hashes.first
|
366
|
-
host = hash['host'] || '
|
366
|
+
host = hash['host'] || 'airbrake.io'
|
367
367
|
secure = hash['secure'] || false
|
368
368
|
api_key = hash['api_key']
|
369
369
|
environment = hash['environment'] || 'production'
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'sham_rack'
|
2
2
|
|
3
|
-
ShamRack.at("
|
3
|
+
ShamRack.at("airbrake.io") do |env|
|
4
4
|
xml = env['rack.input'].read
|
5
5
|
puts "Recieved the following exception:\n#{xml}"
|
6
6
|
response = <<-end_xml
|
7
7
|
<?xml version="1.0" encoding="UTF-8"?>
|
8
8
|
<notice>
|
9
9
|
<error-id type="integer">3799307</error-id>
|
10
|
-
<url>http://sample.
|
10
|
+
<url>http://sample.airbrake.io/errors/3799307/notices/643732254</url>
|
11
11
|
<id type="integer">643732254</id>
|
12
12
|
</notice>
|
13
13
|
end_xml
|
@@ -36,6 +36,13 @@ task :airbrake_autodetect_not_from_terminal do
|
|
36
36
|
raise_exception
|
37
37
|
end
|
38
38
|
|
39
|
+
task :airbrake_not_yet_configured do
|
40
|
+
Airbrake.configuration.rescue_rake_exceptions = true
|
41
|
+
stub_tty_output(true)
|
42
|
+
stub_empty_sender
|
43
|
+
raise_exception
|
44
|
+
end
|
45
|
+
|
39
46
|
module Airbrake
|
40
47
|
def self.notify(*args)
|
41
48
|
# TODO if you need to check more params, you'll have to use json.dump or something
|
@@ -43,6 +50,10 @@ module Airbrake
|
|
43
50
|
end
|
44
51
|
end
|
45
52
|
|
53
|
+
def stub_empty_sender
|
54
|
+
Airbrake.sender = nil
|
55
|
+
end
|
56
|
+
|
46
57
|
def stub_tty_output(value)
|
47
58
|
Rake.application.instance_eval do
|
48
59
|
@tty_output_stub = value
|
data/lib/airbrake.rb
CHANGED
@@ -137,11 +137,8 @@ module Airbrake
|
|
137
137
|
|
138
138
|
def build_notice_for(exception, opts = {})
|
139
139
|
exception = unwrap_exception(exception)
|
140
|
-
|
141
|
-
|
142
|
-
else
|
143
|
-
opts = opts.merge(:exception => exception)
|
144
|
-
end
|
140
|
+
opts = opts.merge(:exception => exception)
|
141
|
+
opts = opts.merge(exception.to_hash) if exception.respond_to?(:to_hash)
|
145
142
|
Notice.new(configuration.merge(opts))
|
146
143
|
end
|
147
144
|
|
data/lib/airbrake/capistrano.rb
CHANGED
@@ -9,16 +9,26 @@ module Airbrake
|
|
9
9
|
after "deploy:migrations", "airbrake:deploy"
|
10
10
|
|
11
11
|
namespace :airbrake do
|
12
|
-
desc
|
12
|
+
desc <<-DESC
|
13
|
+
Notify Airbrake of the deployment by running the notification on the REMOTE machine.
|
14
|
+
- Run remotely so we use remote API keys, environment, etc.
|
15
|
+
DESC
|
13
16
|
task :deploy, :except => { :no_release => true } do
|
14
17
|
rails_env = fetch(:airbrake_env, fetch(:rails_env, "production"))
|
15
18
|
local_user = ENV['USER'] || ENV['USERNAME']
|
16
19
|
executable = RUBY_PLATFORM.downcase.include?('mswin') ? fetch(:rake, 'rake.bat') : fetch(:rake, 'rake')
|
17
|
-
|
20
|
+
directory = configuration.current_release
|
21
|
+
notify_command = "cd #{directory}; #{executable} RAILS_ENV=#{rails_env} airbrake:deploy TO=#{rails_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}"
|
18
22
|
notify_command << " DRY_RUN=true" if dry_run
|
19
23
|
notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']
|
20
24
|
logger.info "Notifying Airbrake of Deploy (#{notify_command})"
|
21
|
-
|
25
|
+
if configuration.dry_run
|
26
|
+
logger.info "DRY RUN: Notification not actually run."
|
27
|
+
else
|
28
|
+
result = ""
|
29
|
+
run(notify_command, :once => true) { |ch, stream, data| result << data }
|
30
|
+
# TODO: Check if SSL is active on account via result content.
|
31
|
+
end
|
22
32
|
logger.info "Airbrake Notification Complete."
|
23
33
|
end
|
24
34
|
end
|
@@ -30,3 +40,4 @@ end
|
|
30
40
|
if Capistrano::Configuration.instance
|
31
41
|
Airbrake::Capistrano.load_into(Capistrano::Configuration.instance)
|
32
42
|
end
|
43
|
+
|
@@ -13,7 +13,7 @@ module Airbrake
|
|
13
13
|
# The API key for your project, found on the project edit form.
|
14
14
|
attr_accessor :api_key
|
15
15
|
|
16
|
-
# The host to connect to (defaults to
|
16
|
+
# The host to connect to (defaults to airbrake.io).
|
17
17
|
attr_accessor :host
|
18
18
|
|
19
19
|
# The port on which your Airbrake server runs (defaults to 443 for secure
|
@@ -123,7 +123,7 @@ module Airbrake
|
|
123
123
|
|
124
124
|
def initialize
|
125
125
|
@secure = false
|
126
|
-
@host = '
|
126
|
+
@host = 'airbrake.io'
|
127
127
|
@http_open_timeout = 2
|
128
128
|
@http_read_timeout = 5
|
129
129
|
@params_filters = DEFAULT_PARAMS_FILTERS.dup
|
@@ -135,7 +135,7 @@ module Airbrake
|
|
135
135
|
@development_lookup = true
|
136
136
|
@notifier_name = 'Airbrake Notifier'
|
137
137
|
@notifier_version = VERSION
|
138
|
-
@notifier_url = 'http://
|
138
|
+
@notifier_url = 'http://airbrake.io'
|
139
139
|
@framework = 'Standalone'
|
140
140
|
@user_information = 'Airbrake Error {{error_id}}'
|
141
141
|
@rescue_rake_exceptions = nil
|
data/lib/airbrake/notice.rb
CHANGED
@@ -241,7 +241,7 @@ module Airbrake
|
|
241
241
|
result.merge(key => clean_unserializable_data(value, stack + [data.object_id]))
|
242
242
|
end
|
243
243
|
elsif data.respond_to?(:to_ary)
|
244
|
-
data.collect do |value|
|
244
|
+
data.to_ary.collect do |value|
|
245
245
|
clean_unserializable_data(value, stack + [data.object_id])
|
246
246
|
end
|
247
247
|
else
|