| Issue 1326: | Gerrit 2.3 | hook names are incorrect | |
| 7 people starred this issue and may be notified of changes. | Back to list |
Affected Version: 2.3 What steps will reproduce the problem? 1. Set up hooks for Gerrit with default settings 2. Undertake any event that should trigger a hook 3. Check hook has fired What is the expected output? The hook appropriate for the event should fire What do you see instead? Rather that the correct hook getting fired it fires 'gerrit-hook' instead. Setting the names explicitly using the "hooks" config section makes no difference. This was working just fine for us until I upgraded to 2.3. The error_log output shows that up until that point the correct file names were being used and after that it always calls 'gerrit-hooks'. Please provide any additional information below.
Apr 12, 2012
#1
evil...@gmail.com
Apr 12, 2012
(No comment was entered for this change.)
Status:
Invalid
May 16, 2012
Seen similar issues after updating to 2.3. When using symbolic links to point to a common hook-script the first argument to the script will be changed after updating the common hook-script. As stated above, recreating the folder will make it operational again, but will fail again after updating the hook. Commenting an issue with comment-added symlinked to python-script gives: sys.argv= ['/home/gerrit2/gerrit/hooks/comment-added', ... ] After updating the python-script, commenting an issue gives: sys.argv= ['/home/gerrit2/gerrit/hooks/hook', ... ]
May 16, 2012
Heh. Glad it wasn't just me going insane :)
May 16, 2012
I think the change here might be the server doing a "resolve" call on the file path. Which is possibly chasing symbolic links back to the original. And it does it a few times, once for "hooks" and again for the individual hook commands. And there may be some differences between startup and later during server execution. Ick. I'm not sure when these changes were made, or why, but I was looking at the hook setup code over the weekend as I was looking at ejecting it to a plugin, and it was reading funny to me with all of the resolve calls here.
Status:
Accepted
May 16, 2012
You know, it would be nice if there was an option to just use one script and have the "hook" name passed in rather then having to have multiple scripts (or, as in my case, one script with symlinks). Both are valid solutions but I suspect having one script that can handle hooks is generally going to be simpler. |
|
| ► Sign in to add a comment |