Add callbacks for build steps plus some more docs.
authorTim Potter <tpot@hp.com>
Sat, 29 Mar 2008 01:11:42 +0000 (12:11 +1100)
committerTim Potter <tpot@hp.com>
Sat, 29 Mar 2008 01:11:42 +0000 (12:11 +1100)
bbmodel.py

index 47c4df2..dbdf8e0 100644 (file)
@@ -29,6 +29,82 @@ MODE_LOGS = 'logs'
 
 MODE_FULL = 'full'
 
+#
+# Buildbot remote objects:
+#
+#   RemoteBuildSet
+#
+#     getSourceStamp()
+#     getReason()
+#     getID()
+#     getBuilderNames()
+#     getBuildRequests()
+#     isFinished()
+#     waitUntilSuccess()
+#     waitUntilFinished()
+#     getResults()
+#
+#   RemoteBuilder
+#
+#     getName()
+#     getState()
+#     getSlaves()
+#     getLastFinishedBuild()
+#     getCurrentBuilds()
+#     getBuild()
+#     getEvent()
+#
+#   RemoteBuildRequest
+#
+#     getSourceStamp()
+#     getBuilderName()
+#     subscribe()
+#     unsubscribe()
+#
+#   RemoteBuild
+#
+#     getBuilderName()
+#     getNumber()
+#     getReason()
+#     getChanges()
+#     getResponsibleUsers()
+#     getSteps()
+#     getTimes()
+#     isFinished()
+#     waitUntilFinished()
+#     getETA()
+#     getCurrentStep()
+#     getText()
+#     getColor()
+#     getResults()
+#     getLogs()
+#     subscribe()
+#     unsubscribe()
+#
+#   RemoteBuildStep
+#
+#     getName()
+#     getBuild()
+#     getTimes()
+#     getExpectations()
+#     getLogs()
+#     isFinished()
+#     waitUntilFinished()
+#     getETA()
+#     getText()
+#     getColor()
+#     getResults()
+#
+#   RemoteLog
+#
+#     getName()
+#     isFinished()
+#     waitUntilFinished()
+#     getText()
+#     getTextWithHeaders()
+#     getChunks()
+#
+
 #
 # BuildBot state model
 #
@@ -63,7 +139,7 @@ class BBModel(pb.Referenceable):
         self.remote.notifyOnDisconnect(self.disconnected)
 
         self.remote.callRemote(
-            'subscribe', MODE_BUILDS, self.updateInterval, self)
+            'subscribe', MODE_STEPS, self.updateInterval, self)
 
     def disconnected(self, ref):
         
@@ -148,3 +224,20 @@ class BBModel(pb.Referenceable):
             self.builders[buildername]['results'][num] = results
 
         buildnum.addCallback(updateModel)
+
+    # Subscription mode >= steps
+
+    def remote_stepStarted(self, buildername, build, stepname, step):
+        log.msg('step "%s" started for "%s"' % (stepname, buildername))
+
+    def remote_stepFinished(self, buildername, build, stepname, step, results):
+        log.msg('step "%s" finished for "%s"' % (stepname, buildername))
+
+    def remote_buildETAUpdate(self, buildername, build, eta):
+
+        buildnum = build.callRemote('getNumber')
+
+        def logEta(num):
+            log.msg('eta for build %s on "%s" is %s' % (num, buildername, eta))
+
+        buildnum.addCallback(logEta)