[Buildbot-devel] Trouble with Passing Properties To Triggered Builders

Jeremy Cornett jeremy.cornett at venafi.com
Tue Jan 20 17:57:04 UTC 2015

Ugh, I'm an idiot. I just realized that you can set properties on
schedulers! That way a property can exist no matter what scheduler created
it if I do this right. Then I can just have the trigger step pass along the
needed properties, and not care about the value with the doStepIf function.
Thank you BuildBot documentation for giving me an answer!


Description: http://www.venafi.com/img/venafi_email_signature_logo.gif

| Jeremy Cornett | Configuration Management Engineer



From: Jeremy Cornett 
Sent: Tuesday, January 20, 2015 10:53 AM
To: 'buildbot-devel at lists.sourceforge.net'
Subject: Trouble with Passing Properties To Triggered Builders


I have a rather complex problem involving multiple properties, but I won't
describe it all to you, but instead give a simplified version with only one
property. I have a builder which builds code (aka Builder A), and another
builder (aka Builder B) which installs and then runs tests on the output
from Builder A. Builder B can run two different sets of tests, Smoke or
Full. And Builder A has a force build form that lets you set a force build
property called test_set to specify the test set, Smoke/Full, to run on
Builder B.


So the process goes that Builder A always triggers Builder B, but builder
B's behavior depends on the value of the test_set property. Builder A has a
few schedulers - a force, a SingleBranchScheduler, and a Nightly. Let's say
the default test set for a Nightly scheduler is to do the Full, the
SingleBranchScheduler is to do the Smoke, and the Force should allow you to
do either. To solve this problem, I setup two Trigger build steps as the
last steps in Builder A's factory, one that triggers Builder B with the
test_set as Smoke, and another with the test_set as Full. For each of those
steps, I added in a function for the doStepIf value that evaluates the
scheduler property, and then it will either trigger the Smoke run of Builder
B or the Full run of Builder B. This works very well. Unfortunately, it
doesn't scale.


In a more complicated scenario, let's say I had multiple properties that
needed to be passed on to the triggered builder B. With my above solution,
I'd have to create a trigger step for each combination of values. For three
properties, that have 3 values a piece, that's 9 trigger steps I'd have to
add to Builder A's factory. There's got to be a better way! But I haven't
found it yet. Can anyone please help?


The documentation for setting properties for triggered schedulers is here:
erties#triggering-schedulers. I know I can have a trigger step pass along
properties from the current build to the triggered one, but it doesn't
handle cases when that property doesn't exist to begin with. It would be
helpful if you could set properties for other scheduler types.


My experience with the Interpolate is very limited, but just by reading the
documentation, it sounds like I might be able to get it to do what I'm
wanting, but that's because I'm just interrogating the scheduler property in
this instance. It would probably be some really nasty looking interpolate
statements to set what I need for multiple properties. Isn't there an easier
way? I was really hoping I could use a render object to create the
dictionary needed for the set_properties, but I get an error every time I
try that when I do a checkconfig on the master.


dbot/steps/trigger.py", line 64, in __init__


exceptions.TypeError: '_Renderer' object is not iterable

Configuration Errors:

  error while parsing config file: '_Renderer' object is not iterable
(traceback in logfile)


Any thoughts??


Description: http://www.venafi.com/img/venafi_email_signature_logo.gif

| Jeremy Cornett | Configuration Management Engineer



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150120/183f4432/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 2704 bytes
Desc: not available
URL: <http://buildbot.net/pipermail/devel/attachments/20150120/183f4432/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5931 bytes
Desc: not available
URL: <http://buildbot.net/pipermail/devel/attachments/20150120/183f4432/attachment.bin>

More information about the devel mailing list