Skip to content

Commit

Permalink
Trac #2660 [nine] buildrequests data API uses popBooleanFilter for no…
Browse files Browse the repository at this point in the history
…n-booleans

 - remove code in docs/tests about branch/repository/codebase for buildrequests
  • Loading branch information
Xavier Delannoy committed Apr 15, 2014
1 parent 26aabad commit fcb7a08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
19 changes: 2 additions & 17 deletions master/buildbot/test/fake/fakedb.py
Expand Up @@ -1443,20 +1443,9 @@ def insertTestData(self, rows):
self.claims[row.brid] = row

# component methods
@defer.inlineCallbacks
def getBuildRequest(self, brid):
row = self.reqs.get(brid)
if row:
buildset = yield self.db.buildsets.getBuildset(row.buildsetid)
sourcestamp = yield self.db.sourcestamps.getSourceStamp(buildset['sourcestamps'][0] if len(buildset['sourcestamps']) > 0 else None)
if sourcestamp is not None:
row.branch = sourcestamp['branch']
row.repository = sourcestamp['repository']
row.codebase = sourcestamp['codebase']
else:
row.branch = None
row.repository = None
row.codebase = None
claim_row = self.claims.get(brid, None)
if claim_row:
row.claimed_at = claim_row.claimed_at
Expand All @@ -1465,9 +1454,9 @@ def getBuildRequest(self, brid):
row.claimed_by_masterid = claim_row.masterid
else:
row.claimed_at = None
defer.returnValue(self._brdictFromRow(row))
return defer.succeed(self._brdictFromRow(row))
else:
defer.returnValue(None)
return defer.succeed(None)

@defer.inlineCallbacks
def getBuildRequests(self, buildername=None, complete=None, claimed=None,
Expand Down Expand Up @@ -1516,10 +1505,6 @@ def getBuildRequests(self, buildername=None, complete=None, claimed=None,
if repository and not any(repository == s['repository'] for s in sourcestamps):
continue

br.branch = None
br.repository = None
br.codebase = None

rv.append(self._brdictFromRow(br))
defer.returnValue(rv)

Expand Down
3 changes: 0 additions & 3 deletions master/docs/developer/database.rst
Expand Up @@ -101,9 +101,6 @@ buildrequests
* ``complete_at`` (datetime object, time this request was completed)
* ``submitted_at`` (datetime object, time this request was completed)
* ``results`` (integer result code)
* ``branch`` (string, the branch associated with the request)
* ``repository`` (string, the repository associated with the request)
* ``codebase`` (string, the codebase associated with the request)
* ``waited_for`` (boolean)

.. py:method:: getBuildRequest(brid)
Expand Down

0 comments on commit fcb7a08

Please sign in to comment.