Merging a merge request where a git hook fails is not surfaced to the user
Hey all,
Summary: pre-receive hooks that block a merge fail silently
Steps to reproduce: Have a pre-receive hook that fails, attempt to merge a merge-request through the UI
Expected Behavior: Any output from the hook is surfaced to the user along with the information that a commit hook failed.
Observed:
I go to a merge request in my repo, and click "merge". The page says "Merge is in progress. Please wait. Page will be automatically reloaded." and a spinner appears, but nothing happens. I reload the page and see "If you still want to merge this request manually - use command line"
I check the server-side logs (githost.log), and see:
remote:
remote: #------------------------------------------------------------------------
remote: | git pre-receive
remote: | hook: /some/path/to/a/hook.sh
remote: | md5: 9475080ed2f3ea2ced9e6a5739a835e2
remote: | Doing some validation... please hang on a second.
remote: #------------------------------------------------------------------------
remote:
remote: Branches/tags to update:
remote: * master (open)
remote: eb266f9e7de3125a61f76cc0db94958b039e95c5 - not using commit template!
remote:
remote: #------------------------------------------------------------------------
remote: | Your git commits did not have the correct commit template.
remote: | Please fix your commits and try to push again:
# snip...
This output comes from one of our custom hooks we have installed.
Output of checks: Not relevant
Possible Fix: none yet
Please let me know if you need any further information. Thanks!