From 9be0c2734ae3e3cc84196cf167a0c327c7cf8570 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 Feb 2018 17:51:02 +0200 Subject: Add external plugins support to extend system hooks Signed-off-by: Dmitriy Zaporozhets --- app/services/system_hooks_service.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/services/system_hooks_service.rb') diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb index a6b7a6e1416..71de74e5a82 100644 --- a/app/services/system_hooks_service.rb +++ b/app/services/system_hooks_service.rb @@ -11,6 +11,15 @@ class SystemHooksService SystemHook.hooks_for(hooks_scope).find_each do |hook| hook.async_execute(data, 'system_hooks') end + + # Execute external plugins + PLUGINS.each do |plugin| + begin + plugin.new.execute(data) + rescue => e + Rails.logger.warn("GitLab -> Plugins -> #{plugin.class.name} raised an axception during execution. #{e}") + end + end end private -- cgit v1.2.1 From 5bb435d0e75ad84e2fc379208cc36a25a4574453 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 19 Feb 2018 19:20:53 +0200 Subject: Remove plugin initializer and add plugins:validate rake task Signed-off-by: Dmitriy Zaporozhets --- app/services/system_hooks_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/services/system_hooks_service.rb') diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb index 71de74e5a82..ba46c0074e4 100644 --- a/app/services/system_hooks_service.rb +++ b/app/services/system_hooks_service.rb @@ -13,7 +13,7 @@ class SystemHooksService end # Execute external plugins - PLUGINS.each do |plugin| + Gitlab::Plugin.all.each do |plugin| begin plugin.new.execute(data) rescue => e -- cgit v1.2.1 From eff5746b5e7cf4075edd6d1c76fdcd24c1603bb4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 19 Feb 2018 19:55:54 +0200 Subject: Redesign plugins system Signed-off-by: Dmitriy Zaporozhets --- app/services/system_hooks_service.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'app/services/system_hooks_service.rb') diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb index ba46c0074e4..af8c02a10b7 100644 --- a/app/services/system_hooks_service.rb +++ b/app/services/system_hooks_service.rb @@ -12,14 +12,7 @@ class SystemHooksService hook.async_execute(data, 'system_hooks') end - # Execute external plugins - Gitlab::Plugin.all.each do |plugin| - begin - plugin.new.execute(data) - rescue => e - Rails.logger.warn("GitLab -> Plugins -> #{plugin.class.name} raised an axception during execution. #{e}") - end - end + Gitlab::Plugin.execute_all_async(data) end private -- cgit v1.2.1