[Buildbot-devel] Automated release builds

Andy Howell AndyHowell at austin.rr.com
Sat Sep 11 06:33:04 UTC 2010


On 09/09/2010 11:35 PM, Andy Howell wrote:
>> The "try" functionality might be better suited to this particular
>> purpose, as it does not inject a new Change object.  But the Change
>> Hooks are new and it would be interesting to see if they're
>> better-suited to the purpose!
>>
>> Dustin
>> 
> I think I'll give the change hooks a try. It doesn't look like I can set properties via
> the "try" functionality. I need to pass in some options by way of properties. The "Change"
> should allow me to do that, with some slight modifications to hooks/base.py or a custom
> hooks/ dialect.
> 

With a slight tweak of the hooks/base.py, I have this working. I made a simple script to
submit a POST request. The request can set any of the Change attributes, including properties.

I took the dead simple and flexible option specifying properties. Each property is
specified as python code to create a dictionary. Example: "{'myProp':['one', 'two']}"
The property string is passed to 'eval', allowing arbitrary python code can be specified
for the property value. Since its eval'd before its sent to buildbot, it shouldn't be too
much of a security risk.

This let me submit a request, but didn't return the resulting request details. I modified
status/web/change_hook render_POST and submitChanges methods a bit to return a JSON
encoding of the Change.asDict().

Does this seem like a reasonable approach?

Regards,

	Andy




More information about the devel mailing list