[Buildbot-devel] ForceScheduler and property order-of-precedence

A.M. agentm at themactionfaction.com
Wed Feb 11 19:01:39 UTC 2015


Hello,

We have hit a case where the property order-of-precedence application isn't
practical. The order is documented here:
"If the same property is supplied in multiple places, the final appearance
takes precedence. For example, a property set in a builder configuration
will override one supplied by a scheduler."
http://docs.buildbot.net/current/manual/cfg-properties.html

For the ForceScheduler, however, this doesn't seem to make sense as in the
following example.

test_factory = BuildFactory()
test_factory.addStep(ShellCommand(command=['echo',
Interpolate('%(prop:test_property)s')]))

test_builder = BuilderConfig(name='force_sched_test',
                            
properties={'test_property':'SETBYBUILDERCONFIG'},
                             slavenames=[conf['slaves'][0].slavename],
                             factory=test_factory)

test_scheduler = ForceScheduler(name='f_sched',
                               
properties=[StringParameter(name='test_property',
default='SETBYFORCESCHEDULER'),
                                           
StringParameter(name='test_property2', default='SETBYFORCESCHEDULER2')],
                                builderNames=[test_builder.name])

In this case, "test_property", set by the ForceScheduler, is effectively
ignored when the ForceScheduler is forced because the property's value is
superseded by the BuilderConfig's "test_property" while "test_property2"
can be set by the ForceScheduler as desired. 

In all cases, what we would like is for the properties set by the
ForceScheduler (usually a human) to override what we view as the
BuilderConfig's defaults. This is useful, for example, when QA is testing
something new and want to kick off a slightly different build through the
ForceScheduler. We can empty the BuilderConfig of properties, but then we
have to pass these properties from every invoking scheduler, which seems
clunky.

Basically, we want BuilderConfig properties which apply as defaults only if
nothing else sets them.

Is there an obvious workaround which we are missing?

Thanks for any advice.

Cheers,
M




More information about the devel mailing list