Package buildbot :: Package db :: Module builds :: Class BuildsConnectorComponent
[frames] | no frames]

Class BuildsConnectorComponent

source code

               object --+    
                        |    
base.DBConnectorComponent --+
                            |
                           BuildsConnectorComponent

A DBConnectorComponent to handle a little bit of information about builds. Avaialble at master.db.buildrequests.

NOTE: The interface for this module will change - the builds table duplicates some information available in pickles, without including all such information. Do not depend on this API.

Note that a single build may be represented in many rows in the builds table, as it the builds table represents

Builds are represented as dictionaries with keys bid (the build ID, globally unique), number (the build number, unique only within this master and builder), brid (the ID of the build request that caused this build), start_time, and finish_time (datetime objects, or None).

Instance Methods
 
getBuild(self, bid)
Get a single build, in the format described above.
source code
 
getBuildsForRequest(self, brid)
Get a list of builds for the given build request.
source code
 
addBuild(self, brid, number, _reactor=reactor)
Add a new build, recorded as having started now.
source code
 
finishBuilds(self, bids, _reactor=reactor)
Mark builds as finished, with finish_time now.
source code

Inherited from base.DBConnectorComponent: __init__

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

Class Variables

Inherited from base.DBConnectorComponent: connector

Instance Variables

Inherited from base.DBConnectorComponent: db

Properties

Inherited from object: __class__

Method Details

getBuild(self, bid)

source code 

Get a single build, in the format described above. Returns None if there is no such build.

Parameters:
  • bid (integer) - build id
Returns:
Build dictionary as above or None, via Deferred

getBuildsForRequest(self, brid)

source code 

Get a list of builds for the given build request. The resulting build dictionaries are in exactly the same format as for getBuild.

Parameters:
  • brids - list of build request ids
Returns:
List of build dictionaries as above, via Deferred

addBuild(self, brid, number, _reactor=reactor)

source code 

Add a new build, recorded as having started now.

Parameters:
  • brid - build request id
  • number - build number
  • _reactor - reactor to use (for testing)
  • _race_hook - hook for testing
Returns:
build ID via Deferred

finishBuilds(self, bids, _reactor=reactor)

source code 

Mark builds as finished, with finish_time now. This is done unconditionally, even if the builds are already finished.

Parameters:
  • bids (list) - build ids
  • _reactor - reactor to use (for testing)
Returns:
Deferred