Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v6.0.0 #385

Merged
merged 118 commits into from
Nov 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
a1b9e42
Start thinking about new interface
snmaynard Aug 20, 2016
9f504dc
Progress
snmaynard Aug 20, 2016
2c8bae6
Progress
snmaynard Aug 20, 2016
94cea31
Merge in master and more progress on v5
snmaynard Aug 20, 2016
4e398c8
More progress
snmaynard Aug 20, 2016
44ff0b0
Specs are begining to come back together
snmaynard Aug 20, 2016
edf1a5a
Tests pass localy
snmaynard Aug 21, 2016
011e6cf
Silence logger
snmaynard Aug 21, 2016
96e6cd4
Logging
snmaynard Aug 21, 2016
713fad3
Not appropriate
snmaynard Aug 21, 2016
0e30d7a
Remove these
snmaynard Aug 21, 2016
7577dc5
Whitespace
snmaynard Aug 21, 2016
5144824
Report code coverage
kattrali Aug 11, 2017
5286521
Add spec filter
kattrali Aug 11, 2017
83ddab5
Skip old ruby when generating coverage specs
kattrali Aug 11, 2017
c955512
Test canceling reports, cleaning objects
kattrali Aug 11, 2017
6838fde
Test sidekiq integration
kattrali Aug 11, 2017
95b599d
Document how delivery works
kattrali Aug 11, 2017
03a1ebd
Constantize the default endpoint value
kattrali Aug 11, 2017
64f6dd1
Ensured default user_id set correctly in rack and rails3 middlewares …
Cawllec Aug 23, 2017
35eafcc
Modified test and travis system to check dependency separation
Cawllec Aug 24, 2017
c9d9b2b
Changed matrix makeup
Cawllec Aug 24, 2017
ca80cb2
Changed matrix makeup
Cawllec Aug 24, 2017
a8ef384
Ensured ruby-gems is up to date
Cawllec Aug 24, 2017
893de5a
Made more verbose
Cawllec Aug 24, 2017
fc011db
Ensured rvm versions correct and specified gem in specific cases
Cawllec Aug 24, 2017
8326a4b
Removed verbosity for easier reading
Cawllec Aug 24, 2017
de1b863
Ensured webmock installed correctly
Cawllec Aug 24, 2017
065a25b
Reporting environment options in build
Cawllec Aug 24, 2017
b228264
Seeing if issue tracked down
Cawllec Aug 25, 2017
95e68cb
Revert "Seeing if issue tracked down"
Cawllec Aug 25, 2017
0e5e903
Removed bundler caching
Cawllec Aug 25, 2017
38a12e7
Revert "Removed bundler caching"
Cawllec Aug 25, 2017
7c80ce9
Attempt to force bundler version
Cawllec Aug 25, 2017
fecaff0
Testing bundler without removal
Cawllec Aug 25, 2017
8373b1f
chore(ci): Switch gemset logic to be additive
kattrali Aug 25, 2017
770aff1
chore(ci): Update Ruby 2.1.8 in build matrix to 2.1.10
kattrali Aug 25, 2017
39d5e69
fix(ci): "Upgrade" bundler
kattrali Aug 25, 2017
7c02725
fix(spec): Skip test made irrelevant by Ruby 2.3.0 improvements
kattrali Aug 25, 2017
2678efc
fix(spec): Update JRuby test to match impl change in JRuby
kattrali Aug 25, 2017
f7502b7
fix(spec): Fix cleaner to be JSON+Ruby 1.9 compatible
kattrali Aug 25, 2017
b33760f
fix(ci): Fix bundler problems and tests on old rubies
kattrali Aug 26, 2017
f484dbf
chore(ci): Modified test system to check dep separation (#364)
kattrali Aug 26, 2017
403d8fa
Add an upgrade guide (#370)
kattrali Sep 20, 2017
ff8317a
Fixed incorrect path to bugsnag lib
Cawllec Aug 16, 2017
f6ca3bf
Ensured local bugsnag references correct library location
Cawllec Aug 16, 2017
6d8e174
Updated padrino example
Cawllec Sep 28, 2017
b8d421f
Removed favicon
Cawllec Sep 28, 2017
0427409
Updated to readme
Cawllec Sep 28, 2017
8534770
Updated rack example
Cawllec Sep 28, 2017
b5a4941
Updated rails server
Cawllec Sep 28, 2017
846a588
Fixed name
Cawllec Sep 28, 2017
4b48ab2
Updated error reasons
Cawllec Sep 28, 2017
05521af
Updated error reasons
Cawllec Sep 28, 2017
ad9959e
Updated resque example
Cawllec Sep 28, 2017
c258ac2
Removed API KEY
Cawllec Sep 29, 2017
42bd1e3
Remove ref
Cawllec Sep 29, 2017
7a12445
Updated resque/sidekiq examples
Cawllec Sep 29, 2017
7aaa01f
Updated sinatra example and sidekiq
Cawllec Sep 29, 2017
c994b16
Updated rails 4.2 example
Cawllec Sep 29, 2017
643ae3a
Track whether an error report is automatic (#368)
Cawllec Oct 2, 2017
ee93eab
Add 'did you mean' suggestions to metadata (#372)
Cawllec Oct 2, 2017
57331fe
Added rails 5.1 example
Cawllec Oct 3, 2017
cc9d267
Fixed incorrect path to bugsnag lib
Cawllec Aug 16, 2017
75e3b1b
Ensured local bugsnag references correct library location
Cawllec Aug 16, 2017
c0ee41b
Updated padrino example
Cawllec Sep 28, 2017
edb64da
Removed favicon
Cawllec Sep 28, 2017
e5d2d2f
Updated to readme
Cawllec Sep 28, 2017
1fd5ebb
Updated rack example
Cawllec Sep 28, 2017
0dd81d3
Updated rails server
Cawllec Sep 28, 2017
cc59789
Fixed name
Cawllec Sep 28, 2017
33b40ba
Updated error reasons
Cawllec Sep 28, 2017
425c947
Updated error reasons
Cawllec Sep 28, 2017
4d52ac5
Updated resque example
Cawllec Sep 28, 2017
4a926cc
Removed API KEY
Cawllec Sep 29, 2017
ab2e5c9
Remove ref
Cawllec Sep 29, 2017
0005ee0
Updated resque/sidekiq examples
Cawllec Sep 29, 2017
ad1a4aa
Updated sinatra example and sidekiq
Cawllec Sep 29, 2017
83834fa
Updated rails 4.2 example
Cawllec Sep 29, 2017
b1512fe
Added rails 5.1 example
Cawllec Oct 3, 2017
2342d8d
Merge branch 'v5-example-updates' of github.com:bugsnag/bugsnag-ruby …
Cawllec Oct 3, 2017
f61f948
Updated rails-42 example with delayed_job
Cawllec Oct 6, 2017
91d860a
Ensured correct commands mentioned
Cawllec Oct 6, 2017
54775b0
Ensured helper works correctly
Cawllec Oct 6, 2017
3f6e503
Enable setting proxy_host through environment variables (#379)
Cawllec Oct 6, 2017
a9a3b4e
Added warning if no valid key set
Cawllec Oct 11, 2017
a344910
Changed 'wrapper' to correct 'wrapped'
Cawllec Oct 11, 2017
64bf8c7
Added shoryken integration and example
Cawllec Oct 11, 2017
4ca6a9c
Added clearance middleware
Cawllec Oct 11, 2017
25b1942
Added default delivery method setting by integrations
Cawllec Oct 12, 2017
85db76c
Added que integration
Cawllec Oct 12, 2017
b587d42
Add changes from between v5 and v6 (#381)
kattrali Oct 12, 2017
38f2571
Update examples for v6 (#374)
kattrali Oct 12, 2017
0de9d58
Send the dyno name as hostname if available
kattrali Apr 7, 2017
ca5c12e
Rescue exceptions raised when calling to_s while sanitizing
kattrali Jun 13, 2017
3f9dc7c
Prevent nil from being cleaned in arrays and sets (#340)
duncanhewett Dec 19, 2016
2110848
Replace client IP address with SPOOF when it cannot be serialized
kattrali Jun 14, 2017
d29d71f
Allow overriding app_type from Rake apps
kattrali Apr 7, 2017
1174987
Revert "Move the Sidekiq reporter to after the logging middleware (#3…
reubenbrown Apr 25, 2017
43e1877
fix NameError when exception raised in delayed_job
eitoball Oct 6, 2017
ba45e32
support older json versions
keeganlow Nov 14, 2016
1a352d0
record information about ActiveJobs inside DelayedJobs
timdiggins Oct 19, 2016
9253cff
add queue and attempts to delayed jobs notification
timdiggins Oct 19, 2016
285b8d9
tweak number of attempts to make more sense
timdiggins Oct 19, 2016
5a3918d
Use File.exist? instead of File.exists? (#334)
Manfred Nov 17, 2016
34cead6
Sync specs
kattrali Oct 12, 2017
3acaa30
Add shoryuken example config
kattrali Oct 12, 2017
4b8a578
Merge v6
kattrali Oct 30, 2017
7e18f67
Only run delayed job tests on ruby >= 2.2.2
kattrali Oct 30, 2017
e6e0de6
Only run delayed job tests on ruby >= 2.2.2
kattrali Oct 30, 2017
659c22e
Merge pull request #380 from dexhorthy/net-http-proxy
Cawllec Nov 2, 2017
3794b25
[ci] Downgrade rubygems to downgrade bundler, use binstubs
kattrali Nov 8, 2017
a29e921
[spec] Conditionally skip integrations
kattrali Nov 8, 2017
91c0a6d
[spec] Hide unneeded test on newer ruby
kattrali Nov 8, 2017
661787d
Remove dup files
kattrali Nov 8, 2017
7c973a6
Update CI config and testing environment
kattrali Nov 8, 2017
fabcf69
Merge pull request #386 from bugsnag/v6/net-http
Cawllec Nov 9, 2017
dc48998
Updated examples
Cawllec Nov 9, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .document

This file was deleted.

44 changes: 33 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
sudo: false
language: ruby
cache: bundler
rvm:
- 2.3.0
- 2.2.4
- 2.1.8
- 2.0.0
- 1.9.3
- jruby-19mode

before_install:
- gem install bundler -v 1.12
- gem update --system
- bundle --version
- gem update --system 2.6.14
- gem --version
- gem install bundler -v 1.12
- bundle _1.12.0_ --version

install:
- bundle _1.12.0_ install --with "$GEMSETS" --binstubs

script:
- bundle exec ./bin/rake spec

jobs:
include:
- stage: test
env: GEMSETS=test
rvm: jruby-19mode
- stage: test
env: GEMSETS=test
rvm: 1.9.3
- stage: test
env: GEMSETS=test
rvm: 2.0.0
- stage: test
env: GEMSETS=test
rvm: 2.1.10
- stage: test
env: GEMSETS="test sidekiq"
rvm: 2.2.4
- stage: test
env: GEMSETS="test sidekiq coverage"
rvm: 2.3.0
- stage: test
env: GEMSETS="test sidekiq"
rvm: 2.4.1
20 changes: 20 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
source "https://rubygems.org"

group :test, optional: true do
gem 'rake', '~> 10.1.1'
gem 'rspec'
gem 'rdoc'
gem 'pry'
gem 'addressable', '~> 2.3.8'
gem 'delayed_job' if RUBY_VERSION >= '2.2.2'
gem 'webmock', RUBY_VERSION <= '1.9.3' ? '2.3.2': '>2.3.2'
end

group :coverage, optional: true do
gem 'simplecov'
gem 'coveralls'
end

group :sidekiq, optional: true do
gem 'sidekiq', '~> 5.0.4'
end

gemspec
31 changes: 19 additions & 12 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# encoding: utf-8

require 'rubygems'
require 'bundler'
require 'bundler/gem_tasks'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end

require 'rdoc/task'
RDoc::Task.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
Expand All @@ -24,6 +13,24 @@ end
# RSpec tasks
require 'rspec/core'
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
RSpec::Core::RakeTask.new(:spec) do |task|
integration_exclusions = []
begin
require 'sidekiq/testing'
rescue LoadError
puts "Skipping sidekiq tests, missing dependencies"
integration_exclusions << 'sidekiq'
end
begin
require 'delayed_job'
rescue LoadError
puts "Skipping delayed_job tests, missing dependencies"
integration_exclusions << 'delayed_job'
end
if integration_exclusions.length > 0
pattern = integration_exclusions.join(',')
task.rspec_opts = " --exclude-pattern **/integrations/{#{pattern}}_spec.rb"
end
end

task :default => :spec
58 changes: 58 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Upgrade Guide

## 5.x to 6.x

_Our Ruby library has gone through some major improvements and there are a few
changes required to use the new integrations_

#### Capistrano and deploys

Support for notifying Bugsnag of deployments has been separated into a separate
gem named `bugsnag-capistrano`. See the [integration
guide](https://docs.bugsnag.com/platforms/ruby/capistrano) for more information.


#### Configuration

* `Configuration.use_ssl` has been removed. Include the preferred protocol in `Configuration.endpoint` instead.
```diff
Bugsnag.configure do |config|
- config.use_ssl = true
- config.endpoint = 'myserver.example.com'
+ config.endpoint = 'https://myserver.example.com'
end
```
* `Configuration.ignore_classes` now no longer accepts strings. Use classes directly instead.
* `Configuration.delay_with_resque` has been removed
* `Configuration.vendor_paths` has been removed
* `Configuration.params_filters` has been renamed to `Configuration.meta_data_filters` to be clearer
* `Configuration.proxy_host` will now default to `ENV['http_proxy']` if set. It can still be manually set.

#### Notifying

* `notify` now only supports block syntax. Replace usage of the overrides hash with a block

```diff
- Bugsnag.notify(e, {severity: 'info'})
+ Bugsnag.notify(e) do |report|
+ report.severity = 'info'
+ end
```

* `Bugsnag.notify_or_ignore` and `Bugsnag.auto_notify` have been removed removed. Call `notify` directly instead.
* `after_notify_callbacks` has been removed
* `Bugsnag::Notification` has been renamed to `Bugsnag::Report`

#### Logging

* `config.debug` boolean has been removed. Set the logger level directly

```diff
+ require 'logger'

Bugsnag.configure do |config|
# .. set API key and other properties
- config.debug = true
+ config.logger.level = Logger::DEBUG
end
```
9 changes: 0 additions & 9 deletions bugsnag.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,4 @@ Gem::Specification.new do |s|
]
s.require_paths = ["lib"]
s.required_ruby_version = '>= 1.9.2'

s.add_development_dependency 'rake', '~> 10.1.1'
s.add_development_dependency 'rspec'
s.add_development_dependency 'rdoc'
s.add_development_dependency 'pry'
s.add_development_dependency 'addressable', '~> 2.3.8'
s.add_development_dependency 'webmock', '2.1.0'
s.add_development_dependency 'delayed_job'
s.add_development_dependency 'activesupport', '~> 4.2.10'
end
4 changes: 2 additions & 2 deletions example/padrino/Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

if ENV['INTEGRATION_LANGUAGE']
gem 'bugsnag', path: '../../../../'
gem 'bugsnag', path: '../../'
else
gem 'bugsnag'
end
Expand Down Expand Up @@ -38,7 +38,7 @@ gem 'riot', :group => 'test'
gem 'rack-test', :require => 'rack/test', :group => 'test'

# Padrino Stable Gem
gem 'padrino', '0.12.2'
gem 'padrino'

# Or Padrino Edge
# gem 'padrino', :github => 'padrino/padrino-framework'
Expand Down
97 changes: 27 additions & 70 deletions example/padrino/README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,44 @@
# Bugsnag Padrino demo

This Padrino application demonstrates how to use Bugsnag with Padrino. Before
testing it, open up the `config/boot.rb` file configure your API key inside
`Padrino.before_load`.
This Padrino application demonstrates how to use Bugsnag with Padrino.
Further details about integrating Bugsnag with Rack applications can be found [here.](https://docs.bugsnag.com/platforms/ruby/rack/)

```
Padrino.before_load do
Bugsnag.configure do |config|
config.api_key = '0a6f5add590596f93a8d601ea89af841'
end
end
Install dependencies

```shell
bundle install
```

In the same file activate the Bugsnag Rack middleware.
## Configuring Bugsnag and Padrino

```
Padrino.after_load do
Padrino.use Bugsnag::Rack
end
```
1. Set up the Padrino Bugsnag configuration in ```config/boot.rb``` in the `before_load` call according to the [available configuration options](https://docs.bugsnag.com/platforms/ruby/rack/configuration-options/):
```ruby
Padrino.before_load do
Bugsnag.configure do |config|
config.api_key = 'YOUR_API_KEY'
end
end
```

Open up `app/app.rb`, find two options and set them as follows: `raise_errors`
to `true` and `show_exceptions` to `false`. This enables automatic notifications
in the development environment. By default Padrino swallows exceptions from
Bugsnag (only in development, though).
2. Register the Rack middleware in ```config/boot.rb``` in the `after_load` call:
```ruby
Padrino.after_load do
Padrino.use Bugsnag::Rack
end
```

```
3. In `production` automatic notification of exceptions and errors will be enabled by default. If you want to enable notifications in `development`, open ```app/app.rb``` and set the following options:
```ruby
set :raise_errors, true
set :show_exceptions, false
```

If you would like to use custom error handlers, then you need to notify Bugsnag
explicitly.

```
error 500 do
Bugsnag.auto_notify($!)
erb :'errors/500'
end
```
## Running the example

Install dependencies.
Run the example using:

```
bundle install
```

Launch the Padrino application.

```
```shell
bundle exec padrino start
```

Next, open your project's dashboard on Bugsnag.

1. [crash](http://localhost:9292/crash)
<br/>
Crashes the application and sends a notification about the nature of the crash.
Basically, almost any unhandled exception sends a notification to Bugsnag. See
the line mentioning `get '/crash'` in `app/app.rb`.

1. [crash and use callbacks](http://localhost:9292/crash_with_callback)
<br/>
Before crashing, the application would append the Diagnostics tab with some
predefined information, attached by means of a callback. See the line mentioning
`get '/crash_with_callback'` in `app/app.rb`.

1. [notify](http://localhost:9292/notify)
<br/>
Bugsnag Ruby provides a way to send notifications on demand by means of
`Bugsnag.notify`. This API allows to send notifications manually, without
crashing your application. See the line mentioning `get '/notify'` in
`app/app.rb`.

1. [notify with meta data](http://localhost:9292/notify_meta)
<br/>
Same as `notify`, but also attaches meta data. The meta data is any additional
information you want to attach to an exception. In this artificial case
additional information with be sent and displayed in a new tab called
"Diagnostics". See the line mentioning `get '/notify_meta'` in `app/app.rb`.

1. [severity](http://localhost:9292/severity)
<br/>
Bugsnag supports three severities: 'error', 'warning' and 'info'. You can set
the severity by passing one of these objects as a string to '#notify'. See the
line mentioning `get '/severity'` in `app/app.rb`.
Once the server is running head to the default path for more information on Bugsnag logging examples.
30 changes: 15 additions & 15 deletions example/padrino/app/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class App < Padrino::Application
fenced_code_blocks: true
}
renderer = Redcarpet::Markdown.new(Redcarpet::Render::HTML, opts)
renderer.render(File.read(File.expand_path('README.md')))
renderer.render(File.read(File.expand_path('app/templates/index.md')))
end

get '/crash' do
Expand All @@ -76,12 +76,12 @@ class App < Padrino::Application
end

get '/crash_with_callback' do
Bugsnag.before_notify_callbacks << proc { |notification|
Bugsnag.before_notify_callbacks << proc { |report|
new_tab = {
message: 'Padrino demo says: Everything is great',
code: 200
}
notification.add_tab(:diagnostics, new_tab)
report.add_tab(:diagnostics, new_tab)
}

msg = 'Bugsnag Padrino demo says: It crashed! But, due to the attached callback' +
Expand All @@ -98,31 +98,31 @@ class App < Padrino::Application
' for a new notification.'
end

get '/notify_meta' do
meta_data = {
:user => {
get '/notify_data' do
error = RuntimeError.new("Bugsnag Padrino demo says: False alarm, your application didn't crash")
Bugsnag.notify error do |report|
report.add_tab(:user, {
:username => "bob-hoskins",
:email => 'bugsnag@bugsnag.com',
:registered_user => true
},

:diagnostics => {
})
report.add_tab(:diagnostics, {
:message => 'Padrino demo says: Everything is great',
:code => 200
}
}
error = RuntimeError.new("Bugsnag Padrino demo says: False alarm, your application didn't crash")
Bugsnag.notify(error, meta_data)
})
end

"Bugsnag Padrino demo says: It didn't crash! " +
'But still go check <a href="https://bugsnag.com">https://bugsnag.com</a>' +
' for a new notification. Check out the User tab for the meta data'
end

get '/severity' do
get '/notify_severity' do
msg = "Bugsnag Padrino demo says: Look at the circle on the right side. It's different"
error = RuntimeError.new(msg)
Bugsnag.notify(error, severity: 'info')
Bugsnag.notify error do |report|
report.severity = 'info'
end
msg
end
end
Expand Down
Loading