[Buildbot-devel] accessing force scheduler values in ShellCommand

Jürgen Schulz-Brüssel juergen.schulz-bruessel at thinkproject.com
Tue Apr 23 09:19:44 UTC 2013


Hi,

thanks! That was exactly what I was looking for. I was already 
subclassing ShellCommand. I was not aware that self.build is available 
there. Sometimes it is a little bit hard to find the intended way since 
so few examples are available. Documentation became really better the 
last years, but more examples would be so helpful!

Best
     Jürgen

> Hi,
>
> You probably want to use a subclassed ShellCommand, and not use WithProperties.
>
> I think you have to do this all in start (so that self.build is definitely available).
>
> You can access all the build properties via self.build - however that will contain ALL properties. To limit it to just force build fields you need to filter based on the source of the property:
>
>      def start(self):
>          for key, val_source in self.build.getProperties().properties.items():
>              value, source = val_source
>
>              if source != "Force Build Form":
>                  continue
>
> (I'm not 100% if that is the actual value of source you need to filter by, but iirc it matches what you see in the WebStatus view for a build).
>
> There are probably neater ways to get the list of properties that are similar - the API has changed in recent buildbot releases - but this basic approach is working for me in 0.8.7.
>
> Cheers,
> John
>
> On 23 Apr 2013, at 09:09, Jürgen Schulz-Brüssel <juergen.schulz-bruessel at thinkproject.com> wrote:
>
>> Hi,
>>
>> for a buildstep triggered by a force scheduler I would like to access
>> the values provided in the form if needed (i.e.: if submitted). My
>> buildstep is a subclassed ShellCommand. I would like to iterate over the
>> values (provided by the form and submitter) like I would do for example
>> for kwargs values:
>>
>> for key in kwargs:
>> ...
>>
>> Or is it just possible to access the values with the Withproperties command?
>>
>> My idea is to collect all neccessary values in '__init__' and use these
>> in 'start'. Is there any reasonable way to do this?
>>
>> Best regards
>>      Jürgen
>>
>> -- 
>>
>> think project! International GmbH & Co. KG
>> Jürgen Schulz-Brüssel
>> Developer
>>
>> Phone +49 30 92 10 17-83
>> Fax +49 30 92 10 17-50
>> juergen.schulz-bruessel at thinkproject.com
>>
>> Legal information (imprint): www.thinkproject.com/en/info
>>
>> Rechtliche Informationen zum Absender (Impressum): www.thinkproject.com/de/info
>>
>>
>> ------------------------------------------------------------------------------
>> Try New Relic Now & We'll Send You this Cool Shirt
>> New Relic is the only SaaS-based application performance monitoring service
>> that delivers powerful full stack analytics. Optimize and monitor your
>> browser, app, & servers with just a few lines of code. Try New Relic
>> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
>> _______________________________________________
>> Buildbot-devel mailing list
>> Buildbot-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/buildbot-devel






More information about the devel mailing list