[Buildbot-devel] tips for creating new P4-based source buildStep ?

Stephan Koledin skoledin at gmail.com
Tue Mar 5 00:45:33 UTC 2013

Hello. Please excuse this buildbot newbie for any missteps / list 
protocol breaches.

I'm in the process of rolling out a new buildbot system, and running 
into a situation where I think I know what I need to do, but would 
appreciate some perspective or tips on the best way to go about it.

In general, our checkout and build process is fairly complex and 
involves several mixed steps and several different areas within a 
P4(Perforce) source control space/depot. That said, I think I've reached 
a point where the best thing to do would be to create a new, slightly 
customized P4 (Source) buildStep.  Specifically, one of the things I'm 
looking to do is override the current sourceDataMatches method, but I 
would prefer to also have the option down the line of still using the 
stock P4 source buildStep, so I'm hesitant to just quickly tweak the 
source code and move on.

I'm not neccessarily sure this is something that makes sense to push 
back into the main source tree as a buildbot "feature", since it's a bit 
of a hack, but at the same time I'd like to generally "do the right thing".

Since P4 is an oldsource style buildStep, my assumption here is that I 
need to make some mods on both the buildbot/steps/source master side of 
the house and also within buildslave/commands/ (where most/all of my 
mods would actually live).

Is this just as simple (mostly) as creating a new 
buildslave/commands/p4Custom.py that does what I want (primarily 
inheriting from the  existing p4.py / P4Base) and having a SlaveSource 
that sets a RemoteCommand of "p4Custom" instead of "p4" ? Or is there 
more to referencing a new remote source step than that?

Does this sound like the right way to go about things, or am I missing 
something obvious here? One of my prime concerns is long-term 
maintainability, which is also why I'm leaving towards implementing a 
"new" step rather than just silently modding the behavior of the 
existing P4 source step.

Thanks in advance for any advice on this. I really just want to make 
sure I'm headed in the right direction before committing to this approach.

More information about the devel mailing list