OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
linting
ulferts9acf523f2f6d
diff --git a/modules/webhooks/app/controllers/webhooks/incoming/hooks_controller.rb b/modules/webhooks/app/controllers/webhooks/incoming/hooks_controller.rbindex 65191c2ea92..ee58a5139c8 100644--- a/modules/webhooks/app/controllers/webhooks/incoming/hooks_controller.rb+++ b/modules/webhooks/app/controllers/webhooks/incoming/hooks_controller.rb@@ -37,7 +37,7 @@ module Webhooksenddef handle_hook- hook = OpenProject::Webhooks.find(params.require 'hook_name')+ hook = OpenProject::Webhooks.find(params.require('hook_name'))if hookcode = hook.handle(request, params, find_current_user)diff --git a/modules/webhooks/lib/open_project/webhooks.rb b/modules/webhooks/lib/open_project/webhooks.rbindex 2bc5caf1711..63c4f5bd66d 100644--- a/modules/webhooks/lib/open_project/webhooks.rb+++ b/modules/webhooks/lib/open_project/webhooks.rb@@ -36,6 +36,7 @@ module OpenProject# Returns the newly created hookdef self.register_hook(name, &callback)raise "A hook named '#{name}' is already registered!" if find(name)+Rails.logger.warn "hook registered"hook = Hook.new(name, &callback)@@registered_hooks << hook@@ -47,11 +48,12 @@ module OpenProjectdef self.unregister_hook(name)hook = find(name)raise "A hook named '#{name}' was not registered!" unless find(name)+@@registered_hooks.delete hookenddef self.find(name)- @@registered_hooks.find {|h| h.name == name}+ @@registered_hooks.find { |h| h.name == name }endendenddiff --git a/modules/webhooks/lib/open_project/webhooks/event_resources/base.rb b/modules/webhooks/lib/open_project/webhooks/event_resources/base.rbindex 7a2abfcb8c6..1e51d7bc108 100644--- a/modules/webhooks/lib/open_project/webhooks/event_resources/base.rb+++ b/modules/webhooks/lib/open_project/webhooks/event_resources/base.rb@@ -1,19 +1,16 @@module OpenProject::Webhooks::EventResourcesclass Baseclass << self-### Subscribe for events on this resource schedule the respective# webhooks, if any.def subscribe!notification_names.each do |key|OpenProject::Notifications.subscribe(key) do |payload|- begin- Rails.logger.debug { "[Webhooks Plugin] Handling notification for '#{key}'." }- handle_notification(payload, key)- rescue => e- Rails.logger.error { "[Webhooks Plugin] Failed notification handling for '#{key}': #{e}" }- end+ Rails.logger.debug { "[Webhooks Plugin] Handling notification for '#{key}'." }+ handle_notification(payload, key)+ rescue StandardError => e+ Rails.logger.error { "[Webhooks Plugin] Failed notification handling for '#{key}': #{e}" }endendend@@ -36,7 +33,6 @@ module OpenProject::Webhooks::EventResources"#{prefix_key}:#{action}"end-def available_actionsraise NotImplementedErrorenddiff --git a/spec/models/journal_notification_mailer_spec.rb b/spec/models/journal_notification_mailer_spec.rbindex e604306f2a1..6154e4c0ff8 100644--- a/spec/models/journal_notification_mailer_spec.rb+++ b/spec/models/journal_notification_mailer_spec.rb@@ -35,12 +35,12 @@ describe JournalNotificationMailer domail_notification: 'all',member_in_project: project)end- let(:work_package) {+ let(:work_package) doFactoryBot.create(:work_package,project: project,author: user,type: project.types.first)- }+ endlet(:journal) { work_package.journals.last }let(:send_notification) { true }let(:notifications) { [] }@@ -81,12 +81,12 @@ describe JournalNotificationMailer docontext 'insufficient work package changes' dolet(:journal) { another_work_package.journals.last }- let(:another_work_package) {+ let(:another_work_package) doFactoryBot.create(:work_package,- project: project,- author: user,- type: project.types.first)- }+ project: project,+ author: user,+ type: project.types.first)+ endbefore doanother_work_package.add_journal(user)another_work_package.description = 'needs more changes'