Fix GitLab plugins not working without hooks configured

Merged Stan Hu requested to merge sh-fix-plugins-not-executing into master

gitlab-foss!31741 (merged), shipped in GitLab 12.2, reduced Gitaly RPCs by generating commit data only if hooks or services were actually active. However, GitLab plugins (, are executable programs that get launched inside SystemHooksService#execute_hooks regardless of whether any hooks are actually active. As a result of this change, users have to configure a Webhook for plugins to fire.

We restore the previous behavior by checking whether plugins are available and executing SystemHooksService#execute_hooks if any plugins are available.

Closes #194131 (closed)

Edited by 🤖 GitLab Bot 🤖