[Buildbot-devel] WithProperties misbehavior
bruce at itasoftware.com
Mon Feb 11 16:46:21 UTC 2008
Thanks for your ideas.
I'm not trying to bypass any of the preferred practices,
i.e., keeping it simple.
I'm not using the force build button, but a PBchangesource listener
which I poke using an svn hook on the repository side:
svn_buildbot -r Repository -v Revision# -s MasterHost -p Port -f <branch filters>
The SVN step seems to know the proper revision of the proper branch
when it checks out the code, based on the -v argument passed in. This
revision number appears properly on all the status pages under the
waterfall, it's all good. But, I would think that I could access that
number using WithProperties easily enough...
Mainly the reason I need this is to pass execution to a downstream
dependant scheduler to do other work, but maintain the same revision
number as the upstream for reference.
I suppose I could write a ShellCommand step to glean the SVN revision
from the current checkout, but I don't think I should need to do that,
still really wondering why I've got this problem.
Going back to rtfm again, about BuildSet and SourceStamp. I'm missing
thanks again -bruce.
John Saxton writes:
> 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)
More information about the devel