[Buildbot-devel] WithProperties misbehavior

John Saxton saxton at apple.com
Fri Feb 8 21:13:24 UTC 2008


On Feb 8, 2008, at 9:44 AM, Bruce Walton wrote:
> I'm concerned that the "revision" returned is blank (and the
> documented "got_revision" doesn't work at all, appears to be
> deprecated.)


"revision" is blank if whatever triggered the build didn't specify a  
specific revision to build.  For example, if you forced a build from  
the web UI and left the revision field blank.  This is a "use  
whatever is the latest" case. It gets copied from the SourceStamp, so  
it's always defined, but it may well be "None".

The "got_revision" property gets created by your Source step (CVS,  
SVN, whatever).  Before your Source step runs, "got_revision" isn't  
defined at all, so trying to reference it in a WithProperties  
statement will raise an exception.  If you're using a custom Source  
step, or you've avoided the built-in Source steps all together (maybe  
by doing your checkout with a ShellCommand call to "cvs checkout  
foo"), then you may need to set got_revision yourself  
(self.setProperty("got_revision", theRevsionIGot)) if you want later  
steps to be able to use it.

I recently realized that the Source steps use the "revision" property  
of the SourceStamp, not the build property, so if you were trying to  
make an early build step change which revision your Source step would  
check out, you may need to add something like this to that early  
build step:

     ss = self.build.source
     self.build.source = SourceStep(revision=theRevisionIWant,  
branch=ss.branch, patch=ss.patch, changes=ss.changes)

-John





More information about the devel mailing list