Custom Hook Error Messages on Merge
Summary
In creating a custom hook with an error message, the error message does not display in Gitlab. Not only that, but if an error occurs, then the "Merge in Progress" button with spinner just spins and never completes.
Perhaps my pre-receive custom hook is wrong?
Steps to reproduce
- Create a merge request
- Create a <project.git>/custom_hooks/pre-receive file with the following content
#!/usr/bin/env bash
echo "error: rejecting all commits"
exit 1
or
#!/usr/bin/env ruby
$stderr.puts "error: rejecting all commits"
exit 1
- Attempt to accept the merge request
Expected behavior
Merge request aborted with the error displayed in the UI, as documented.
Actual behavior
"Merge in Progress" button spins indefinitely and no message is displayed
Environment
GitLab Enterprise Edition 8.14.3-ee
Custom Hooks Documentation
https://docs.gitlab.com/ee/administration/custom_hooks.html#custom-error-messages
Edited by 🤖 GitLab Bot 🤖