|
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Copyright Buildbot Team Members
Support for buildsets in the database """
pass
# Documentation is in developer/database.rst
external_idstring=None, _reactor=reactor):
external_idstring)
# insert the buildset itself sourcestampsetid=sourcestampsetid, submitted_at=submitted_at, reason=reason, complete=0, complete_at=None, results=-1, external_idstring=external_idstring))
# add any properties
dict(buildsetid=bsid, property_name=k, property_value=json.dumps([v,s])) for k,(v,s) in properties.iteritems() ] i['property_name']) i['property_value'])
# and finish with a build request for each builder. Note that # sqlalchemy and the Python DBAPI do not provide a way to recover # inserted IDs from a multi-row insert, so this is done one row at # a time. dict(buildsetid=bsid, buildername=buildername, priority=0, claimed_at=0, claimed_by_name=None, claimed_by_incarnation=None, complete=0, results=-1, submitted_at=submitted_at, complete_at=None))
_reactor=reactor): else:
(tbl.c.id == bsid) & ((tbl.c.complete == None) | (tbl.c.complete != 1)))) complete=1, results=results, complete_at=complete_at)
else: (bs_tbl.c.complete == None))
""" Return the properties for a buildset, in the same format they were given to L{addBuildset}.
Note that this method does not distinguish a nonexistent buildset from a buildset with no properties, and returns C{{}} in either case.
@param buildsetid: buildset ID
@returns: dictionary mapping property name to (value, source), via Deferred """ [ bsp_tbl.c.property_name, bsp_tbl.c.property_value ], whereclause=(bsp_tbl.c.buildsetid == buildsetid)) tuple(properties))) except ValueError: pass
reason=row.reason, sourcestampsetid=row.sourcestampsetid, submitted_at=mkdt(row.submitted_at), complete=bool(row.complete), complete_at=mkdt(row.complete_at), results=row.results, bsid=row.id) |