[users at bb.net] Retrieving element from got_revision

Cristian Morales Vega cristian at samknows.com
Wed Feb 3 09:17:45 UTC 2016


I am setting up our BuildBot instance. Keep in mind that I have no
idea of Python, which is a problem but at the same time the fact that
someone without Python can set it up tells a lot about BuildBot.

We host our code in BitBucket. So I have created a BitBucketStatusPush
based on StashStatusPush.
We have multiple small projects, and a utility library used by all of
them. So I have set up multiple codebase builders with
project/library, one per "project".
Wherever the project or library triggers a build, I would want
BuildBot to send the status to the project repository in BitBucket.

Given that a "project" build may be triggered by a library change I
may not have a SourceStamp revision for "project". So what I am doing
is using a "SetProperty" build step after the git project checkout
step, setting a "status_got_revision" property to the project's
"got_revision". And the BitBucketStatusPush's stepFinished() method
looks for it to send the INPROGRESS status to BitBucket.

My problem is with the SetProperty step.

I would like to do something like

f.addStep(steps.SetProperty(name='Set status_got_revision',
property="status_got_revision",
value=util.Property("got_revision['project']")))

or

f.addStep(steps.SetProperty(name='Set status_got_revision',
property="status_got_revision",
value=util.Interpolate("%(src:project:got_revision)s")))


When using Property, I am not really sure how to access one specific
element from the got_revision dictionary.
And when using Interpolate it doesn't work, not sure why.

When using

f.addStep(steps.SetProperty(name='Set status_got_revision',
property="status_got_revision",
value=util.Interpolate("%(src:project:revision)s")))

it works just fine. But again, I may not have a "revision".


Any idea what I am doing wrong?

Thanks.


More information about the users mailing list