summaryrefslogtreecommitdiff
path: root/app/controllers/concerns
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-05-25 13:26:12 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-05-25 13:26:12 +0000
commit1ed7b7629a2c0fbcdfeeda386ec6292e57728e74 (patch)
tree4cd07f47a698bedf1a5811480482bfaa1582a5ae /app/controllers/concerns
parent78de1c059ac588df4ba1ef352b28e5b1c6102804 (diff)
parent330789c23c777d8ca646eba7c25f39cb7342cdee (diff)
downloadgitlab-ce-1ed7b7629a2c0fbcdfeeda386ec6292e57728e74.tar.gz
Merge branch '17848-web-hook-logging' into 'master'
Implement Web Hooks calls logging Closes #17848 See merge request !11027
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r--app/controllers/concerns/hooks_execution.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/concerns/hooks_execution.rb b/app/controllers/concerns/hooks_execution.rb
new file mode 100644
index 00000000000..846cd60518f
--- /dev/null
+++ b/app/controllers/concerns/hooks_execution.rb
@@ -0,0 +1,15 @@
+module HooksExecution
+ extend ActiveSupport::Concern
+
+ private
+
+ def set_hook_execution_notice(status, message)
+ if status && status >= 200 && status < 400
+ flash[:notice] = "Hook executed successfully: HTTP #{status}"
+ elsif status
+ flash[:alert] = "Hook executed successfully but returned HTTP #{status} #{message}"
+ else
+ flash[:alert] = "Hook execution failed: #{message}"
+ end
+ end
+end