[Buildbot-devel] configuration help
warner-buildbot at lothar.com
Thu Nov 24 23:17:47 UTC 2005
> However, I'm not sure I understand where to plug in my function that
> determines what branches a change-set belongs to.
> I find the following line in the master's logs:
> 2005/11/24 20:51 UTC [Broker,2,127.0.0.1] <Scheduler 'all'> ignoring off-branch
> <buildbot.changes.changes.Change instance at 0x40a3758c>
> What am I missing ?
Ah, you're missing some code that I haven't written yet :).
PBChangeSource receives complete Changes from whatever is sending to it, in
this case svn_buildbot.py . (well, actually it receives dictionaries with
keys like 'comments' and 'revision', but they are effectively complete Change
instances). So the sender is responsible for deciding which branch the Change
svn_buildbot.py needs to be updated to compute a branch, and then add a
'branch' key into the dictionary that it feeds to callRemote('addChange').
When this is not provided, PBChangeSource defaults to a branch of None, which
means the default branch. If your Scheduler has been configured to pay
attention only to a specific (non-None) branch, it will ignore these "default
So, you need to add code to svn_buildbot.py that examines 'changed' (the list
of filenames coming out of 'svnlook changed'), and do the following:
decide which branch each filename is a part of
rewrite the filename to be branch-relative
i.e. trunk/include/header.h should become branch='trunk' and
assert that all files are part of the same branch
(or write even more code that can send multiple Changes, one for each
branch being touched on this commit)
add a 'branch' key to the dictionary created in gotPersp()
I haven't personally set up a buildbot that runs builds of non-trunk builds
yet, so I hadn't gotten around to updating svn_buildbot.py to add a place for
this "filename->branchname" function. The function must, of course, be
written specifically for each project, but it would be nice if it were
obvious where users needed to write that function.
FYI, 'buildbot sendchange' takes a --branch argument, and sends it through to
the PBChangeSource. However, it is assumed that whatever calls 'buildbot
sendchange' has already determined what the branch name is.
hope that helps,
PS: if your scheduler is supposed to be accepting builds on all branches
(i.e. AnyBranchScheduler(branches=None)), and you're seeing that message
about "Scheduler 'all' ignoring off-branch" stuff, then there might be a bug.
Please let me know if this is the case. If you're using branches=, that
means you don't want it to accept *any* branches, which will of course ignore
everything and never trigger a build. I'm adding a warning message to guard
against branches= now. (although, now that I look at the code, I realize
that it treates branches= as equivalent to branches=None. I'll fix that
More information about the devel