[OpenAFS-devel] Buildbot for gerrit

Simon Wilkinson sxw@inf.ed.ac.uk
Tue, 13 Oct 2009 22:55:18 +0100


I've been thinking over the last few months about how we might  
simplify the verification task in gerrit, by using something like  
buildbot to automate the verification process. This is complicated a  
little by the fact that we're not wanting to build a linearly  
progressing branch (such as master), but instead a branching tree,  
where each change exists on its own branch. It's also complicated by  
the fact that we don't place any limits on which code may be submitted  
to gerrit, but we don't want our build machines test building code  
from unknown contributors.

So, here's the plan. We'll have a bot which uses gerrit's JSON  
interface to interrogate it for details about recent changes. When a  
change is updated, the bot will check to see if the most recent  
patchset is already queued for building. If it is not, then it will  
use a RPC to ask gerrit for details about that patchset. If the author  
is on a 'trusted' list, then the patchset will be added to the build  
queue. If not, then the list of reviewers is checked. If someone on  
the trusted list has supplied at least a '+1' for verification or code  
review, then the patchset will be added to the build queue. The git  
SHA1 will be obtained from gerrit via RPC, and the buildbot Change  
record generated by consulting a local git repository.

buildBot itself will be configured to treat each entry in the build  
queue as an independent change. Merging will be disabled, so every  
change will be built. This does mean that for changes in gerrit that  
really are dependent, we may do unnecessary work, but that's not  
necessarily a bad thing, as it means we will catch change series that  
break, then fix, a problem in consecutive patch sets.

When the build is complete, buildbot will report success or failure  
back into gerrit using the ssh interface. A single message will be  
generated, with more details of which builders succeeded or failed  
available from a link contained in that message.

At the moment, I have a Linux builder available. Contributions of  
hosts for other systems will be gratefully appreciated once I've got  
it up and running.

Thoughts?

Simon.