Package buildbot :: Package db :: Module model :: Class Model
[frames] | no frames]

Class Model

source code

               object --+    
                        |    
base.DBConnectorComponent --+
                            |
                           Model

DBConnector component to handle the database model; an instance is available at master.db.model.

This class has attributes for each defined table, as well as methods to handle schema migration (using sqlalchemy-migrate). View the source to see the table definitions.

Note that the Buildbot metadata is never bound to an engine, since that might lead users to execute queries outside of the thread pool.

Instance Methods
 
is_current(self)
Returns true (via deferred) if the database's version is up to date.
source code
 
upgrade(self)
Upgrade the database to the most recent schema version, returning a deferred.
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
  metadata = MetaData(None)
  buildrequests = Table('buildrequests', MetaData(None), Column(...
A BuildRequest is a request for a particular build to be performed.
  buildrequest_claims = Table('buildrequest_claims', MetaData(No...
Each row in this table represents a claimed build request, where the claim is made by the object referenced by objectid.
  builds = Table('builds', MetaData(None), Column('id', Integer(...
This table contains basic information about each build.
  buildset_properties = Table('buildset_properties', MetaData(No...
This table contains input properties for buildsets
  buildsets = Table('buildsets', MetaData(None), Column('id', In...
This table represents BuildSets - sets of BuildRequests that share the same original cause and source information.
  change_files = Table('change_files', MetaData(None), Column('c...
Files touched in changes
  change_links = Table('change_links', MetaData(None), Column('c...
Links (URLs) for changes
  change_properties = Table('change_properties', MetaData(None),...
Properties for changes
  changes = Table('changes', MetaData(None), Column('changeid', ...
Changes to the source code, produced by ChangeSources
  patches = Table('patches', MetaData(None), Column('id', Intege...
Patches for SourceStamps that were generated through the try mechanism
  sourcestamp_changes = Table('sourcestamp_changes', MetaData(No...
The changes that led up to a particular source stamp.
  sourcestamps = Table('sourcestamps', MetaData(None), Column('i...
A sourcestamp identifies a particular instance of the source code.
  scheduler_changes = Table('scheduler_changes', MetaData(None),...
This table references "classified" changes that have not yet been "processed".
  scheduler_upstream_buildsets = Table('scheduler_upstream_build...
This table references buildsets in which a particular scheduler is interested.
  schedulers = Table('schedulers', MetaData(None), Column('sched...
This table records the "state" for each scheduler.
  objects = Table('objects', MetaData(None), Column('id', Intege...
This table uniquely identifies objects that need to maintain state across invocations.
  object_state = Table('object_state', MetaData(None), Column('o...
This table stores key/value pairs for objects, where the key is a string and the value is a JSON string.
  repo_path = '/home/dustin/code/buildbot/t/buildbot/master/buil...
path to the SQLAlchemy-Migrate 'repository'

Inherited from base.DBConnectorComponent: connector

Instance Variables

Inherited from base.DBConnectorComponent: db

Properties

Inherited from object: __class__

Class Variable Details

buildrequests

A BuildRequest is a request for a particular build to be performed. Each BuildRequest is a part of a BuildSet. BuildRequests are claimed by masters, to avoid multiple masters running the same build.

Value:
Table('buildrequests', MetaData(None), Column('id', Integer(), table=<\
buildrequests>, primary_key=True, nullable=False), Column('buildsetid'\
, Integer(), ForeignKey('buildsets.id'), table=<buildrequests>, nullab\
le=False), Column('buildername', String(length=256, convert_unicode=Fa\
lse, assert_unicode=None, unicode_error=None, _warn_on_bytestring=Fals\
e), table=<buildrequests>, nullable=False), Column('priority', Integer\
(), table=<buildrequests>, nullable=False, server_default=DefaultClaus\
e('0', for_update=False)), Column('complete', Integer(), table=<buildr\
...

buildrequest_claims

Each row in this table represents a claimed build request, where the claim is made by the object referenced by objectid.

Value:
Table('buildrequest_claims', MetaData(None), Column('brid', Integer(),\
 ForeignKey('buildrequests.id'), table=<buildrequest_claims>), Column(\
'objectid', Integer(), ForeignKey('objects.id'), table=<buildrequest_c\
laims>), Column('claimed_at', Integer(), table=<buildrequest_claims>, \
nullable=False), schema=None)

builds

This table contains basic information about each build. Note that most data about a build is still stored in on-disk pickles.

Value:
Table('builds', MetaData(None), Column('id', Integer(), table=<builds>\
, primary_key=True, nullable=False), Column('number', Integer(), table\
=<builds>, nullable=False), Column('brid', Integer(), ForeignKey('buil\
drequests.id'), table=<builds>, nullable=False), Column('start_time', \
Integer(), table=<builds>, nullable=False), Column('finish_time', Inte\
ger(), table=<builds>), schema=None)

buildset_properties

This table contains input properties for buildsets

Value:
Table('buildset_properties', MetaData(None), Column('buildsetid', Inte\
ger(), ForeignKey('buildsets.id'), table=<buildset_properties>, nullab\
le=False), Column('property_name', String(length=256, convert_unicode=\
False, assert_unicode=None, unicode_error=None, _warn_on_bytestring=Fa\
lse), table=<buildset_properties>, nullable=False), Column('property_v\
alue', String(length=1024, convert_unicode=False, assert_unicode=None,\
 unicode_error=None, _warn_on_bytestring=False), table=<buildset_prope\
rties>, nullable=False), schema=None)

buildsets

This table represents BuildSets - sets of BuildRequests that share the same original cause and source information.

Value:
Table('buildsets', MetaData(None), Column('id', Integer(), table=<buil\
dsets>, primary_key=True, nullable=False), Column('external_idstring',\
 String(length=256, convert_unicode=False, assert_unicode=None, unicod\
e_error=None, _warn_on_bytestring=False), table=<buildsets>), Column('\
reason', String(length=256, convert_unicode=False, assert_unicode=None\
, unicode_error=None, _warn_on_bytestring=False), table=<buildsets>), \
Column('sourcestampid', Integer(), ForeignKey('sourcestamps.id'), tabl\
e=<buildsets>, nullable=False), Column('submitted_at', Integer(), tabl\
...

change_files

Files touched in changes

Value:
Table('change_files', MetaData(None), Column('changeid', Integer(), Fo\
reignKey('changes.changeid'), table=<change_files>, nullable=False), C\
olumn('filename', String(length=1024, convert_unicode=False, assert_un\
icode=None, unicode_error=None, _warn_on_bytestring=False), table=<cha\
nge_files>, nullable=False), schema=None)

change_links

Links (URLs) for changes

Value:
Table('change_links', MetaData(None), Column('changeid', Integer(), Fo\
reignKey('changes.changeid'), table=<change_links>, nullable=False), C\
olumn('link', String(length=1024, convert_unicode=False, assert_unicod\
e=None, unicode_error=None, _warn_on_bytestring=False), table=<change_\
links>, nullable=False), schema=None)

change_properties

Properties for changes

Value:
Table('change_properties', MetaData(None), Column('changeid', Integer(\
), ForeignKey('changes.changeid'), table=<change_properties>, nullable\
=False), Column('property_name', String(length=256, convert_unicode=Fa\
lse, assert_unicode=None, unicode_error=None, _warn_on_bytestring=Fals\
e), table=<change_properties>, nullable=False), Column('property_value\
', String(length=1024, convert_unicode=False, assert_unicode=None, uni\
code_error=None, _warn_on_bytestring=False), table=<change_properties>\
, nullable=False), schema=None)

changes

Changes to the source code, produced by ChangeSources

Value:
Table('changes', MetaData(None), Column('changeid', Integer(), table=<\
changes>, primary_key=True, nullable=False), Column('author', String(l\
ength=256, convert_unicode=False, assert_unicode=None, unicode_error=N\
one, _warn_on_bytestring=False), table=<changes>, nullable=False), Col\
umn('comments', String(length=1024, convert_unicode=False, assert_unic\
ode=None, unicode_error=None, _warn_on_bytestring=False), table=<chang\
es>, nullable=False), Column('is_dir', SmallInteger(), table=<changes>\
, nullable=False), Column('branch', String(length=256, convert_unicode\
...

patches

Patches for SourceStamps that were generated through the try mechanism

Value:
Table('patches', MetaData(None), Column('id', Integer(), table=<patche\
s>, primary_key=True, nullable=False), Column('patchlevel', Integer(),\
 table=<patches>, nullable=False), Column('patch_base64', Text(length=\
None, convert_unicode=False, assert_unicode=None, unicode_error=None, \
_warn_on_bytestring=False), table=<patches>, nullable=False), Column('\
patch_author', Text(length=None, convert_unicode=False, assert_unicode\
=None, unicode_error=None, _warn_on_bytestring=False), table=<patches>\
, nullable=False), Column('patch_comment', Text(length=None, convert_u\
...

sourcestamp_changes

The changes that led up to a particular source stamp.

Value:
Table('sourcestamp_changes', MetaData(None), Column('sourcestampid', I\
nteger(), ForeignKey('sourcestamps.id'), table=<sourcestamp_changes>, \
nullable=False), Column('changeid', Integer(), ForeignKey('changes.cha\
ngeid'), table=<sourcestamp_changes>, nullable=False), schema=None)

sourcestamps

A sourcestamp identifies a particular instance of the source code. Ideally, this would always be absolute, but in practice source stamps can also mean "latest" (when revision is NULL), which is of course a time-dependent definition.

Value:
Table('sourcestamps', MetaData(None), Column('id', Integer(), table=<s\
ourcestamps>, primary_key=True, nullable=False), Column('branch', Stri\
ng(length=256, convert_unicode=False, assert_unicode=None, unicode_err\
or=None, _warn_on_bytestring=False), table=<sourcestamps>), Column('re\
vision', String(length=256, convert_unicode=False, assert_unicode=None\
, unicode_error=None, _warn_on_bytestring=False), table=<sourcestamps>\
), Column('patchid', Integer(), ForeignKey('patches.id'), table=<sourc\
estamps>), Column('repository', String(length=512, convert_unicode=Fal\
...

scheduler_changes

This table references "classified" changes that have not yet been "processed". That is, the scheduler has looked at these changes and determined that something should be done, but that hasn't happened yet. Rows are deleted from this table as soon as the scheduler is done with the change.

Value:
Table('scheduler_changes', MetaData(None), Column('schedulerid', Integ\
er(), ForeignKey('schedulers.schedulerid'), table=<scheduler_changes>)\
, Column('changeid', Integer(), ForeignKey('changes.changeid'), table=\
<scheduler_changes>), Column('important', SmallInteger(), table=<sched\
uler_changes>), schema=None)

scheduler_upstream_buildsets

This table references buildsets in which a particular scheduler is interested. On every run, a scheduler checks its upstream buildsets for completion and reacts accordingly. Records are never deleted from this table, but active is set to 0 when the record is no longer necessary.

Value:
Table('scheduler_upstream_buildsets', MetaData(None), Column('buildset\
id', Integer(), ForeignKey('buildsets.id'), table=<scheduler_upstream_\
buildsets>), Column('schedulerid', Integer(), ForeignKey('schedulers.s\
chedulerid'), table=<scheduler_upstream_buildsets>), Column('active', \
SmallInteger(), table=<scheduler_upstream_buildsets>), schema=None)

schedulers

This table records the "state" for each scheduler. This state is, at least, the last change that was analyzed, but is stored in an opaque JSON object. Note that schedulers are never deleted.

Value:
Table('schedulers', MetaData(None), Column('schedulerid', Integer(), t\
able=<schedulers>, primary_key=True, nullable=False), Column('name', S\
tring(length=128, convert_unicode=False, assert_unicode=None, unicode_\
error=None, _warn_on_bytestring=False), table=<schedulers>, nullable=F\
alse), Column('state', String(length=1024, convert_unicode=False, asse\
rt_unicode=None, unicode_error=None, _warn_on_bytestring=False), table\
=<schedulers>, nullable=False), Column('class_name', String(length=128\
, convert_unicode=False, assert_unicode=None, unicode_error=None, _war\
...

objects

This table uniquely identifies objects that need to maintain state across invocations.

Value:
Table('objects', MetaData(None), Column('id', Integer(), table=<object\
s>, primary_key=True, nullable=False), Column('name', String(length=12\
8, convert_unicode=False, assert_unicode=None, unicode_error=None, _wa\
rn_on_bytestring=False), table=<objects>, nullable=False), Column('cla\
ss_name', String(length=128, convert_unicode=False, assert_unicode=Non\
e, unicode_error=None, _warn_on_bytestring=False), table=<objects>, nu\
llable=False), schema=None)

object_state

This table stores key/value pairs for objects, where the key is a string and the value is a JSON string.

Value:
Table('object_state', MetaData(None), Column('objectid', Integer(), Fo\
reignKey('objects.id'), table=<object_state>, nullable=False), Column(\
'name', String(length=256, convert_unicode=False, assert_unicode=None,\
 unicode_error=None, _warn_on_bytestring=False), table=<object_state>,\
 nullable=False), Column('value_json', Text(length=None, convert_unico\
de=False, assert_unicode=None, unicode_error=None, _warn_on_bytestring\
=False), table=<object_state>, nullable=False), schema=None)

repo_path

path to the SQLAlchemy-Migrate 'repository'

Value:
'/home/dustin/code/buildbot/t/buildbot/master/buildbot/db/migrate'