Due to differences in server configs, migrated svn hooks don't seem to work.
Errors with pre-commit hooks can cause commits to get blocked, ref: [forge:site-support:#874]
after upgrading the megameklab project, we can't checking anything into SVN now. We get the following error:
/svn/p/megameklab/code/hooks/pre-commit: line 3: /var/local/mastertree/host/sfp-svn/hook-scripts/check-case-insensitive.py: No such file or directory
I imagine other hooks would fail similarly. We should probably also remove any unnecessary hooks and update the data on other hooks. For example, the user in [forge:site-support:#862] had the following:
-bash-3.2$ pwd /home/svn/p/callflow/code/hooks -bash-3.2$ cat post-commit #!/bin/bash # The following is required for site integration, do not remove/modify. # Place user hook code in post-commit-user and it will be called from here. curl -s http://sourceforge.net/auth/refresh_repo/p/callflow/code/ DIR="$(dirname "${BASH_SOURCE[0]}")" if [ -x $DIR/post-commit-user ]; then exec $DIR/post-commit-user "$@" -bash-3.2$ cat post-commit-user #!/bin/sh # THIS FILE IS AUTOGENERATED - DO NOT EDIT /var/local/mastertree/host/sfp-svn/hook-scripts/sf-svn-stats-hook.py $* /var/local/mastertree/host/sfp-svn/hook-scripts/keepsake -p "$1" /var/local/mastertree/host/sfp-svn/hook-scripts/svnnotify --repos-path "$1" --revision "$2" --to "callflow-svn@lists.sourceforge.net" --subject-prefix "SF.net SVN: callflow:" --subject-cx --no-first-line --with-diff --viewcvs-url "http://callflow.svn.sourceforge.net/callflow/?rev=%s&view=rev" --user-domain "users.sourceforge.net" --footer "This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site." -l /usr/bin/svnlook --max-diff-length 100000 exit 0
We should probably first remove the "AUTOGENERATED" link, since that's no longer true.
I think we can probably just remove the sf classic specific hooks (sf-svn-stats-hook.py
and keepsake
).
For svnnotify, we should fix the path (iirc, it's in the standard location /usr/bin/svnnotify/
though just svnnotify
works), and update the url to the code browser (ie., the --viewcvs-url
option)
We have a few other pre-configured hooks users can add, but we didn't allow custom hooks for svn repos on classic, so it should be a finite list.
Originally by: maddes
Hi there,
I can not find any svnnotify on the server.
Here's how I searched:
Similar issue for check-case-insensitive.py and check-mime-type.pl in the converted pre-commit hook:
What are the correct pathes for:
"svnnotify" in post-commit-user
"check-case-insensitive.py" in pre-commit
* "check-mime-type.pl" in pre-commit
Or do have I to place them myself somewhere and call from there? If so, what is the recommended path?
Maddes
Current content of pre-commit after upgrade to Allura:
Hello Maddes,
The server for shell sessions is not the same as the server that runs commit hooks. On the servers that run the scripts, svnnotify is in the standard
/usr/bin/svnnotify
location (though just usingsvnnotify
without the full path also works)As for the other scripts, I'm not certain that those are installed on that server yet, but I expect the work on this ticket to root those out and get them added properly.
Regards,
Chris Tsai, SourceForge.net Support
Originally by: maddes
Thanks for the quick info.
Changed my post-commit-user file accordingly.
Will track this ticket for "check-case-insensitive.py" and "check-mime-type.pl" to arrive. The first one is critical for projects with mixed development platforms (Windows/*nixes).
Normally these are available in /usr/share/subversion/hook-scripts/ and must be executable.
Maddes
Originally by: maddes
The scripts are available on the code server (found via pre-commit hook) but not at their usual place.
Normally these are in /usr/share/subversion/hook-scripts/ and must be executable.
Maddes
Originally by: maddes
/usr/lib64/subversion/contrib/hook-scripts/check-mime-type.pl:
Is working for me. Still unusual place for hook script.
/usr/lib64/subversion/contrib/hook-scripts/case-insensitive.py:
The Python script is not working.
Originally by: maddes
Latest hook scripts are available at:
http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/
allura:cj/5076
Can we put this in forge-classic? Monkey-patching even, if needed. This is very SF-specific.
We need to handle these two hooks also:
There's an extra slash in
--revisionURI=http://localhost//p...
We should check with siteops about what environment these run in so that we can confirm the paths (e.g. the new paths in this code branch aren't present for me on the hosts I expected, but neither was /usr/bin/svnnotify so I'm clearly looking on the wrong host) and confirm functionality (e.g. ImportError mentioned above).
Should we do manual fixups for the existing repos? Not sure how many there are, but that might be easier than scripting it. Either way, we should do that in 'validation' stage or make a separate ticket.
Originally by: peterbecker
I'm experiencing this problem with the 'toscanaj' project and the check-case-insensitive.py script. How do I work around this issue? I'm reasonably happy to drop the script completely, but I don't know how.
Here's the exact error if needed:
Originally by: *anonymous
Sorry -- I just realised the issue linked in the description answers my question. Fixed.
I believe you should be able to use the shell service to access the hooks directly at
/home/svn/p/<project>/<mount>/hooks
.Unfortunately, we do not yet have the hooks installed globally, but you should be able to put them in the hooks directory and call them from there.
I added the info to this thread as well in my reply above, as well as noting that, in addition to simply commenting out the offending hook call, you can also install it directly in your project's hook directory until we resolve the issue globally.
/var/local/mastertree/host/sfp-svn/hook-scripts/sf-svn-stats-hook.py $*
/var/local/mastertree/host/sfp-svn/hook-scripts/keepsake -p "$1"
^-- those should be removed from the project's hooks anyways, they are classic forge specific.
svnnotify is present in /usr/bin/svnnotify, so the path just should need changed to reference it.
I have created all the scripts in the allura SVN environment, in the same place they were before (well, symlinked to the new location). I replaced the non-needed scripts with empty ones that just return to clear up errors.
note: I haven't tested them, however...
allura:cj/5076
forge-classic:cj/5076
Moved hook copying / processing code to forge-classic, added missing munging, fixed a couple of small issues, and generally cleaned it up.
The production setup is already in place, and the default value for the new config option is correct, so this should be GTG out of the box.
Code and tests are looking good, but got an error when migrating a test project. As you can see in the pdb shell, the src & dst args have the right values. Also /git/p/testscm/part1.git/hooks/post-receive.sample actually exists when I check after this error. Before running the migration, I did run
rm -rf /{hg,svn,git}/p/testscm
to make sure I had a fresh clean start.