Package buildbot :: Package steps :: Package source :: Module base :: Class Source
[frames] | no frames]

Class Source

source code

                            object --+        
                                     |        
process.properties.PropertiesMixin --+        
                                     |        
           process.buildstep.BuildStep --+    
                                         |    
        process.buildstep.LoggingBuildStep --+
                                             |
                                            Source
Known Subclasses:

This is a base class to generate a source tree in the buildslave. Each version control system has a specialized subclass, and is expected to override __init__ and implement computeSourceRevision() and startVC(). The class as a whole builds up the self.args dictionary, then starts a RemoteCommand with those arguments.

Instance Methods
 
__init__(self, workdir=None, mode='update', alwaysUseLatest=False, timeout=1200, retry=None, env=None, logEnviron=True, description=None, descriptionDone=None, descriptionSuffix=None, codebase='', **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
updateSourceProperty(self, name, value, source='')
Update a property, indexing the proeprty by codebase if codebase is not ''.
source code
 
setStepStatus(self, step_status) source code
 
setDefaultWorkdir(self, workdir) source code
 
describe(self, done=False) source code
 
computeSourceRevision(self, changes)
Each subclass must implement this method to do something more precise than -rHEAD every time.
source code
 
start(self) source code

Inherited from process.buildstep.LoggingBuildStep: addLogFile, buildCommandKwargs, checkDisconnect, commandComplete, createSummary, evaluateCommand, getText, getText2, interrupt, maybeGetText2, setStatus, setupLogfiles, startCommand

Inherited from process.buildstep.BuildStep: __provides__, acquireLocks, addCompleteLog, addFactoryArguments, addHTMLLog, addLog, addLogObserver, addURL, failed, finished, getLog, getSlaveName, releaseLocks, runCommand, setBuild, setBuildSlave, setProgress, setupProgress, slaveVersion, slaveVersionIsOlderThan, startStep

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from process.properties.PropertiesMixin: __providedBy__, getProperties, getProperty, hasProperty, has_key, render, setProperty

Static Methods

Inherited from process.buildstep.BuildStep: __new__

Class Variables
  renderables = ['logfiles', 'lazylogfiles', 'description', 'des...
  description = None
hash(x)
  descriptionDone = None
hash(x)
  descriptionSuffix = None
hash(x)
  haltOnFailure = True
  flunkOnFailure = True
  notReally = False
  branch = None
hash(x)

Inherited from process.buildstep.LoggingBuildStep: cmd, logfiles, parms, progressMetrics

Inherited from process.buildstep.BuildStep: __implemented__, alwaysRun, build, doStepIf, flunkOnWarnings, hideStepIf, locks, name, progress, set_runtime_properties, step_status, useProgress, warnOnFailure, warnOnWarnings

Properties

Inherited from object: __class__

Method Details

__init__(self, workdir=None, mode='update', alwaysUseLatest=False, timeout=1200, retry=None, env=None, logEnviron=True, description=None, descriptionDone=None, descriptionSuffix=None, codebase='', **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • workdir (string) - local directory (relative to the Builder's root) where the tree should be placed
  • alwaysUseLatest (boolean) - whether to always update to the most recent available sources for this build.

    Normally the Source step asks its Build for a list of all Changes that are supposed to go into the build, then computes a 'source stamp' (revision number or timestamp) that will cause exactly that set of changes to be present in the checked out tree. This is turned into, e.g., 'cvs update -D timestamp', or 'svn update -r revnum'. If alwaysUseLatest=True, bypass this computation and always update to the latest available sources for each build.

    The source stamp helps avoid a race condition in which someone commits a change after the master has decided to start a build but before the slave finishes checking out the sources. At best this results in a build which contains more changes than the buildmaster thinks it has (possibly resulting in the wrong person taking the blame for any problems that result), at worst is can result in an incoherent set of sources (splitting a non-atomic commit) which may not build at all.

  • logEnviron (boolean) - If this option is true (the default), then the step's logfile will describe the environment variables on the slave. In situations where the environment is not relevant and is long, it may be easier to set logEnviron=False.
  • codebase (string) - Specifies which changes in a build are processed by the step. The default codebase value is ''. The codebase must correspond to a codebase assigned by the codebaseGenerator. If no codebaseGenerator is defined in the master then codebase doesn't need to be set, the default value will then match all changes.
Overrides: object.__init__

updateSourceProperty(self, name, value, source='')

source code 

Update a property, indexing the proeprty by codebase if codebase is not ''. Source steps should generally use this instead of setProperty.

setStepStatus(self, step_status)

source code 
Overrides: process.buildstep.BuildStep.setStepStatus

setDefaultWorkdir(self, workdir)

source code 
Overrides: process.buildstep.BuildStep.setDefaultWorkdir

describe(self, done=False)

source code 
Overrides: process.buildstep.BuildStep.describe

computeSourceRevision(self, changes)

source code 

Each subclass must implement this method to do something more precise than -rHEAD every time. For version control systems that use repository-wide change numbers (SVN, P4), this can simply take the maximum such number from all the changes involved in this build. For systems that do not (CVS), it needs to create a timestamp based upon the latest Change, the Build's treeStableTimer, and an optional self.checkoutDelay value.

start(self)

source code 
Overrides: process.buildstep.BuildStep.start

Class Variable Details

renderables

Value:
['logfiles',
 'lazylogfiles',
 'description',
 'descriptionDone',
 'descriptionSuffix',
 'workdir']