The idea is that, if a builder goes red because of a failed atomic operation, we should be able to enter property "mode" with value of "fresh" from the build console and get the build working again without having to log into the machine.
Details
Diff Detail
Event Timeline
If I get the idea right, you need to reconcile the parameter "mode" with the property "mode", giving the priority to the property.
The patch as is wouldn't do what you want.
Thanks for the pointers. To be honest I'm not very sure what I'm doing :) Does this look right?
No. Not really.
If I get what you are after, you need something like this:
from buildbot.process.properties import WithProperties, Property
...
SVN(...
mode=Property('mode', default=svnMode), ...)
And frankly, I'd rename 'svnMode' to just 'mode' to keep the naming consistent. Also please note that user provided mode would be passing through to the SVN object, so you might want to sanitize the values before calling SVN.
We only need build properties if we want to be able to trigger different svn checkout modes manually from the web interface. If we don't need that, the original change was probably fine.
I think Rick originally had a concern that we wouldn't want to use
mode=fresh by default, and that it should only be used if the build
actually breaks, and someone can kick off a new build with mode=fresh from
the web interface.
I'm actually fine just making it the default, as I don't see any real
negative consequences. Or at least making it the default for my builder.
Assuming you would fix the small issue with the line 59.
zorg/buildbot/builders/LLDBBuilder.py | ||
---|---|---|
59 | The check will always be true and you would never get 'update', since Property is an object renderable on a slave. mode = step.build.getProperty("mode", default='update') |
If I understand it correctly, you're trying to find a way to do clean svn checkout and clean build?
To do fresh checkout, you might want to use,
f.addStep(SVN(name=xxx, mode='full', method='fresh', .....))
as I don't think 'fresh' is a valid mode.
To do a clean build, you also need to delete build directory, because the object files are kept there based on build/compile step.
The check will always be true and you would never get 'update', since Property is an object renderable on a slave.
What you really want here is to use the 'default' parameter. Like this:
mode = step.build.getProperty("mode", default='update')