summaryrefslogtreecommitdiff
path: root/app/controllers/admin/hook_logs_controller.rb
diff options
context:
space:
mode:
authorAlexander Randa <randa.alex@gmail.com>2017-04-27 10:08:57 +0000
committerAlexander Randa <randa.alex@gmail.com>2017-05-25 10:07:52 +0300
commit330789c23c777d8ca646eba7c25f39cb7342cdee (patch)
tree271bd7cc0ac2c5250f2f587069cf3a0e3f2d9790 /app/controllers/admin/hook_logs_controller.rb
parenta5f0656392699dad7677a368c315217ea99b3982 (diff)
downloadgitlab-ce-330789c23c777d8ca646eba7c25f39cb7342cdee.tar.gz
Implement web hooks logging
* implemented logging of project and system web hooks * implemented UI for user area (project hooks) * implemented UI for admin area (system hooks) * implemented retry of logged webhook * NOT imeplemented log remover
Diffstat (limited to 'app/controllers/admin/hook_logs_controller.rb')
-rw-r--r--app/controllers/admin/hook_logs_controller.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/controllers/admin/hook_logs_controller.rb b/app/controllers/admin/hook_logs_controller.rb
new file mode 100644
index 00000000000..aa069b89563
--- /dev/null
+++ b/app/controllers/admin/hook_logs_controller.rb
@@ -0,0 +1,29 @@
+class Admin::HookLogsController < Admin::ApplicationController
+ include HooksExecution
+
+ before_action :hook, only: [:show, :retry]
+ before_action :hook_log, only: [:show, :retry]
+
+ respond_to :html
+
+ def show
+ end
+
+ def retry
+ status, message = hook.execute(hook_log.request_data, hook_log.trigger)
+
+ set_hook_execution_notice(status, message)
+
+ redirect_to edit_admin_hook_path(@hook)
+ end
+
+ private
+
+ def hook
+ @hook ||= SystemHook.find(params[:hook_id])
+ end
+
+ def hook_log
+ @hook_log ||= hook.web_hook_logs.find(params[:id])
+ end
+end