[Buildbot-devel] Create collection of build steps

Mateusz Loskot mateusz at loskot.net
Fri Sep 29 22:33:35 UTC 2006


Mark Pauley wrote:
> Notice that you're passing one argument (a step) to addStep in the case
> where it doesn't work, but several to addStep when it does work.

Mark,

Thanks. Yes, I've already learned my try was incorrect.

> maybe what you want to do is
> 
> f1.steps.append(commonSteps["make"])
> f1.steps.append(commonSteps["compile"])

I like this one.
Does it mean I can access 'steps' collection, member of the
BuildFactory, and use it directly in master.cfg file?


> or (since the s method just creates a 2-tuple)
> 
> f1.addStep(commonSteps["make"][0], commonSteps["make"][1])
> 
> etc.

It's less readable.
I like the first idea with 'steps' collection.

> either way seems a bit hacky to me, as they violate encapsulation..
> perhaps the buildfactory needs to respond to either the append or
> appendStep method?

Absolutely, very good point.
That's why I'm asking about accessing 'steps' above.
Yes, I'd vote for appendStep or something similar, or may be addSteps.
addSteps could add all steps from given list, and order them as
in the list:

commonSteps["configure"] = s(...)
commonSteps["make"] = s(...)

specificStep1 = s(...)
specificStep2 = s(...)

finalStepsList = [
    specificStep1,
    commonSteps["configure"],
    specificStep2,
    commonSteps["make"]
]

f1.addSteps(finalStepsList)


The idea is to keep definition of common steps in one place, to not to
repeat definitions for every addStep() call.
Also, it's possible to *compose* variations of lists of steps
(finalStepsList), etc.

Note, I'm still a newbie so I may not see every important detail
around, so I'm sorry if my proposals do not make sense for BuildBot.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net




More information about the devel mailing list