Skip to content

Commit e1e50db

Browse files
committed
Merge remote-tracking branch 'origin/next' into ruby-waring
2 parents 15e32ea + 338bdaf commit e1e50db

196 files changed

Lines changed: 10854 additions & 150 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.rubocop_todo.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ Metrics/BlockNesting:
289289
# Configuration parameters: CountComments.
290290
Metrics/ClassLength:
291291
Max: 149
292+
Exclude:
293+
- 'lib/bugsnag/report.rb'
294+
- 'lib/bugsnag/configuration.rb'
292295

293296
# Offense count: 12
294297
Metrics/CyclomaticComplexity:
@@ -305,6 +308,7 @@ Metrics/ModuleLength:
305308
Max: 125
306309
Exclude:
307310
- 'lib/bugsnag/helpers.rb'
311+
- 'lib/bugsnag.rb'
308312

309313
# Offense count: 11
310314
Metrics/PerceivedComplexity:

CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,65 @@
11
Changelog
22
=========
33

4+
## TBC
5+
6+
### Fixes
7+
8+
* Account for missing `:binds` key in `sql.active_record` ActiveSupport notifications
9+
| [#555](https://github.com/bugsnag/bugsnag-ruby/issues/555)
10+
| [#565](https://github.com/bugsnag/bugsnag-ruby/pull/565)
11+
12+
## 6.12.0 (28 Aug 2019)
13+
14+
### Enhancements
15+
16+
* Add Ruby (and other framework) version strings to report and session payloads (device.runtimeVersions).
17+
| [560](https://github.com/bugsnag/bugsnag-ruby/pull/560)
18+
19+
* Allow symbols in breadcrumb meta data.
20+
| [#563](https://github.com/bugsnag/bugsnag-ruby/pull/563)
21+
| [directionless](https://github.com/directionless)
22+
23+
### Fixes
24+
25+
* Use `Module#prepend` for Rake integration when on a new enough Ruby version
26+
to avoid infinite mutual recursion issues when something else monkey patches
27+
`Rake::Task`.
28+
| [#556](https://github.com/bugsnag/bugsnag-ruby/issues/556)
29+
| [#559](https://github.com/bugsnag/bugsnag-ruby/issues/559)
30+
31+
* Handle `nil` values for the `job` block parameter for the Que error notifier.
32+
This occurs under some conditions such as database connection failures.
33+
| [#545](https://github.com/bugsnag/bugsnag-ruby/issues/545)
34+
| [#548](https://github.com/bugsnag/bugsnag-ruby/pull/548)
35+
36+
## 6.11.1 (22 Jan 2019)
37+
38+
### Fixes
39+
40+
* Fix issue with unnecessary meta_data being logged during breadcrumb validation.
41+
| [#530](https://github.com/bugsnag/bugsnag-ruby/pull/530)
42+
43+
## 6.11.0 (17 Jan 2019)
44+
45+
**Note**: this release alters the behaviour of the notifier to track sessions automatically.
46+
47+
### Enhancements
48+
49+
* Added Breadcrumbs. Breadcrumbs allow you to track events that may have led
50+
up to an error, such as handled errors, page redirects, or SQL queries. For info on what
51+
is tracked and how you can customize the data that breadcrumbs collect, see the
52+
[Logging breadcrumbs](https://docs.bugsnag.com/platforms/ruby/other#logging-breadcrumbs)
53+
section of our documentation.
54+
| [#525](https://github.com/bugsnag/bugsnag-ruby/pull/525)
55+
56+
* Bugsnag will now capture automatically created sessions by default.
57+
| [#523](https://github.com/bugsnag/bugsnag-ruby/pull/523)
58+
59+
### Deprecated
60+
61+
* The `endpoint` and `session_endpoint` configuration options are now deprecated but still supported. The [`set_endpoints`](https://docs.bugsnag.com/platforms/ruby/other/configuration-options#endpoints) method should be used instead. Note that session tracking will be disabled if the notify endpoint is configured but the sessions endpoint is not - this is to avoid inadvertently sending session payloads to the wrong server.
62+
463
## 6.10.0 (05 Dec 2018)
564

665
### Enhancements

CONTRIBUTING.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ Thank you!
1818
- Run the tests with and make sure they all pass
1919

2020
```
21-
rake spec
21+
bundle exec rake spec
22+
```
23+
- You will need to add the following test dependencies:
24+
25+
```
26+
bundle install --with test --binstubs
2227
```
2328
- For adding a new integration (like support for a web framework or worker
2429
queue), include an example in the `example/` directory showing off what

Gemfile

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
source "https://rubygems.org"
22

3+
ruby_version = Gem::Version.new(RUBY_VERSION)
4+
35
group :test, optional: true do
4-
gem 'rake', RUBY_VERSION <= '1.9.3' ? '~> 11.3.0' : '~> 12.3.0'
5-
gem 'rspec'
6-
gem 'rspec-mocks'
7-
gem 'rdoc', '~> 5.1.0'
8-
gem 'pry'
9-
gem 'addressable', '~> 2.3.8'
10-
gem 'delayed_job' if RUBY_VERSION >= '2.2.2'
11-
gem 'webmock', RUBY_VERSION <= '1.9.3' ? '2.3.2': '>2.3.2'
6+
gem 'rake', ruby_version <= Gem::Version.new('1.9.3') ? '~> 11.3.0' : '~> 12.3.0'
7+
gem 'rspec'
8+
gem 'rspec-mocks'
9+
gem 'rdoc', '~> 5.1.0'
10+
gem 'pry'
11+
gem 'addressable', '~> 2.3.8'
12+
if ruby_version >= Gem::Version.new('2.2.2')
13+
gem 'delayed_job', ruby_version < Gem::Version.new('2.5.0') ? '4.1.7': '>4.1.7'
14+
gem 'i18n', ruby_version <= Gem::Version.new('2.3.0') ? '1.4.0' : '>1.4.0'
15+
end
16+
gem 'webmock', ruby_version <= Gem::Version.new('1.9.3') ? '2.3.2': '>2.3.2'
17+
gem 'hashdiff', ruby_version <= Gem::Version.new('1.9.3') ? '0.3.8': '>0.3.8'
1218
end
1319

1420
group :coverage, optional: true do
@@ -21,15 +27,17 @@ group :rubocop, optional: true do
2127
end
2228

2329
group :sidekiq, optional: true do
24-
gem 'sidekiq', '~> 5.0.4'
30+
gem 'sidekiq', '~> 5.2.7'
31+
# redis 4.1.2 dropped support for Ruby 2.2
32+
gem 'redis', ruby_version < Gem::Version.new('2.3.0') ? '4.1.1' : '>= 4.1.2'
2533
end
2634

2735
group :doc, optional: true do
2836
gem 'hanna-nouveau'
2937
end
3038

3139
group :maze, optional: true do
32-
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner' if RUBY_VERSION >= '2.0.0'
40+
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner' if ruby_version >= Gem::Version.new('2.0.0')
3341
end
3442

3543
gemspec

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Bugsnag exception reporter for Ruby
2-
[![build status](https://travis-ci.org/bugsnag/bugsnag-ruby.svg?branch=master)](https://travis-ci.org/bugsnag/bugsnag-ruby)
1+
# Bugsnag error monitoring & exception reporter for Ruby
2+
[![build status](https://travis-ci.com/bugsnag/bugsnag-ruby.svg?branch=master)](https://travis-ci.com/bugsnag/bugsnag-ruby)
33

44

55
The Bugsnag exception reporter for Ruby gives you instant notification of exceptions thrown from your **[Rails](https://www.bugsnag.com/platforms/rails)**, **Sinatra**, **Rack** or **plain Ruby** app. Any uncaught exceptions will trigger a notification to be sent to your Bugsnag project.
@@ -10,6 +10,7 @@ The Bugsnag exception reporter for Ruby gives you instant notification of except
1010
* Report handled exceptions
1111
* Attach user information to determine how many people are affected by a crash
1212
* Send customized diagnostic data
13+
* Track events that occur leading up to a crash
1314

1415
## Getting started
1516

@@ -33,7 +34,7 @@ The Bugsnag exception reporter for Ruby gives you instant notification of except
3334
* [Rake](https://docs.bugsnag.com/platforms/ruby/rake/configuration-options)
3435
* [Sidekiq](https://docs.bugsnag.com/platforms/ruby/sidekiq/configuration-options)
3536
* [Other Ruby apps](https://docs.bugsnag.com/platforms/ruby/other/configuration-options)
36-
* Check out some [example apps integrated with Bugsnag](https://github.com/bugsnag/bugsnag-example-apps/tree/master/apps/ruby) using Rails, Sinatra, Padrino, and more.
37+
* Check out some [example apps integrated with Bugsnag](https://github.com/bugsnag/bugsnag-ruby/tree/master/example) using Rails, Sinatra, Padrino, and more.
3738
* [Search open and closed issues](https://github.com/bugsnag/bugsnag-ruby/issues?utf8=✓&q=is%3Aissue) for similar problems
3839
* [Report a bug or request a feature](https://github.com/bugsnag/bugsnag-ruby/issues/new)
3940

UPGRADING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,25 @@ guide](https://docs.bugsnag.com/api/deploy-tracking/capistrano/) for more inform
6767
+ Bugsnag.configuration.logger.warn "Warn message"
6868
+ Bugsnag.configuration.logger.debug "Debug message"
6969
```
70+
71+
#### Middleware
72+
73+
* If you previously accessed objects directly through `notification.exceptions`, this has now moved to `notification.raw_exceptions`
74+
75+
```diff
76+
class ExampleMiddleware
77+
def initialize(bugsnag)
78+
@bugsnag = bugsnag
79+
end
80+
81+
def call(report)
82+
- exception = report.exceptions.first
83+
+ exception = report.raw_exceptions.first
84+
status = report.response.status
85+
86+
# do stuff
87+
88+
@bugsnag.call(report)
89+
end
90+
end
91+
```

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.10.0
1+
6.12.0

example/rails-51/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ../..
33
specs:
4-
bugsnag (6.6.4)
4+
bugsnag (6.11.1)
55
concurrent-ruby (~> 1.0)
66

77
GEM
@@ -101,7 +101,7 @@ GEM
101101
pg (1.0.0)
102102
public_suffix (3.0.2)
103103
puma (3.11.2)
104-
que (0.12.1)
104+
que (0.14.3)
105105
rack (2.0.4)
106106
rack-protection (2.0.1)
107107
rack
@@ -234,4 +234,4 @@ DEPENDENCIES
234234
web-console (>= 3.3.0)
235235

236236
BUNDLED WITH
237-
1.16.0
237+
2.0.2

example/rails-51/README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,37 @@ Navigate to the `/sidekiq` page and run any of the examples using the links prov
5656

5757
The worker code can be found in `app/workers/sidekiq_workers.rb`.
5858

59+
To process the jobs, run Sidekiq using the following command:
60+
61+
```shell
62+
bundle exec sidekiq
63+
```
64+
5965
## Que in Rails
6066

6167
Que requires a database backend in order to queue jobs. By default this database will be PostgreSQL although this can be changed via options as detailed in [the que documentation](https://github.com/chanks/que).
6268

63-
Once PostgreSQL is set up as detailed using [the PostgreSQL documentation](https://www.postgresql.org/docs/), ensure Que can connect correctly before running and of the following examples. You may need to configure your connection in the `config/database.yml` file.
69+
Once PostgreSQL is set up as detailed using [the PostgreSQL documentation](https://www.postgresql.org/docs/), ensure Que can connect correctly before running any of the following examples which reference a `quedb` that can be created with the following command:
70+
71+
```shell
72+
createdb quedb
73+
```
74+
75+
You can configure your connection in the `config/database.yml` file.
6476

6577
### Configuration
6678

79+
All tasks run with Que should set the rails environment to `que`. This ensures that the correct database and connection settings are used.
80+
Do this by prepending `RAILS_ENV=que` before each command, or run:
81+
82+
```shell
83+
export RAILS_ENV=que
84+
```
85+
6786
Ensure that the initial Que setup is complete by running:
6887

6988
```shell
70-
bundle exec bin/rake que:install
89+
bundle exec bin/rails generate que:install
7190
```
7291

7392
and

example/rails-51/config/database.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55
# gem 'sqlite3'
66
#
77
default: &default
8+
adapter: sqlite3
9+
pool: 5
10+
timeout: 5000
11+
12+
que:
813
adapter: postgresql
914
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
1015
host: localhost
1116
timeout: 5000
17+
database: quedb
1218

1319
development:
1420
<<: *default

0 commit comments

Comments
 (0)