Skip to content

Commit

Permalink
Release v6.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Mar 29, 2021
2 parents f9c5396 + 71762df commit 98b73dc
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 13 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
Changelog
=========

## v6.20.0 (29 March 2021)

### Enhancements

* Classify `ActionDispatch::Http::MimeNegotiation::InvalidType` as info severity level
| [#654](https://github.com/bugsnag/bugsnag-ruby/pull/654)

### Fixes

* Include `connection_id` in ActiveRecord breadcrumb metadata on new versons of Rails
| [#655](https://github.com/bugsnag/bugsnag-ruby/pull/655)
* Avoid crash when Mongo 1.12 or earlier is used
| [#652](https://github.com/bugsnag/bugsnag-ruby/pull/652)
| [isabanin](https://github.com/isabanin)

## 6.19.0 (6 January 2021)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.19.0
6.20.0
2 changes: 1 addition & 1 deletion features/fixtures/rails5/app/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0'
gem 'rails', '~> 5'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '< 1.4'
# Use Puma as the app server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@
# Require `belongs_to` associations by default. Previous versions had false.
Rails.application.config.active_record.belongs_to_required_by_default = true

# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport.halt_callback_chains_on_return_false = false

# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
Rails.application.config.ssl_options = { hsts: { subdomains: true } }
4 changes: 2 additions & 2 deletions features/fixtures/rails6/app/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.0.beta3'
gem 'rails', '~> 6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.3', '>= 1.3.6'
# Use Puma as the app server
Expand Down Expand Up @@ -55,4 +55,4 @@ gem 'bugsnag', path: '/bugsnag'

gem "mongoid"

gem "clearance", "~> 1.16"
gem "clearance", "~> 1.16"
8 changes: 5 additions & 3 deletions lib/bugsnag/integrations/mongo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def event_commands
end
end

##
# Add the subscriber to the global Mongo monitoring object
Mongo::Monitoring::Global.subscribe(Mongo::Monitoring::COMMAND, Bugsnag::MongoBreadcrumbSubscriber.new)
if defined?(Mongo::Monitoring)
##
# Add the subscriber to the global Mongo monitoring object
Mongo::Monitoring::Global.subscribe(Mongo::Monitoring::COMMAND, Bugsnag::MongoBreadcrumbSubscriber.new)
end
2 changes: 2 additions & 0 deletions lib/bugsnag/integrations/rails/rails_breadcrumbs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ module Bugsnag::Rails
:type => Bugsnag::Breadcrumbs::PROCESS_BREADCRUMB_TYPE,
:allowed_data => [
:name,
# :connection_id is no longer provided in Rails 6.1+ but we can get it
# from the :connection key of the event instead
:connection_id,
:cached
]
Expand Down
17 changes: 14 additions & 3 deletions lib/bugsnag/integrations/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,21 @@ def event_subscription(event)
filtered_data = data.slice(*event[:allowed_data])
filtered_data[:event_name] = event[:id]
filtered_data[:event_id] = event_id
if event[:id] == "sql.active_record" && data.key?(:binds)
binds = data[:binds].each_with_object({}) { |bind, output| output[bind.name] = '?' if defined?(bind.name) }
filtered_data[:binds] = JSON.dump(binds) unless binds.empty?

if event[:id] == "sql.active_record"
if data.key?(:binds)
binds = data[:binds].each_with_object({}) { |bind, output| output[bind.name] = '?' if defined?(bind.name) }
filtered_data[:binds] = JSON.dump(binds) unless binds.empty?
end

# Rails < 6.1 included connection_id in the event data, but now
# includes the connection object instead
if data.key?(:connection) && !data.key?(:connection_id)
# the connection ID is the object_id of the connection object
filtered_data[:connection_id] = data[:connection].object_id
end
end

Bugsnag.leave_breadcrumb(
event[:message],
filtered_data,
Expand Down
1 change: 1 addition & 0 deletions lib/bugsnag/middleware/classify_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ClassifyError
"ActionController::UnknownAction",
"ActionController::UnknownFormat",
"ActionController::UnknownHttpMethod",
"ActionDispatch::Http::MimeNegotiation::InvalidType",
"ActiveRecord::RecordNotFound",
"CGI::Session::CookieStore::TamperedWithCookie",
"Mongoid::Errors::DocumentNotFound",
Expand Down

0 comments on commit 98b73dc

Please sign in to comment.