Move common methods in webhook controllers to Integrations::HooksExecution
The following discussion from !94145 (merged) should be addressed:
-
@.luke started a discussion: (+3 comments) Suggestion
We have this method defined in the same way for all 3
HooksController
classes (which is a good sign - you've brought feature-parity!), but because those three controllers includeIntegrations::HooksExecution
we can define these inIntegrations::HooksExecution
now and remove them from the threeHooksController
classes:- The
#hook_logs
method - The
before_action :hook_logs, only: :edit
bit at the top
- The
We looked at this in a pairing session and decided to leave this as a follow-up. The error is because
Integrations::HooksExecution
is included at the top of the controller, so thebefore_action
executes before the otherbefore_action
s in the controller.@group
is only assigned later in abefore_action
in the controller. Rather than include the module after thebefore_action
in the controller we discussed whether things could be rewritten a bit to avoid order-dependency.