Mailinglist Archive: opensuse-buildservice (256 mails)

< Previous Next >
[opensuse-buildservice] Re: [PATCH] [api+webui] revert exception notification change, this requires multiple new packages, replacing the 11.4 ones and is not backward compatible. Let's do this after 2.3 is released.
On 08/16/2011 12:46 PM, OBS build-service wrote:
From: Adrian Schröter <adrian@xxxxxxx>

But haven't we branched already? This happened in the master branch, so
it could be OK, no?


This reverts commit 6277c2669fe5b9cbc81f4e7b7081e9bd6082ebc1.
---
src/api/app/controllers/application_controller.rb | 8 +++-----
src/api/config/environment.rb | 4 ++--
.../app/controllers/application_controller.rb | 14 ++++++--------
src/webui/config/environment.rb | 8 ++++----
4 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/src/api/app/controllers/application_controller.rb
b/src/api/app/controllers/application_controller.rb
index 005362a..b3cc3b4 100644
--- a/src/api/app/controllers/application_controller.rb
+++ b/src/api/app/controllers/application_controller.rb
@@ -33,8 +33,6 @@ end

class ApplicationController < ActionController::Base

- include ExceptionNotification::Notifiable
-
# Do never use a layout here since that has impact on every controller
layout nil
# session :disabled => true
@@ -564,9 +562,9 @@ class ApplicationController < ActionController::Base
#Note: This is a SUSE-sepecific debugging extension that saves the
last
# exception's scope. This method needs a patched Ruby
interpreter.
if defined?(set_trace_func_for_raise)
-
ExceptionNotification::Notifier.deliver_exception_notification(exception,
self, strip_sensitive_data_from(request), $exception_scope)
+ ExceptionNotifier.deliver_exception_notification(exception, self,
strip_sensitive_data_from(request), $exception_scope)
else
-
ExceptionNotification::Notifier.deliver_exception_notification(exception,
self, strip_sensitive_data_from(request), {})
+ ExceptionNotifier.deliver_exception_notification(exception, self,
strip_sensitive_data_from(request), {})
end
end
render_error :message => "Uncaught exception: #{exception.message}",
:status => 400
@@ -575,7 +573,7 @@ class ApplicationController < ActionController::Base

def send_exception_mail?
return false if Rails.env.test?
- return false unless ExceptionNotification::Notifier.exception_recipients
+ return false unless ExceptionNotifier.exception_recipients
return !local_request? && !Rails.env.development?
end

diff --git a/src/api/config/environment.rb b/src/api/config/environment.rb
index 6832a32..20870c5 100644
--- a/src/api/config/environment.rb
+++ b/src/api/config/environment.rb
@@ -80,8 +80,8 @@ Rails::Initializer.run do |config|

# See Rails::Configuration for more options
config.after_initialize do
- ExceptionNotification::Notifier.exception_recipients =
CONFIG["exception_recipients"]
- ExceptionNotification::Notifier.sender_address =
CONFIG["exception_sender"]
+ ExceptionNotifier.exception_recipients = CONFIG["exception_recipients"]
+ ExceptionNotifier.sender_address = CONFIG["exception_sender"]
end unless Rails.env.test?
end

diff --git a/src/webui/app/controllers/application_controller.rb
b/src/webui/app/controllers/application_controller.rb
index 8816269..04eb9b4 100644
--- a/src/webui/app/controllers/application_controller.rb
+++ b/src/webui/app/controllers/application_controller.rb
@@ -21,8 +21,6 @@ end

class ApplicationController < ActionController::Base

- include ExceptionNotification::Notifiable
-
Rails.cache.set_domain if Rails.cache.respond_to?('set_domain');

before_filter :instantiate_controller_and_action_names
@@ -219,7 +217,7 @@ class ApplicationController < ActionController::Base
elsif code == "unconfirmed_user"
render :template => "user/unconfirmed" and return
else
-
#ExceptionNotification::Notifier.deliver_exception_notification(exception,
self, strip_sensitive_data_from(request), {}) if send_exception_mail?
+ #ExceptionNotifier.deliver_exception_notification(exception, self,
strip_sensitive_data_from(request), {}) if send_exception_mail?
if @user
render_error :status => 403, :message => message
else
@@ -227,7 +225,7 @@ class ApplicationController < ActionController::Base
end
end
when ActiveXML::Transport::UnauthorizedError
-
#ExceptionNotification::Notifier.deliver_exception_notification(exception,
self, strip_sensitive_data_from(request), {}) if send_exception_mail?
+ #ExceptionNotifier.deliver_exception_notification(exception, self,
strip_sensitive_data_from(request), {}) if send_exception_mail?
render_error :status => 401, :message => 'Unauthorized access, please
login'
when ActionController::InvalidAuthenticityToken
render_error :status => 401, :message => 'Invalid authenticity token'
@@ -236,7 +234,7 @@ class ApplicationController < ActionController::Base
when Timeout::Error
render :template => "timeout" and return
when ValidationError
-
ExceptionNotification::Notifier.deliver_exception_notification(exception,
self, strip_sensitive_data_from(request), {}) if send_exception_mail?
+ ExceptionNotifier.deliver_exception_notification(exception, self,
strip_sensitive_data_from(request), {}) if send_exception_mail?
render :template => "xml_errors", :locals => { :oldbody =>
exception.xml, :errors => exception.errors }, :status => 400
when MissingParameterError
render_error :status => 400, :message => message
@@ -250,9 +248,9 @@ class ApplicationController < ActionController::Base
#Note: This is a SUSE-sepecific debugging extension that saves the
last
# exception's scope. This method needs a patched Ruby
interpreter.
if defined?(set_trace_func_for_raise)
-
ExceptionNotification::Notifier.deliver_exception_notification(exception,
self, strip_sensitive_data_from(request), $exception_scope)
+ ExceptionNotifier.deliver_exception_notification(exception, self,
strip_sensitive_data_from(request), $exception_scope)
else
-
ExceptionNotification::Notifier.deliver_exception_notification(exception,
self, strip_sensitive_data_from(request), {})
+ ExceptionNotifier.deliver_exception_notification(exception, self,
strip_sensitive_data_from(request), {})
end
end
render_error :status => 400, :code => code, :message => message,
@@ -311,7 +309,7 @@ class ApplicationController < ActionController::Base
end

def send_exception_mail?
- return !local_request? && !Rails.env.development? &&
ExceptionNotification::Notifier.exception_recipients &&
ExceptionNotification::Notifier.exception_recipients.length > 0
+ return !local_request? && !Rails.env.development? &&
ExceptionNotifier.exception_recipients &&
ExceptionNotifier.exception_recipients.length > 0
end

def instantiate_controller_and_action_names
diff --git a/src/webui/config/environment.rb b/src/webui/config/environment.rb
index 2379c67..dbf061c 100644
--- a/src/webui/config/environment.rb
+++ b/src/webui/config/environment.rb
@@ -44,7 +44,7 @@ init = Rails::Initializer.run do |config|

config.gem 'daemons'
config.gem 'delayed_job'
- config.gem 'exception_notification'
+ config.gem 'exception_notification', :version => '<= 1.1'
config.gem 'erubis'
config.gem 'rails_xss'
config.gem 'nokogiri'
@@ -74,9 +74,9 @@ ActionController::Base.relative_url_root =
CONFIG['relative_url_root'] if CONFIG
require 'ostruct'

# Exception notifier plugin configuration
-ExceptionNotification::Notifier.sender_address = %("OBS Webclient"
<admin@xxxxxxxxxxxx>)
-ExceptionNotification::Notifier.email_prefix = "[OBS web error] "
-ExceptionNotification::Notifier.exception_recipients =
CONFIG['exception_recipients']
+ExceptionNotifier.sender_address = %("OBS Webclient" <admin@xxxxxxxxxxxx>)
+ExceptionNotifier.email_prefix = "[OBS web error] "
+ExceptionNotifier.exception_recipients = CONFIG['exception_recipients']

if CONFIG['hide_private_options'] == true
HIDE_PRIVATE_OPTIONS = true


--
With kind regards,
Sascha Peilicke
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nuernberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer HRB 16746 (AG Nürnberg)

< Previous Next >
Follow Ups