Package buildbot :: Module master :: Class BuildMaster
[frames] | no frames]

Class BuildMaster

source code

 twisted.application.service.Service --+    
                                       |    
twisted.application.service.MultiService --+
                                           |
                                          BuildMaster

Instance Methods
 
__init__(self, basedir, configFileName='master.cfg') source code
 
startService(self) source code
buildbot.status.builder.Status
getStatus(self) source code
 
loadTheConfigFile(self, configFile=None) source code
 
loadConfig(self, f, checkOnly=False)
Internal function to load a specific configuration file.
source code
 
loadConfig_Metrics(self, metrics_config) source code
 
loadConfig_Caches(self, caches_config, buildCacheSize, changeCacheSize) source code
 
loadDatabase(self, db_url, db_poll_interval=None) source code
 
loadConfig_Database(self, db_url, db_poll_interval) source code
 
loadConfig_Slaves(self, new_slaves) source code
 
loadConfig_Sources(self, sources) source code
 
loadConfig_DebugClient(self, debugPassword) source code
 
allSchedulers(self) source code
 
loadConfig_Builders(self, newBuilderData) source code
 
loadConfig_Status(self, status) source code
 
checkConfig_Schedulers(self, schedulers) source code
 
loadConfig_Schedulers(self, schedulers) source code
 
getObjectId(self)
Return the obejct id for this master, for associating state with the master.
source code
 
addChange(self, who=None, files=None, comments=None, author=None, isdir=None, is_dir=None, links=None, revision=None, when=None, when_timestamp=None, branch=None, category=None, revlink='', properties={}, repository='', project='')
Add a change to the buildmaster and act on it.
source code
 
subscribeToChanges(self, callback)
Request that callback be called with each Change object added to the cluster.
source code
 
addBuildset(self, **kwargs)
Add a buildset to the buildmaster and act on it.
source code
 
subscribeToBuildsets(self, callback)
Request that callback(bsid=bsid, ssid=ssid, reason=reason, properties=properties, builderNames=builderNames, external_idstring=external_idstring) be called whenever a buildset is added.
source code
 
maybeBuildsetComplete(*args, **kwargs)
Instructs the master to check whether the buildset is complete, and notify appropriately if it is.
source code
 
subscribeToBuildsetCompletions(self, callback)
Request that callback(bsid, result) be called whenever a buildset is complete.
source code
 
buildRequestAdded(self, bsid, brid, buildername)
Notifies the master that a build request is available to be claimed; this may be a brand new build request, or a build request that was previously claimed and unclaimed through a timeout or other calamity.
source code
 
subscribeToBuildRequests(self, callback)
Request that callback be invoked with a dictionary with keys brid (the build request id), bsid (buildset id) and buildername whenever a new build request is added to the database.
source code
 
pollDatabase(self) source code
 
pollDatabaseChanges(*args, **kwargs) source code
 
pollDatabaseBuildRequests(*args, **kwargs) source code
 
__provides__(...)
Special descriptor for class __provides__

Inherited from twisted.application.service.MultiService: __iter__, addService, getServiceNamed, privilegedStartService, removeService, stopService

Inherited from twisted.application.service.Service: __getstate__, __providedBy__, disownServiceParent, setName, setServiceParent

Class Variables
  debug = 0
  manhole = None
hash(x)
  debugPassword = None
hash(x)
  title = '(unspecified)'
  titleURL = None
hash(x)
  buildbotURL = None
hash(x)
  change_svc = None
hash(x)
  properties = Properties(**{})
  RECLAIM_BUILD_INTERVAL = 600
  UNCLAIMED_BUILD_FACTOR = 6
  WARNING_UNCLAIMED_COUNT = 10000
  __implemented__ = <implementedBy buildbot.master.BuildMaster>

Inherited from twisted.application.service.Service: name, parent, running

Method Details

__init__(self, basedir, configFileName='master.cfg')
(Constructor)

source code 
Overrides: twisted.application.service.MultiService.__init__

startService(self)

source code 
Overrides: twisted.application.service.Service.startService

loadConfig(self, f, checkOnly=False)

source code 

Internal function to load a specific configuration file. Any errors in the file will be signalled by raising a failure. Returns a deferred.

getObjectId(self)

source code 

Return the obejct id for this master, for associating state with the master.

Returns:
ID, via Deferred

addChange(self, who=None, files=None, comments=None, author=None, isdir=None, is_dir=None, links=None, revision=None, when=None, when_timestamp=None, branch=None, category=None, revlink='', properties={}, repository='', project='')

source code 

Add a change to the buildmaster and act on it.

This is a wrapper around ChangesConnectorComponent.addChange which also acts on the resulting change and returns a Change instance.

Note that all parameters are keyword arguments, although who, files, and comments can be specified positionally for backward-compatibility.

Parameters:
  • author (unicode string) - the author of this change
  • who - deprecated name for author
  • files - a list of filenames that were changed
  • comments - user comments on the change
  • is_dir - deprecated
  • isdir - deprecated name for is_dir
  • links (list of unicode strings) - a list of links related to this change, e.g., to web viewers or review pages
  • revision (unicode string) - the revision identifier for this change
  • when_timestamp (datetime instance or None) - when this change occurred, or the current time if None
  • when (integer (UNIX epoch time) or None) - deprecated name and type for when_timestamp
  • branch (list of unicode strings) - the branch on which this change took place
  • category (unicode string) - category for this change (arbitrary use by Buildbot users)
  • revlink (unicode string) - link to a web view of this revision
  • properties (dictionary with string keys and simple values (JSON-able). Note that the property source is not included in this dictionary.) - properties to set on this change
  • repository (unicode string) - the repository in which this change took place
  • project (unicode string) - the project this change is a part of
Returns:
Change instance via Deferred

subscribeToChanges(self, callback)

source code 

Request that callback be called with each Change object added to the cluster.

Note: this method will go away in 0.9.x

addBuildset(self, **kwargs)

source code 

Add a buildset to the buildmaster and act on it. Interface is identical to buildbot.db.buildsets.BuildsetConnectorComponent.addBuildset, including returning a Deferred, but also potentially triggers the resulting builds.

subscribeToBuildsets(self, callback)

source code 

Request that callback(bsid=bsid, ssid=ssid, reason=reason, properties=properties, builderNames=builderNames, external_idstring=external_idstring) be called whenever a buildset is added. Properties is a dictionary as expected for BuildsetsConnectorComponent.addBuildset.

Note that this only works for buildsets added on this master.

Note: this method will go away in 0.9.x

maybeBuildsetComplete(*args, **kwargs)

source code 

Instructs the master to check whether the buildset is complete, and notify appropriately if it is.

Note that buildset completions are only reported on the master on which the last build request completes.

Decorators:
  • @defer.deferredGenerator

subscribeToBuildsetCompletions(self, callback)

source code 

Request that callback(bsid, result) be called whenever a buildset is complete.

Note: this method will go away in 0.9.x

buildRequestAdded(self, bsid, brid, buildername)

source code 

Notifies the master that a build request is available to be claimed; this may be a brand new build request, or a build request that was previously claimed and unclaimed through a timeout or other calamity.

Parameters:
  • bsid - containing buildset id
  • brid - buildrequest ID
  • buildername - builder named by the build request

subscribeToBuildRequests(self, callback)

source code 

Request that callback be invoked with a dictionary with keys brid (the build request id), bsid (buildset id) and buildername whenever a new build request is added to the database. Note that, due to the delayed nature of subscriptions, the build request may already be claimed by the time callback is invoked.

Note: this method will go away in 0.9.x

pollDatabaseChanges(*args, **kwargs)

source code 
Decorators:
  • @defer.deferredGenerator

pollDatabaseBuildRequests(*args, **kwargs)

source code 
Decorators:
  • @defer.deferredGenerator

__provides__(...)

 
Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that
we can get declarations for objects without instance-specific
interfaces a bit quicker.

For example:

  >>> from zope.interface import Interface
  >>> class IFooFactory(Interface):
  ...     pass
  >>> class IFoo(Interface):
  ...     pass
  >>> class C(object):
  ...     implements(IFoo)
  ...     classProvides(IFooFactory)
  >>> [i.getName() for i in C.__provides__]
  ['IFooFactory']

  >>> [i.getName() for i in C().__provides__]
  ['IFoo']

Overrides: twisted.application.service.Service.__provides__