Skip to content

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 include Integrations::HooksExecution we can define these in Integrations::HooksExecution now and remove them from the three HooksController classes:

    • The #hook_logs method
    • The before_action :hook_logs, only: :edit bit at the top

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 the before_action executes before the other before_actions in the controller. @group is only assigned later in a before_action in the controller. Rather than include the module after the before_action in the controller we discussed whether things could be rewritten a bit to avoid order-dependency.