[Buildbot-devel] My workaround to multi-repository builds

Ben Hearsum bhearsum at mozilla.com
Fri Sep 9 12:49:07 UTC 2011

Hi all,

I've been setting up a Buildbot for Flask (http://flask.pocoo.org/) and 
its supported extensions. For this Buildbot, we're polling both the 
Flask repository, and each extension's repository. When changes are made 
to the Flask repository, Builds are run to run Flask's own unit tests, 
and also to run each of the extension's unit tests against the new Flask 
code. When changes are made to at extension's repository, its tests are 
run against multiple versions of Flask.

Because we're polling multiple, unrelated repositories (in the VCS 
sense), and triggering the same builders in multiple different ways, I 
hit some issues with the Source steps. Specifically: when an extension 
test builder was triggered from a commit to the Flask repository, the 
Source step that checked out the extension's code tried to update to a 
revision only present in the Flask repository.

After some head-desking, I found a pretty simple solution: Ignore the 
SourceStamp completely when its repository doesn't match the one set on 
the Source step. Concretely, this looks like:
class RepositoryCheckingGit(Git):
     def startVC(self, branch, revision, patch):
         ss = self.build.getSourceStamp()
         if ss.repository != self.repourl:
             Git.startVC(self, None, None, None)
             Git.startVC(self, branch, revision, patch)

I'm not sure how generally useful this is, but given that Source steps 
ignore the SourceStamp's repository when they have their own set, this 
makes a lot of sense to me. I hope it's useful to someone else, too!

- Ben

More information about the devel mailing list