0

The scenario: I have various builder, that trigger a builder B. The builder B needs to know a specific piece of data, which is a string, so it knows what operation has to perform.

Example: 3 builders build 3 version of the same software, but each one is for a different architecture; I need to pass the architecture to builder B, which does testing, so it does the testing for the right architecture. So when a builder start, triggers B, which gets the architecture as parameter, and pass it to a step.

How can I pass a value trough the triggerable builder step in builder A, which then will be used by a step in builder B?

I could simply avoid to have builder B and run an instance of the work for each of my builders

Any code example would be very welcome; found no trace of a working example anywhere.

Update:

OK, I am getting closer I guess; using properties; you need to

import Properties

from buildbot.process.properties import Property

Then in the triggerable step, you need to make a property

f.builderA.addStep (trigger.Trigger(schedulerNames= ['scheduler1']. set_properties={ "arch":Property("x86")}))

Last step is to interpolate the parameter and use it in the step on builderB:

f.builderB.addStep(testarch (architecture=(Interpolate(%(prop:arch))))

Problem is: I get an error where i restart the master, because my step is expecting a string for arch, and instead it says that it gets an "interpolate"

exceptions.TypeError: cannot concatenate 'str' and 'Interpolate' objects

Why it is not passing the string as expected? I tried to cast it as str() and it just print the Interpolate command, like if it was not processed.

  • Do these different builder run in different slaves with actual different architecture? – hithwen May 26 '14 at 09:46
  • No, I have a single slave that run 4 builders; these 4 builders trigger this one builder, which is on the same slave. The objective is to have each of these 4, to pass a string to the one builder, which tells the architecture to use for testing. I was looking on the Buildbot git site and I saw a couple of issues with builders on different slaves, and with Interpolate on git steps, if I recall correctly. This is not the same case. –  May 26 '14 at 22:24
  • I know this is a long shot but did you ever find the answer to this? I have the same problem and not sure how to fix it. – incubus Jun 08 '18 at 16:58
  • @john did you find a resolution to this problem? I'm not quite sure how to treat these `Interpolate` objects and make them be rendered as strings... – peetonn Sep 10 '18 at 18:10
  • @peetonn unfortunately not. It wasn't a blocker for me so I have a 'TODO' in my code to go back and try and understand it when I have some more time. I'll update this thread if I ever get to the bottom of it. – incubus Sep 12 '18 at 08:49
  • @john I've looked into the [source code](https://github.com/buildbot/buildbot/blob/5330f23abf61934397a318d5d68933e2f4ddc9a2/master/buildbot/process/properties.py#L588) and found that there's a [getRenderFor](https://github.com/buildbot/buildbot/blob/5330f23abf61934397a318d5d68933e2f4ddc9a2/master/buildbot/process/properties.py#L765) method which takes `build` as an argument. This makes me think that `Interpolate` object requires a `build` object in order to be rendered properly. Which actually makes sense when you think about it... – peetonn Sep 12 '18 at 18:46

0 Answers0