: Blog

Google revisited

Published on Tuesday, March 10, 2009

Hi folks!

Just a quick post for all the folks on google code: We have sane hooks now.

How does it work? The folks at google came up with quite an elegant system for allowing pretty much any commit hook, without them needing to run any custom code on their end: the HTTP POST hook.

How does it work?

Basically, whenever you make a commit, their system generates a hunk of easily-parsed text (in a format called JSON) representing commit information, and submits it to some webserver you specify via a HTTP POST.

How do I use it?

You need to be the administrator of your google code project. Then, click on the Administer tab where you configure your project. This time, you need the Source page. There, on the bottom, you'll have a text field called Post-Commit URL. Enter the following URL:

http://cia.vc/deliver/simplejson/

That's it. All commits you make from now on should be reported to CIA.vc (with project name being what the project is called by google code).

From what I've seen, latency is pretty good, some 5-10 seconds from commit to IRC.

Once you've set this up, remember to turn off polling (or the email to our googlecode mail parser), since you'll get one notification per subsystem noticing that something happened.

Is this only for google?

Unfortunately, so far it is. However, their idea is quite a good one: This kind of hook does not need a lot of work on the server side, the JSON is easy to generate (aka "hack up") in pretty much any language, and it should extend nicely should some other VCS need different entries.

So if someone feels like writing a HTTP-POST hook for some popular version control system, they might come in useful. Maybe we can convince some other hosting providers to supply a similar system.

So Far,
Karsten "BearPerson" Behrmann