Package buildbot :: Package db :: Module changes :: Class ChangesConnectorComponent
[frames] | no frames]

Class ChangesConnectorComponent

source code

               object --+    
                        |    
base.DBConnectorComponent --+
                            |
                           ChangesConnectorComponent


A DBConnectorComponent to handle getting changes into and out of the
database.  An instance is available at C{master.db.changes}.

Changes are represented as dictionaries with the following keys:

- changeid: the ID of this change
- author: the author of the change (unicode string)
- files: list of source-code filenames changed (unicode strings)
- comments: user comments (unicode string)
- is_dir: deprecated
- links: list of links for this change, e.g., to web views, review
  (unicode strings)
- revision: revision for this change (unicode string), or None if unknown
- when_timestamp: time of the commit (datetime instance)
- branch: branch on which the change took place (unicode string), or None
  for the "default branch", whatever that might mean
- category: user-defined category of this change (unicode string or None)
- revlink: link to a web view of this change (unicode string or None)
- properties: user-specified properties for this change, represented as a
  dictionary mapping keys to (value, source)
- repository: repository where this change occurred (unicode string)
- project: user-defined project to which this change corresponds (unicode
  string)

Instance Methods
 
addChange(self, author=None, files=None, comments=None, is_dir=0, links=None, revision=None, when_timestamp=None, branch=None, category=None, revlink='', properties={}, repository='', project='', _reactor=reactor)
Add a Change with the given attributes to the database; returns a Change instance via a deferred.
source code
 
getRecentChanges(self, count)
Get a list of the count most recent changes, represented as dictionaies; returns fewer if that many do not exist.
source code
 
getLatestChangeid(self)
Get the most-recently-assigned changeid, or None if there are no changes at all.
source code
 
pruneChanges(self, changeHorizon) 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
  getChange = <buildbot.db.base.CachedMethod object at 0x32554d0>

Inherited from base.DBConnectorComponent: connector

Instance Variables

Inherited from base.DBConnectorComponent: db

Properties

Inherited from object: __class__

Method Details

addChange(self, author=None, files=None, comments=None, is_dir=0, links=None, revision=None, when_timestamp=None, branch=None, category=None, revlink='', properties={}, repository='', project='', _reactor=reactor)

source code 

Add a Change with the given attributes to the database; returns a Change instance via a deferred. All arguments are keyword arguments.

Parameters:
  • author (unicode string) - the author of this change
  • files - a list of filenames that were changed
  • comments - user comments on the change
  • is_dir - deprecated
  • 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
  • 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, where values are tuples of (value, source). At the moment, the source must be 'Change', although this may be relaxed in later versions.) - 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
  • _reactor - for testing
Returns:
new change's ID via Deferred

getRecentChanges(self, count)

source code 

Get a list of the count most recent changes, represented as dictionaies; returns fewer if that many do not exist.

Parameters:
  • count - maximum number of instances to return
Returns:
list of dictionaries via Deferred, ordered by changeid

getLatestChangeid(self)

source code 

Get the most-recently-assigned changeid, or None if there are no changes at all.

Returns:
changeid via Deferred