Package buildbot :: Package schedulers :: Module base :: Class BaseScheduler
[frames] | no frames]

Class BaseScheduler

source code

 twisted.application.service.Service --+    
                                       |    
twisted.application.service.MultiService --+
                                           |
                    util.ComparableMixin --+
                                           |
                              object --+   |
                                       |   |
                   util.state.StateMixin --+
                                           |
                                          BaseScheduler
Known Subclasses:

Base class for all schedulers; this provides the equipment to manage reconfigurations and to handle basic scheduler state. It also provides utility methods to begin various sorts of builds.

Subclasses should add any configuration-derived attributes to base.Scheduler.compare_attrs.

Instance Methods
 
__init__(self, name, builderNames, properties, codebases={'': {}})
Initialize a Scheduler.
source code
 
startService(self) source code
 
findNewSchedulerInstance(self, new_config) source code
 
stopService(self) source code
 
listBuilderNames(self)
Returns the list of builder names
source code
 
getPendingBuildTimes(self)
Returns a list of the next times that builds are scheduled, if known.
source code
 
startConsumingChanges(self, fileIsImportant=None, change_filter=None, onlyImportant=False)
Subclasses should call this method from startService to register to receive changes.
source code
 
gotChange(self, change, important)
Called when a change is received; returns a Deferred.
source code
 
addBuildsetForLatest(*args, **kwargs)
Add a buildset for the 'latest' source in the given branch, repository, and project.
source code
 
addBuildsetForSourceStampDetails(*args, **kwargs)
Given details about the source code to build, create a source stamp and then add a buildset for it.
source code
 
addBuildsetForSourceStampSetDetails(*args, **kwargs) source code
 
addBuildsetForChanges(*args, **kwargs) source code
 
addBuildsetForSourceStamp(*args, **kwargs)
Add a buildset for the given, already-existing sourcestamp.
source code
 
__provides__(...)
Special descriptor for class __provides__

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

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

Inherited from util.ComparableMixin: __cmp__, __hash__

Inherited from util.state.StateMixin: getState, setState

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

Class Variables
  DefaultCodebases = {'': {}}
  compare_attrs = ('name', 'builderNames', 'properties', 'codeba...
  __implemented__ = <implementedBy buildbot.schedulers.base.Base...

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

Instance Variables
  name
name of this scheduler; used to identify replacements on reconfig
  builderNames
list of builder names to start in each buildset
  properties
properties that are contributed to each buildset
Properties

Inherited from object: __class__

Method Details

__init__(self, name, builderNames, properties, codebases={'': {}})
(Constructor)

source code 

Initialize a Scheduler.

Parameters:
  • name (unicode) - name of this scheduler (used as a key for state)
  • builderNames (list of unicode) - list of builders this scheduler may start
  • properties (dictionary) - properties to add to builds triggered by this scheduler
  • codebases (dict with following struct: key: '<codebase>' value: {'repository':'<repo>', 'branch':'<br>', 'revision:'<rev>'}) - codebases that are necessary to process the changes
  • consumeChanges (boolean) - true if this scheduler wishes to be informed about the addition of new changes. Defaults to False. This should be passed explicitly from subclasses to indicate their interest in consuming changes.
Overrides: object.__init__

startService(self)

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

stopService(self)

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

startConsumingChanges(self, fileIsImportant=None, change_filter=None, onlyImportant=False)

source code 

Subclasses should call this method from startService to register to receive changes. The BaseScheduler class will take care of filtering the changes (using change_filter) and (if fileIsImportant is not None) classifying them. See gotChange. Returns a Deferred.

Parameters:
  • fileIsImportant (callable) - a callable provided by the user to distinguish important and unimportant changes
  • change_filter (buildbot.changes.filter.ChangeFilter instance) - a filter to determine which changes are even considered by this scheduler, or None to consider all changes
  • onlyImportant (boolean) - If True, only important changes, as specified by fileIsImportant, will be added to the buildset.

gotChange(self, change, important)

source code 

Called when a change is received; returns a Deferred. If the fileIsImportant parameter to startConsumingChanges was None, then all changes are considered important. The codebase of the change has always an entry in the codebases dictionary of the scheduler.

Parameters:
  • change (buildbot.changes.changes.Change instance) - the new change object
  • important (boolean) - true if this is an important change, according to fileIsImportant.
Returns:
Deferred

addBuildsetForLatest(*args, **kwargs)

source code 

Add a buildset for the 'latest' source in the given branch, repository, and project. This will create a relative sourcestamp for the buildset.

This method will add any properties provided to the scheduler constructor to the buildset, and will call the master's addBuildset method with the appropriate parameters.

Parameters:
  • reason (unicode string) - reason for this buildset
  • external_idstring - external identifier for this buildset, or None
  • branch - branch to build (note that None often has a special meaning)
  • repository - repository name for sourcestamp
  • project - project name for sourcestamp
  • builderNames - builders to name in the buildset (defaults to self.builderNames)
  • properties (buildbot.process.properties.Properties) - a properties object containing initial properties for the buildset
Returns:
(buildset ID, buildrequest IDs) via Deferred
Decorators:
  • @defer.inlineCallbacks

addBuildsetForSourceStampDetails(*args, **kwargs)

source code 

Given details about the source code to build, create a source stamp and then add a buildset for it.

Parameters:
  • reason (unicode string) - reason for this buildset
  • external_idstring - external identifier for this buildset, or None
  • branch - branch to build (note that None often has a special meaning)
  • repository - repository name for sourcestamp
  • project - project name for sourcestamp
  • revision - revision to build - default is latest
  • builderNames - builders to name in the buildset (defaults to self.builderNames)
  • properties (buildbot.process.properties.Properties) - a properties object containing initial properties for the buildset
Returns:
(buildset ID, buildrequest IDs) via Deferred
Decorators:
  • @defer.inlineCallbacks

addBuildsetForSourceStampSetDetails(*args, **kwargs)

source code 
Decorators:
  • @defer.inlineCallbacks

addBuildsetForChanges(*args, **kwargs)

source code 
Decorators:
  • @defer.inlineCallbacks

addBuildsetForSourceStamp(*args, **kwargs)

source code 

Add a buildset for the given, already-existing sourcestamp.

This method will add any properties provided to the scheduler constructor to the buildset, and will call the master's BuildMaster.addBuildset method with the appropriate parameters, and return the same result.

Parameters:
  • reason (unicode string) - reason for this buildset
  • external_idstring - external identifier for this buildset, or None
  • properties (buildbot.process.properties.Properties) - a properties object containing initial properties for the buildset
  • builderNames - builders to name in the buildset (defaults to self.builderNames)
  • setid - idenitification of a set of sourcestamps
Returns:
(buildset ID, buildrequest IDs) via Deferred
Decorators:
  • @defer.inlineCallbacks

__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.

Overrides: util.state.StateMixin.__provides__

Class Variable Details

compare_attrs

Value:
('name', 'builderNames', 'properties', 'codebases')

__implemented__

Value:
<implementedBy buildbot.schedulers.base.BaseScheduler>