[Buildbot-devel] Extra properties on forced rebuild

Bruce Stephens bruce.stephens at isode.com
Wed Nov 19 17:34:01 UTC 2014


Bruce Stephens <bruce.stephens at isode.com> writes:

> I'd like to be able to add some extra properties to the rebuild
> form.
>
> Part of that is easy: I just copy forms.html to the buildbot master's
> "templates" directory and add one or more <input/> tags.
>
> But then what do I need to do? The value of those inputs doesn't seem to
> be recorded anywhere presumably because getAndCheckProperties doesn't
> think it's valid, but from then I'm lost in the multiple layers of
> abstraction and have no idea what, exactly, I need to do!

With the assistance of quite a few log.msg calls, here's how to do it:

in templates/forms.html set properties using property1name,
property1value (for various values of '1') something like this:

   <div class="row">
     <span class="label">Reason for re-running build:</span>
     <input type='text' name='comments' />
   </div>
   <div class="row">
     <span class="label">Build from clean:</span>
     <input type='hidden' name='property1name' value='clean'/>
     <input type='checkbox' name='property1value' />
   </div>

In master.cfg you end up with a property called 'clean' which can be
used in the usual way, so something like:

def doIfClean(step):
    clean = step.getProperty('clean');
    return clean == 'on'

...ShellCommand(command=[...],doStepIf=doIfClean)

(By the looks of it the configuration "property_name" and
"property_value" can be used to change acceptable property names and
values, but I don't care about that.)




More information about the devel mailing list