gitlab-org--gitlab-foss/app/controllers/admin/hooks_controller.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
745 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Admin::HooksController < Admin::ApplicationController
include ::WebHooks::HookActions
before_action :hook_logs, only: :edit
2017-04-20 04:31:37 -04:00
feature_category :integrations
urgency :low, [:test]
2012-07-12 15:10:34 -04:00
def test
2017-07-20 11:12:06 -04:00
result = TestHooks::SystemService.new(hook, current_user, params[:trigger]).execute
2017-07-20 11:12:06 -04:00
set_hook_execution_notice(result)
2012-07-12 15:10:34 -04:00
redirect_back_or_default
2012-07-12 15:10:34 -04:00
end
2017-04-20 04:31:37 -04:00
private
def relation
SystemHook
end
2017-04-20 04:31:37 -04:00
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
2012-07-12 15:10:34 -04:00
end