Welcome to mirror list, hosted at ThFree Co, Russian Federation.

hooks_controller.rb « admin « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1dc6c68d8ca3ac08af3ac9b193527887e843fd97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true

class Admin::HooksController < Admin::ApplicationController
  include ::WebHooks::HookActions

  before_action :hook_logs, only: :edit

  feature_category :integrations
  urgency :low, [:test]

  def test
    result = TestHooks::SystemService.new(hook, current_user, params[:trigger]).execute

    set_hook_execution_notice(result)

    redirect_back_or_default
  end

  private

  def relation
    SystemHook
  end

  def hook
    @hook ||= SystemHook.find(params[:id])
  end

  def hook_logs
    @hook_logs ||= hook.web_hook_logs.recent.page(params[:page]).without_count
  end

  def hook_param_names
    %i[enable_ssl_verification token url]
  end

  def trigger_values
    SystemHook.triggers.values
  end
end