Skip to content

Commit

Permalink
fixes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Dec 11, 2013
1 parent 4ec44e1 commit 6d47487
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
7 changes: 4 additions & 3 deletions master/buildbot/process/builder.py
Expand Up @@ -520,9 +520,10 @@ def _notify_completions(self, requests, results, complete_at_epoch):
builderid=builderid,
complete_at=complete_at_epoch,
results=results)
# TODO: when buildrequests are defined in the data API
(key, msg)
#self.master.mq.produce(key, msg)
# TODO: actually send when buildrequests are defined in the data
# API
log.msg("would send %s message with body %r, but buildrequests "
"aren't defined yet" % (key, msg))

# check for completed buildsets -- one call for each build request with
# a unique bsid
Expand Down
10 changes: 4 additions & 6 deletions master/buildbot/process/buildstep.py
Expand Up @@ -389,14 +389,12 @@ def setRenderable(res, attr):
# At the same time we must respect RETRY status because it's used
# to retry interrupted build due to some other issues for example
# due to slave lost
descr = self.describe(True)
if results == CANCELLED:
yield self.setStateStrings(self.describe(True) + ["cancelled"])
yield self.setStateStrings(descr + ["cancelled"])
else:
# leave RETRY as-is, but change anything else to EXCEPTION
if results != RETRY:
results = EXCEPTION
yield self.setStateStrings(self.describe(True) +
["interrupted"])
results = EXCEPTION
yield self.setStateStrings(descr + ["interrupted"])

if self.progress:
self.progress.finish()
Expand Down
6 changes: 3 additions & 3 deletions master/docs/relnotes/index.rst
Expand Up @@ -83,15 +83,15 @@ However, this compatibility is accomplished through some ugly hacks that may not
All custom steps should be rewritten in the new style as soon as possible.

Buildbot distinguishes new-style from old-style steps by the presence of a :py:meth:`~buildbot.process.buildstep.BuildStep.run` method.
If this method is present, then the step is as a new-style step.
If this method is present, then the step is a new-style step.

Summary of Changes
++++++++++++++++++

* New-style steps have a ``run`` method that is simpler to implement than the old ``start`` method.
* Many methods are now asynchronous (return Deferreds), as they perform operations on the database.
* Logs are now implemented by a completely different class.
This class supports the same log-writing methods (``addStder`` and so on), although they are now asynchronous.
This class supports the same log-writing methods (``addStderr`` and so on), although they are now asynchronous.
However, it does not support log-reading methods such as ``getText``.
It was never advisable to handle logs as enormous strings.
New-style steps should, instead, use a LogObserver or fetch log lines bit by bit using :bb:rtype:`logchunk`.
Expand Down Expand Up @@ -154,7 +154,7 @@ Syntactically, ``inlineCallbacks`` makes the change fairly simple::
for m in self.MESSAGES:
if counts[m]:
yield self.addCompleteLog(m, "".join(summaries[m]))
yield self.setProperty("count-%s" % m, counts[m], "counter")
self.setProperty("count-%s" % m, counts[m], "counter")

However, this method's callers must now handle the Deferred that it returns.
All methods that can be overridden in custom steps can return a Deferred.
Expand Down

0 comments on commit 6d47487

Please sign in to comment.