Enabling syntax checking for puppet via a git update hook

Todd Zullinger tmz at pobox.com
Fri Jun 26 19:43:10 UTC 2009


Mike McGrath wrote:
> Works for me, patch seems resonable (if it does work like it seems
> it should :)
>
> Ping me on irc and we'll get this in and ready and tested.

This is done now, we've moved the mail notification bits out of the
update hook and into the post-receive hook.  I'm sure many of you
noticed the changes in the mail formatting and perhaps found your
filters needed changed.

After making the initial change to use the upstream post-receive-email
hook yesterday, Owen Taylor pointed out that the gnome.org admins have
written a very nice post-receive-email script for use on the gnome.org
repositories¹.  I've added that script to puppet and installed it on
puppet1.  So the format of the commit mails should be a bit less
verbose once again.

In place of the X-Git-Module header, a Keywords header exists and
contains the git module name.  I also added the X-Project header with
the project description, in case anyone was using that to filter.

We're now also running the syntax check in the update hook, which
should prevent pushing changes with obvious syntax errors.  The output
of such a failure looks like this:

    http://fpaste.org/paste/16624

I still find it convenient to have a pre-commit hook that checks
syntax.  That keeps me from committing obviously broken things to my
local repo.  The hooks I whipped up and have been using on my local
puppet boxes for a while now are at:

    http://tmz.fedorapeople.org/tmp/pre-commit
    http://tmz.fedorapeople.org/tmp/pre-commit-puppet

If anyone notices problems with this, don't hesitate to yell at me via
mail or irc (tmz).

¹ http://git.gnome.org/cgit/gitadmin-bin/tree/gnome-post-receive-email
  (I did make a few small modifications to this script, all of which I
  sent to Owen for potential inclusion in the gitadmin-bin repo.  The
  most useful of which is encoding of user names in utf-8, where
  needed.  I tested this on fedorapeople.org and out of the 2124
  accounts there, 97 names were non-ascii and required encoding.)

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start every day with a smile and get it over with.
    -- W.C. Fields

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/infrastructure/attachments/20090626/5ebfd159/attachment.bin 


More information about the infrastructure mailing list