[Buildbot-devel] Suggestion and question

Evan Driscoll driscoll at cs.wisc.edu
Fri May 27 20:17:24 UTC 2011


First, the suggestion:

I just spent quite a bit of time debugging a dumb error.

I am using the AnyBranchScheduler, and was using the deprecated branches 
attribute. I recently changed to using change_filters, so I went through 
and added the branch schedulers. I track three different repositories 
with three different change sources and three different schedulers, and 
in *one* case I forgot to change the parameter name, so I still had 
'branches=my_change_filter'.

All that happened was the AnyBranchScheduler just went ahead and made a 
ChangeFilter with the branches= attribute set to *that* ChangeFilter. So 
it was looking for a branch that is... a change filter!

What about an error check in the Scheduler's __init__ that 'branches' is 
either not a ChangeFilter, or *is* a string or list?


Now, the question:

I've attached a sanitized version of my master.cfg, but I highlight most 
of the important bits below.

I ran into another weird question. At the top of my master.cfg, I have a 
variable holding my SVN url (actually I have several, but let's stick 
with this):

   repo_url='svn+ssh://.../svn'

I use this variable in my change source:

   SVNPoller(repo_url,
             split_file = split_file_branches,
             pollinterval=vcs_poll_interval_sec),

And in my ChangeFilter:

   repo_change = ChangeFilter(repository=repo_url, branch=['trunk'])

   AnyBranchScheduler('change',
                      change_filter=repo_change,
                      builderNames=['continuous'],
                      treeStableTimer=vcs_tree_stable_timer_sec),

And in the build step to check it out:

   continuous_factory = BuildFactory([
     SVN(baseURL=repo_url,
         mode='update',
         defaultBranch='trunk'),
     Compile(command='scons'),
     Trigger(schedulerNames=['full'])
     ])


(Note: I have a custom split_file_branches just like the standard one 
except it returns 'trunk' for the trunk instead of None.)


The problem is that when I committed, it tried to check out
    svn+ssh://...../svntrunk

In other words, it omitted the / in there. I used to have the trailing / 
in repo_url itself, but I removed it because it was causing the 
ChangeFilter to fail (it was looking for the repository with the /, but 
the / was getting stripped in the change stamp).

So right now I explicitly add it at the checkout step:

     SVN(baseURL=repo_url + '/',
         mode='update',
         defaultBranch='trunk'),

But this seems ugly.

What am I doing wrong? Is my treatment of 'trunk' as a branch throwing 
things off?

Evan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: master.cfg
URL: <http://buildbot.net/pipermail/devel/attachments/20110527/052a609d/attachment.ksh>


More information about the devel mailing list