Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-exception_notification for
openSUSE:Factory checked in at 2022-02-07 23:37:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-exception_notification (Old)
and /work/SRC/openSUSE:Factory/.rubygem-exception_notification.new.1898
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-exception_notification"
Mon Feb 7 23:37:36 2022 rev:22 rq:949069 version:4.5.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-exception_notification/rubygem-exception_notification.changes
2020-07-14 08:06:22.639166602 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-exception_notification.new.1898/rubygem-exception_notification.changes
2022-02-07 23:38:37.190227090 +0100
@@ -1,0 +2,20 @@
+Tue Jan 25 06:52:13 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 4.5.0
+ see installed CHANGELOG.rdoc
+
+ == 4.5.0
+
+ * enhancements
+ * Added Rails 7 compatibility (by @fwininger)
+ * Added support for the optional `data` attribute to the SNS notifier
(@TomK32)
+ * Addressed a deprecation warning for `module_parent_name` which was
thrown for users
+ using Rails > 6.x (@quorak)
+ * Restored the hash separator for `controller#action` in the email
notifier (@garethrees)
+
+ * removals
+ * Dropped support for Tinder (gem is no longer maintained) (by @fwininger)
+ * Dropped support for Ruby on Rails versions below 5.2
+
+
+-------------------------------------------------------------------
Old:
----
exception_notification-4.4.3.gem
New:
----
exception_notification-4.5.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-exception_notification.spec ++++++
--- /var/tmp/diff_new_pack.SxYcPn/_old 2022-02-07 23:38:37.726223423 +0100
+++ /var/tmp/diff_new_pack.SxYcPn/_new 2022-02-07 23:38:37.734223368 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-exception_notification
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
#
Name: rubygem-exception_notification
-Version: 4.4.3
+Version: 4.5.0
Release: 0
%define mod_name exception_notification
%define mod_full_name %{mod_name}-%{version}
++++++ exception_notification-4.4.3.gem -> exception_notification-4.5.0.gem
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Appraisals new/Appraisals
--- old/Appraisals 2020-06-29 18:19:58.000000000 +0200
+++ new/Appraisals 2022-01-20 12:18:55.000000000 +0100
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-rails_versions = ['~> 4.0.5', '~> 4.1.1', '~> 4.2.0', '~> 5.0.0', '~> 5.1.0',
'~> 5.2.0', '~> 6.0.0']
+rails_versions = ['~> 5.2.0', '~> 6.0.0', '~> 6.1.0', '~> 7.0.0']
rails_versions.each do |rails_version|
appraise "rails#{rails_version.slice(/\d+\.\d+/).tr('.', '_')}" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.rdoc new/CHANGELOG.rdoc
--- old/CHANGELOG.rdoc 2020-06-29 18:19:58.000000000 +0200
+++ new/CHANGELOG.rdoc 2022-01-20 12:18:55.000000000 +0100
@@ -1,3 +1,16 @@
+== 4.5.0
+
+* enhancements
+ * Added Rails 7 compatibility (by @fwininger)
+ * Added support for the optional `data` attribute to the SNS notifier
(@TomK32)
+ * Addressed a deprecation warning for `module_parent_name` which was thrown
for users
+ using Rails > 6.x (@quorak)
+ * Restored the hash separator for `controller#action` in the email notifier
(@garethrees)
+
+* removals
+ * Dropped support for Tinder (gem is no longer maintained) (by @fwininger)
+ * Dropped support for Ruby on Rails versions below 5.2
+
== 4.4.3
* big fixes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2020-06-29 18:19:58.000000000 +0200
+++ new/README.md 2022-01-20 12:18:55.000000000 +0100
@@ -1,7 +1,7 @@
# Exception Notification
[](https://badge.fury.io/rb/exception_notification)
-[](https://travis-ci.org/smartinez87/exception_notification)
+[](https://github.com/smartinez87/exception_notification/actions/workflows/main.yml)
[](https://coveralls.io/github/smartinez87/exception_notification?branch=master)
[](https://codeclimate.com/github/smartinez87/exception_notification/maintainability)
@@ -9,7 +9,7 @@
---
-The Exception Notification gem provides a set of [notifiers](#notifiers) for
sending notifications when errors occur in a Rack/Rails application. The
built-in notifiers can deliver notifications by
[email](docs/notifiers/email.md), [Campfire](docs/notifiers/campfire.md),
[HipChat](docs/notifiers/hipchat.md), [Slack](docs/notifiers/slack.md),
[Mattermost](docs/notifiers/mattermost.md), [Teams](docs/notifiers/teams.md),
[IRC](docs/notifiers/irc.md), [Amazon SNS](docs/notifiers/sns.md), [Google
Chat](docs/notifiers/google_chat.md), [Datadog](docs/notifiers/datadog.md) or
via custom [WebHooks](docs/notifiers/webhook.md).
+The Exception Notification gem provides a set of [notifiers](#notifiers) for
sending notifications when errors occur in a Rack/Rails application. The
built-in notifiers can deliver notifications by
[email](docs/notifiers/email.md), [HipChat](docs/notifiers/hipchat.md),
[Slack](docs/notifiers/slack.md), [Mattermost](docs/notifiers/mattermost.md),
[Teams](docs/notifiers/teams.md), [IRC](docs/notifiers/irc.md), [Amazon
SNS](docs/notifiers/sns.md), [Google Chat](docs/notifiers/google_chat.md),
[Datadog](docs/notifiers/datadog.md) or via custom
[WebHooks](docs/notifiers/webhook.md).
There's a great [Railscast about Exception
Notification](http://railscasts.com/episodes/104-exception-notifications-revised)
you can see that may help you getting started.
@@ -17,8 +17,8 @@
## Requirements
-* Ruby 2.3 or greater
-* Rails 4.0 or greater, Sinatra or another Rack-based application.
+* Ruby 2.5 or greater
+* Rails 5.2 or greater, Sinatra or another Rack-based application.
## Getting Started
@@ -35,7 +35,6 @@
```ruby
Rails.application.config.middleware.use ExceptionNotification::Rack,
email: {
- deliver_with: :deliver, # Rails >= 4.2.1 do not need this option since it
defaults to :deliver_now
email_prefix: '[PREFIX] ',
sender_address: %{"notifier" <[email protected]>},
exception_recipients: %w{[email protected]}
@@ -84,7 +83,6 @@
ExceptionNotification relies on notifiers to deliver notifications when errors
occur in your applications. By default, 8 notifiers are available:
-* [Campfire notifier](docs/notifiers/campfire.md)
* [Datadog notifier](docs/notifiers/datadog.md)
* [Email notifier](docs/notifiers/email.md)
* [HipChat notifier](docs/notifiers/hipchat.md)
@@ -271,7 +269,6 @@
end
```
-
## Extras
### Rails
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/exception_notification.gemspec
new/exception_notification.gemspec
--- old/exception_notification.gemspec 2020-06-29 18:19:58.000000000 +0200
+++ new/exception_notification.gemspec 2022-01-20 12:18:55.000000000 +0100
@@ -6,7 +6,7 @@
s.name = 'exception_notification'
s.version = ExceptionNotification::VERSION
s.authors = ['Jamis Buck', 'Josh Peek']
- s.date = '2020-06-29'
+ s.date = '2022-01-20'
s.summary = 'Exception notification for Rails apps'
s.homepage = 'https://smartinez87.github.io/exception_notification/'
s.email = '[email protected]'
@@ -20,8 +20,8 @@
s.test_files = `git ls-files -- test`.split("\n")
s.require_path = 'lib'
- s.add_dependency('actionmailer', '>= 4.0', '< 7')
- s.add_dependency('activesupport', '>= 4.0', '< 7')
+ s.add_dependency('actionmailer', '>= 5.2', '< 8')
+ s.add_dependency('activesupport', '>= 5.2', '< 8')
s.add_development_dependency 'appraisal', '~> 2.2.0'
s.add_development_dependency 'aws-sdk-sns', '~> 1'
@@ -32,11 +32,11 @@
s.add_development_dependency 'httparty', '~> 0.10.2'
s.add_development_dependency 'mocha', '>= 0.13.0'
s.add_development_dependency 'mock_redis', '~> 0.19.0'
- s.add_development_dependency 'rails', '>= 4.0', '< 7'
+ s.add_development_dependency 'net-smtp'
+ s.add_development_dependency 'rails', '>= 5.2', '< 8'
s.add_development_dependency 'resque', '~> 1.8.0'
s.add_development_dependency 'rubocop', '0.78.0'
s.add_development_dependency 'sidekiq', '>= 5.0.4'
s.add_development_dependency 'slack-notifier', '>= 1.0.0'
s.add_development_dependency 'timecop', '~> 0.9.0'
- s.add_development_dependency 'tinder', '~> 1.8'
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/rails4_0.gemfile
new/gemfiles/rails4_0.gemfile
--- old/gemfiles/rails4_0.gemfile 2020-06-29 18:19:58.000000000 +0200
+++ new/gemfiles/rails4_0.gemfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-# This file was generated by Appraisal
-
-source "https://rubygems.org"
-
-gem "rails", "~> 4.0.5"
-
-gemspec path: "../"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/rails4_1.gemfile
new/gemfiles/rails4_1.gemfile
--- old/gemfiles/rails4_1.gemfile 2020-06-29 18:19:58.000000000 +0200
+++ new/gemfiles/rails4_1.gemfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-# This file was generated by Appraisal
-
-source "https://rubygems.org"
-
-gem "rails", "~> 4.1.1"
-
-gemspec path: "../"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/rails4_2.gemfile
new/gemfiles/rails4_2.gemfile
--- old/gemfiles/rails4_2.gemfile 2020-06-29 18:19:58.000000000 +0200
+++ new/gemfiles/rails4_2.gemfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-# This file was generated by Appraisal
-
-source "https://rubygems.org"
-
-gem "rails", "~> 4.2.0"
-
-gemspec path: "../"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/rails5_0.gemfile
new/gemfiles/rails5_0.gemfile
--- old/gemfiles/rails5_0.gemfile 2020-06-29 18:19:58.000000000 +0200
+++ new/gemfiles/rails5_0.gemfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-# This file was generated by Appraisal
-
-source "https://rubygems.org"
-
-gem "rails", "~> 5.0.0"
-
-gemspec path: "../"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/rails5_1.gemfile
new/gemfiles/rails5_1.gemfile
--- old/gemfiles/rails5_1.gemfile 2020-06-29 18:19:58.000000000 +0200
+++ new/gemfiles/rails5_1.gemfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-# This file was generated by Appraisal
-
-source "https://rubygems.org"
-
-gem "rails", "~> 5.1.0"
-
-gemspec path: "../"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/rails6_1.gemfile
new/gemfiles/rails6_1.gemfile
--- old/gemfiles/rails6_1.gemfile 1970-01-01 01:00:00.000000000 +0100
+++ new/gemfiles/rails6_1.gemfile 2022-01-20 12:18:55.000000000 +0100
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "https://rubygems.org"
+
+gem "rails", "~> 6.1.0"
+
+gemspec path: "../"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gemfiles/rails7_0.gemfile
new/gemfiles/rails7_0.gemfile
--- old/gemfiles/rails7_0.gemfile 1970-01-01 01:00:00.000000000 +0100
+++ new/gemfiles/rails7_0.gemfile 2022-01-20 12:18:55.000000000 +0100
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "https://rubygems.org"
+
+gem "rails", "~> 7.0.0"
+
+gemspec path: "../"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/exception_notification/version.rb
new/lib/exception_notification/version.rb
--- old/lib/exception_notification/version.rb 2020-06-29 18:19:58.000000000
+0200
+++ new/lib/exception_notification/version.rb 2022-01-20 12:18:55.000000000
+0100
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module ExceptionNotification
- VERSION = '4.4.3'
+ VERSION = '4.5.0'
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/exception_notifier/campfire_notifier.rb
new/lib/exception_notifier/campfire_notifier.rb
--- old/lib/exception_notifier/campfire_notifier.rb 2020-06-29
18:19:58.000000000 +0200
+++ new/lib/exception_notifier/campfire_notifier.rb 1970-01-01
01:00:00.000000000 +0100
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-module ExceptionNotifier
- class CampfireNotifier < BaseNotifier
- attr_accessor :subdomain
- attr_accessor :token
- attr_accessor :room
-
- def initialize(options)
- super
- begin
- subdomain = options.delete(:subdomain)
- room_name = options.delete(:room_name)
- @campfire = Tinder::Campfire.new subdomain, options
- @room = @campfire.find_room_by_name room_name
- rescue StandardError
- @campfire = @room = nil
- end
- end
-
- def call(exception, options = {})
- return unless active?
-
- message = if options[:accumulated_errors_count].to_i > 1
- "The exception occurred
#{options[:accumulated_errors_count]} times: '#{exception.message}'"
- else
- "A new exception occurred: '#{exception.message}'"
- end
- message += " on '#{exception.backtrace.first}'" if exception.backtrace
- send_notice(exception, options, message) do |msg, _|
- @room.paste msg
- end
- end
-
- private
-
- def active?
- [email protected]?
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/exception_notifier/email_notifier.rb
new/lib/exception_notifier/email_notifier.rb
--- old/lib/exception_notifier/email_notifier.rb 2020-06-29
18:19:58.000000000 +0200
+++ new/lib/exception_notifier/email_notifier.rb 2022-01-20
12:18:55.000000000 +0100
@@ -76,7 +76,7 @@
def compose_subject
subject = @options[:email_prefix].to_s.dup
subject << "(#{@options[:accumulated_errors_count]} times)" if
@options[:accumulated_errors_count].to_i > 1
- subject << "#{@kontroller.controller_name}
#{@kontroller.action_name}" if include_controller?
+ subject <<
"#{@kontroller.controller_name}##{@kontroller.action_name}" if
include_controller?
subject << " (#{@exception.class})"
subject << " #{@exception.message.inspect}" if
@options[:verbose_subject]
subject = EmailNotifier.normalize_digits(subject) if
@options[:normalize_subject]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/exception_notifier/modules/error_grouping.rb
new/lib/exception_notifier/modules/error_grouping.rb
--- old/lib/exception_notifier/modules/error_grouping.rb 2020-06-29
18:19:58.000000000 +0200
+++ new/lib/exception_notifier/modules/error_grouping.rb 2022-01-20
12:18:55.000000000 +0100
@@ -1,5 +1,6 @@
# frozen_string_literal: true
+require 'active_support'
require 'active_support/core_ext/numeric/time'
require 'active_support/concern'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/exception_notifier/modules/formatter.rb
new/lib/exception_notifier/modules/formatter.rb
--- old/lib/exception_notifier/modules/formatter.rb 2020-06-29
18:19:58.000000000 +0200
+++ new/lib/exception_notifier/modules/formatter.rb 2022-01-20
12:18:55.000000000 +0100
@@ -111,7 +111,11 @@
def rails_app_name
return unless defined?(::Rails) && ::Rails.respond_to?(:application)
- Rails.application.class.parent_name.underscore
+ if Rails::VERSION::MAJOR >= 6
+ Rails.application.class.module_parent_name.underscore
+ else
+ Rails.application.class.parent_name.underscore
+ end
end
def controller
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/exception_notifier/sns_notifier.rb
new/lib/exception_notifier/sns_notifier.rb
--- old/lib/exception_notifier/sns_notifier.rb 2020-06-29 18:19:58.000000000
+0200
+++ new/lib/exception_notifier/sns_notifier.rb 2022-01-20 12:18:55.000000000
+0100
@@ -45,10 +45,12 @@
if options[:env].nil?
text = "#{exception_name} occured in background\n"
+ data = options[:data] || {}
else
env = options[:env]
kontroller = env['action_controller.instance']
+ data = (env['exception_notifier.exception_data'] ||
{}).merge(options[:data] || {})
request = "#{env['REQUEST_METHOD']} <#{env['REQUEST_URI']}>"
text = "#{exception_name} occurred while #{request}"
@@ -57,6 +59,7 @@
text += "Exception: #{exception.message}\n"
text += "Hostname: #{Socket.gethostname}\n"
+ text += "Data: #{data}\n"
return unless exception.backtrace
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/exception_notifier.rb
new/lib/exception_notifier.rb
--- old/lib/exception_notifier.rb 2020-06-29 18:19:58.000000000 +0200
+++ new/lib/exception_notifier.rb 2022-01-20 12:18:55.000000000 +0100
@@ -14,7 +14,6 @@
autoload :Notifier, 'exception_notifier/notifier'
autoload :EmailNotifier, 'exception_notifier/email_notifier'
- autoload :CampfireNotifier, 'exception_notifier/campfire_notifier'
autoload :HipchatNotifier, 'exception_notifier/hipchat_notifier'
autoload :WebhookNotifier, 'exception_notifier/webhook_notifier'
autoload :IrcNotifier, 'exception_notifier/irc_notifier'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2020-06-29 18:19:58.000000000 +0200
+++ new/metadata 2022-01-20 12:18:55.000000000 +0100
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: exception_notification
version: !ruby/object:Gem::Version
- version: 4.4.3
+ version: 4.5.0
platform: ruby
authors:
- Jamis Buck
@@ -9,7 +9,7 @@
autorequire:
bindir: bin
cert_chain: []
-date: 2020-06-29 00:00:00.000000000 Z
+date: 2022-01-20 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: actionmailer
@@ -17,40 +17,40 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '4.0'
+ version: '5.2'
- - "<"
- !ruby/object:Gem::Version
- version: '7'
+ version: '8'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '4.0'
+ version: '5.2'
- - "<"
- !ruby/object:Gem::Version
- version: '7'
+ version: '8'
- !ruby/object:Gem::Dependency
name: activesupport
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '4.0'
+ version: '5.2'
- - "<"
- !ruby/object:Gem::Version
- version: '7'
+ version: '8'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '4.0'
+ version: '5.2'
- - "<"
- !ruby/object:Gem::Version
- version: '7'
+ version: '8'
- !ruby/object:Gem::Dependency
name: appraisal
requirement: !ruby/object:Gem::Requirement
@@ -178,25 +178,39 @@
- !ruby/object:Gem::Version
version: 0.19.0
- !ruby/object:Gem::Dependency
+ name: net-smtp
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ version: '0'
+ type: :development
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ version: '0'
+- !ruby/object:Gem::Dependency
name: rails
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '4.0'
+ version: '5.2'
- - "<"
- !ruby/object:Gem::Version
- version: '7'
+ version: '8'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '4.0'
+ version: '5.2'
- - "<"
- !ruby/object:Gem::Version
- version: '7'
+ version: '8'
- !ruby/object:Gem::Dependency
name: resque
requirement: !ruby/object:Gem::Requirement
@@ -267,20 +281,6 @@
- - "~>"
- !ruby/object:Gem::Version
version: 0.9.0
-- !ruby/object:Gem::Dependency
- name: tinder
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '1.8'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '1.8'
description:
email: [email protected]
executables: []
@@ -315,13 +315,10 @@
- examples/sinatra/config.ru
- examples/sinatra/sinatra_app.rb
- exception_notification.gemspec
-- gemfiles/rails4_0.gemfile
-- gemfiles/rails4_1.gemfile
-- gemfiles/rails4_2.gemfile
-- gemfiles/rails5_0.gemfile
-- gemfiles/rails5_1.gemfile
- gemfiles/rails5_2.gemfile
- gemfiles/rails6_0.gemfile
+- gemfiles/rails6_1.gemfile
+- gemfiles/rails7_0.gemfile
- lib/exception_notification.rb
- lib/exception_notification/rack.rb
- lib/exception_notification/rails.rb
@@ -330,7 +327,6 @@
- lib/exception_notification/version.rb
- lib/exception_notifier.rb
- lib/exception_notifier/base_notifier.rb
-- lib/exception_notifier/campfire_notifier.rb
- lib/exception_notifier/datadog_notifier.rb
- lib/exception_notifier/email_notifier.rb
- lib/exception_notifier/google_chat_notifier.rb
@@ -365,7 +361,6 @@
- lib/generators/exception_notification/templates/exception_notification.rb.erb
- test/exception_notification/rack_test.rb
- test/exception_notification/resque_test.rb
-- test/exception_notifier/campfire_notifier_test.rb
- test/exception_notifier/datadog_notifier_test.rb
- test/exception_notifier/email_notifier_test.rb
- test/exception_notifier/google_chat_notifier_test.rb
@@ -405,14 +400,13 @@
- !ruby/object:Gem::Version
version: 1.8.11
requirements: []
-rubygems_version: 3.1.2
+rubygems_version: 3.2.32
signing_key:
specification_version: 4
summary: Exception notification for Rails apps
test_files:
- test/exception_notification/rack_test.rb
- test/exception_notification/resque_test.rb
-- test/exception_notifier/campfire_notifier_test.rb
- test/exception_notifier/datadog_notifier_test.rb
- test/exception_notifier/email_notifier_test.rb
- test/exception_notifier/google_chat_notifier_test.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/exception_notifier/campfire_notifier_test.rb
new/test/exception_notifier/campfire_notifier_test.rb
--- old/test/exception_notifier/campfire_notifier_test.rb 2020-06-29
18:19:58.000000000 +0200
+++ new/test/exception_notifier/campfire_notifier_test.rb 1970-01-01
01:00:00.000000000 +0100
@@ -1,127 +0,0 @@
-# frozen_string_literal: true
-
-require 'test_helper'
-
-# silence_warnings trick around require can be removed once
-# https://github.com/collectiveidea/tinder/pull/77
-# gets merged and released
-silence_warnings do
- require 'tinder'
-end
-
-class CampfireNotifierTest < ActiveSupport::TestCase
- test 'should send campfire notification if properly configured' do
- ExceptionNotifier::CampfireNotifier.stubs(:new).returns(Object.new)
- campfire = ExceptionNotifier::CampfireNotifier.new(subdomain: 'test',
token: 'test_token', room_name: 'test_room')
- campfire.stubs(:call).returns(fake_notification)
- notif = campfire.call(fake_exception)
-
- assert !notif[:message].empty?
- assert_equal notif[:message][:type], 'PasteMessage'
- assert_includes notif[:message][:body], 'A new exception occurred:'
- assert_includes notif[:message][:body], 'divided by 0'
- assert_includes notif[:message][:body],
'/exception_notification/test/campfire_test.rb:45'
- end
-
- test 'should send campfire notification without backtrace info if properly
configured' do
- ExceptionNotifier::CampfireNotifier.stubs(:new).returns(Object.new)
- campfire = ExceptionNotifier::CampfireNotifier.new(subdomain: 'test',
token: 'test_token', room_name: 'test_room')
- campfire.stubs(:call).returns(fake_notification_without_backtrace)
- notif = campfire.call(fake_exception_without_backtrace)
-
- assert !notif[:message].empty?
- assert_equal notif[:message][:type], 'PasteMessage'
- assert_includes notif[:message][:body], 'A new exception occurred:'
- assert_includes notif[:message][:body], 'my custom error'
- end
-
- test 'should not send campfire notification if badly configured' do
- wrong_params = { subdomain: 'test', token: 'bad_token', room_name:
'test_room' }
- Tinder::Campfire.stubs(:new).with('test', token: 'bad_token').returns(nil)
- campfire = ExceptionNotifier::CampfireNotifier.new(wrong_params)
-
- assert_nil campfire.room
- assert_nil campfire.call(fake_exception)
- end
-
- test 'should not send campfire notification if config attr missing' do
- wrong_params = { subdomain: 'test', room_name: 'test_room' }
- Tinder::Campfire.stubs(:new).with('test', {}).returns(nil)
- campfire = ExceptionNotifier::CampfireNotifier.new(wrong_params)
-
- assert_nil campfire.room
- assert_nil campfire.call(fake_exception)
- end
-
- test 'should send the new exception message if no :accumulated_errors_count
option' do
- campfire = ExceptionNotifier::CampfireNotifier.new({})
- campfire.stubs(:active?).returns(true)
- campfire.expects(:send_notice).with { |_, _, message|
message.start_with?('A new exception occurred') }.once
- campfire.call(fake_exception)
- end
-
- test 'shoud send the exception message if :accumulated_errors_count option
greater than 1' do
- campfire = ExceptionNotifier::CampfireNotifier.new({})
- campfire.stubs(:active?).returns(true)
- campfire.expects(:send_notice).with { |_, _, message|
message.start_with?('The exception occurred 3 times:') }.once
- campfire.call(fake_exception, accumulated_errors_count: 3)
- end
-
- test 'should call pre/post_callback if specified' do
- pre_callback_called = 0
- post_callback_called = 0
- Tinder::Campfire.stubs(:new).returns(Object.new)
-
- campfire = ExceptionNotifier::CampfireNotifier.new(
- subdomain: 'test',
- token: 'test_token',
- room_name: 'test_room',
- pre_callback: proc { |_opts, _notifier, _backtrace, _message,
_message_opts|
- pre_callback_called += 1
- },
- post_callback: proc { |_opts, _notifier, _backtrace, _message,
_message_opts|
- post_callback_called += 1
- }
- )
- campfire.room = Object.new
- campfire.room.stubs(:paste).returns(fake_notification)
- campfire.call(fake_exception)
- assert_equal(1, pre_callback_called)
- assert_equal(1, post_callback_called)
- end
-
- private
-
- def fake_notification
- {
- message: {
- type: 'PasteMessage',
- body: fake_notification_body
- }
- }
- end
-
- def fake_notification_body
- "A new exception occurred: 'divided by 0' on " \
- "/Users/sebastian/exception_notification/test/campfire_test.rb:45:in `/'"
- end
-
- def fake_exception
- 5 / 0
- rescue StandardError => e
- e
- end
-
- def fake_notification_without_backtrace
- {
- message: {
- type: 'PasteMessage',
- body: "A new exception occurred: 'my custom error'"
- }
- }
- end
-
- def fake_exception_without_backtrace
- StandardError.new('my custom error')
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/exception_notifier/email_notifier_test.rb
new/test/exception_notifier/email_notifier_test.rb
--- old/test/exception_notifier/email_notifier_test.rb 2020-06-29
18:19:58.000000000 +0200
+++ new/test/exception_notifier/email_notifier_test.rb 2022-01-20
12:18:55.000000000 +0100
@@ -239,6 +239,7 @@
'action_dispatch.parameter_filter' => ['secret'],
'HTTPS' => 'on',
'action_controller.instance' => @controller,
+ 'rack.session.options' => {},
params: { id: 'foo', secret: 'secret' }
)
@@ -248,7 +249,7 @@
test 'sends mail with correct content' do
assert_equal %("Dummy Notifier" <[email protected]>),
@mail[:from].value
assert_equal %w[[email protected]], @mail.to
- assert_equal '[Dummy ERROR] home index (ZeroDivisionError) "divided by
0"', @mail.subject
+ assert_equal '[Dummy ERROR] home#index (ZeroDivisionError) "divided by
0"', @mail.subject
assert_equal 'foobar', @mail['X-Custom-Header'].value
assert_equal 'text/plain; charset=UTF-8', @mail.content_type
assert_equal [], @mail.attachments
@@ -319,7 +320,8 @@
* rack.request.query_hash : {"id"=>"foo",
"secret"=>"[FILTERED]"}
* rack.request.query_string : id=foo&secret=secret
* rack.run_once : false
- * rack.session : {}
+ * rack.session :
#{@test_env['rack.session']}
+ * rack.session.options :
#{@test_env['rack.session.options']}
* rack.url_scheme : http
* rack.version : #{Rack::VERSION}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/exception_notifier/sns_notifier_test.rb
new/test/exception_notifier/sns_notifier_test.rb
--- old/test/exception_notifier/sns_notifier_test.rb 2020-06-29
18:19:58.000000000 +0200
+++ new/test/exception_notifier/sns_notifier_test.rb 2022-01-20
12:18:55.000000000 +0100
@@ -66,6 +66,7 @@
message: "3 MyException occured in background\n" \
"Exception: undefined method 'method=' for Empty\n" \
"Hostname: example.com\n" \
+ "Data: {}\n" \
"Backtrace:\n#{fake_backtrace.join("\n")}\n",
subject: '[App Exception] - 3 MyException occurred'
)
@@ -85,6 +86,7 @@
"was processed by examples#index\n" \
"Exception: undefined method 'method=' for Empty\n" \
"Hostname: example.com\n" \
+ "Data: {}\n" \
"Backtrace:\n#{fake_backtrace.join("\n")}\n",
subject: '[App Exception] - A MyException occurred'
)
@@ -98,6 +100,59 @@
})
end
+ test 'should put data from env["exception_notifier.exception_data"] into
text' do
+ controller = mock('controller')
+ controller.stubs(:action_name).returns('index')
+ controller.stubs(:controller_name).returns('examples')
+
+ Aws::SNS::Client.any_instance.expects(:publish).with(
+ topic_arn: 'topicARN',
+ message: 'A MyException occurred while GET </examples> ' \
+ "was processed by examples#index\n" \
+ "Exception: undefined method 'method=' for Empty\n" \
+ "Hostname: example.com\n" \
+ "Data: {:current_user=>12}\n" \
+ "Backtrace:\n#{fake_backtrace.join("\n")}\n",
+ subject: '[App Exception] - A MyException occurred'
+ )
+
+ sns_notifier = ExceptionNotifier::SnsNotifier.new(@options)
+ sns_notifier.call(@exception,
+ env: {
+ 'REQUEST_METHOD' => 'GET',
+ 'REQUEST_URI' => '/examples',
+ 'action_controller.instance' => controller,
+ 'exception_notifier.exception_data' => { current_user:
12 }
+ })
+ end
+ test 'should put optional data into text' do
+ controller = mock('controller')
+ controller.stubs(:action_name).returns('index')
+ controller.stubs(:controller_name).returns('examples')
+
+ Aws::SNS::Client.any_instance.expects(:publish).with(
+ topic_arn: 'topicARN',
+ message: 'A MyException occurred while GET </examples> ' \
+ "was processed by examples#index\n" \
+ "Exception: undefined method 'method=' for Empty\n" \
+ "Hostname: example.com\n" \
+ "Data: {:current_user=>12}\n" \
+ "Backtrace:\n#{fake_backtrace.join("\n")}\n",
+ subject: '[App Exception] - A MyException occurred'
+ )
+
+ sns_notifier = ExceptionNotifier::SnsNotifier.new(@options)
+ sns_notifier.call(@exception,
+ env: {
+ 'REQUEST_METHOD' => 'GET',
+ 'REQUEST_URI' => '/examples',
+ 'action_controller.instance' => controller
+ },
+ data: {
+ current_user: 12
+ })
+ end
+
private
def fake_exception