Package bitten :: Module queue :: Class BuildQueue

Class BuildQueue

object --+
         |
        BuildQueue

Enapsulates the build queue of an environment.

A build queue manages the the registration of build slaves and detection of repository revisions that need to be built.

Instance Methods
 
__init__(self, env, build_all=False, stabilize_wait=0, timeout=0)
Create the build queue.
Build
get_build_for_slave(self, name, properties)
Check whether one of the pending builds can be built by the build slave.
 
match_slave(self, name, properties)
Match a build slave against available target platforms.
 
populate(self)
Add a build for the next change on each build configuration to the queue.
 
reset_orphaned_builds(self)
Reset all in-progress builds to PENDING state if they've been running so long that the configured timeout has been reached.
 
should_delete_build(self, build, repos)

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

Properties

Inherited from object: __class__

Method Details

__init__(self, env, build_all=False, stabilize_wait=0, timeout=0)
(Constructor)

 
Create the build queue.
Parameters:
  • env - the Trac environment
  • build_all - whether older revisions should be built
  • stabilize_wait - The time in seconds to wait before considering the repository stable to create a build in the queue.
  • timeout - the time in seconds after which an in-progress build should be considered orphaned, and reset to pending state
Overrides: object.__init__

get_build_for_slave(self, name, properties)

 
Check whether one of the pending builds can be built by the build slave.
Parameters:
  • name (basestring) - the name of the slave
  • properties (dict) - the slave configuration
Returns: Build
the allocated build, or None if no build was found

match_slave(self, name, properties)

 
Match a build slave against available target platforms.
Parameters:
  • name (basestring) - the name of the slave
  • properties (dict) - the slave configuration
Returns:
the list of platforms the slave matched

populate(self)

 

Add a build for the next change on each build configuration to the queue.

The next change is the latest repository check-in for which there isn't a corresponding build on each target platform. Repeatedly calling this method will eventually result in the entire change history of the build configuration being in the build queue.

reset_orphaned_builds(self)

 

Reset all in-progress builds to PENDING state if they've been running so long that the configured timeout has been reached.

This is used to cleanup after slaves that have unexpectedly cancelled a build without notifying the master, or are for some other reason not reporting back status updates.