#5076 svn hooks need conversion

forge-nov-02
closed
Cory Johns
General
4
2014-01-07
2012-10-05
Chris Tsai
No

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.

Related

Tickets: #5213
Tickets: #5218
Forge: Site Support: #1155
Forge: Site Support: #1275
Forge: Site Support: #862
Forge: Site Support: #874

Discussion

1 2 3 4 > >> (Page 1 of 4)
  • M. Buecher
    M. Buecher
    2012-10-16

    Hi there,

    I can not find any svnnotify on the server.
    Here's how I searched:

    -bash-3.2$ hostname
    shell-24006
    -bash-3.2$ pwd
    /home/svn/p/regshot/code/hooks
    -bash-3.2$ echo $PATH
    /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
    -bash-3.2$ which svnnotify
    /usr/bin/which: no svnnotify in (/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin)
    -bash-3.2$ find / -name "svnnotify"
    -bash-3.2$
    

    Similar issue for check-case-insensitive.py and check-mime-type.pl in the converted pre-commit hook:

    -bash-3.2$ find / -name "check-case-insensitive.py"
    -bash-3.2$
    -bash-3.2$ find / -name "check-mime-type.pl"
    /usr/share/doc/subversion-1.6.17/contrib/hook-scripts/check-mime-type.pl
    

    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:

    -bash-3.2$ cat pre-commit
    #!/bin/sh -e
    # THIS FILE IS AUTOGENERATED - DO NOT EDIT
    /var/local/mastertree/host/sfp-svn/hook-scripts/check-case-insensitive.py "$1" "$2"
    /var/local/mastertree/host/sfp-svn/hook-scripts/check-mime-type.pl "$1" "$2"
    exit 0
    
     
    Last edit: M. Buecher 2012-10-16
    • Chris Tsai
      Chris Tsai
      2012-10-16

      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 using svnnotify 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

       
      • M. Buecher
        M. Buecher
        2012-10-16

        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

         
        Last edit: M. Buecher 2012-10-16
  • M. Buecher
    M. Buecher
    2012-10-16

    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.

    -rwxr-xr-x 1 root root 6527 Oct  5  2007   /usr/share/doc/subversion-1.6.17/contrib/hook-scripts/check-mime-type.pl  
    -rwxr-xr-x 1 root root 6527 Jun  1  2011   /usr/lib64/subversion/contrib/hook-scripts/check-mime-type.pl  
    -rwxr-xr-x 1 root root 4794 Oct 17  2007   /usr/share/doc/subversion-1.6.17/contrib/hook-scripts/case-insensitive.py  
    -rwxr-xr-x 1 root root 4794 Jun  1  2011   /usr/lib64/subversion/contrib/hook-scripts/case-insensitive.py
    

    Maddes

     
  • Cory Johns
    Cory Johns
    2012-10-17

    • status: in-progress --> code-review
    • qa: Dave Brondsema⚛
     
1 2 3 4 > >> (Page 1 of 4)


Anonymous


Cancel   Add attachments