[Buildbot-commits] buildbot/buildbot buildset.py, 1.5, 1.6 scheduler.py, 1.28, 1.29

Brian Warner warner at users.sourceforge.net
Thu May 22 22:11:38 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16534/buildbot

Modified Files:
	buildset.py scheduler.py 
Log Message:
[project @ #227:scheduler-property-in-build.patch]
Patch by Dossy Shiobara <dossy at panoptic.com>: It is useful to know
the name of the scheduler that initiated a build request, i.e., to
conditionally FileUpload the results of a Nightly scheduled build.
This patch passes the Scheduler along the BuildRequest chain so
that Build can setProperty("scheduler", self.scheduler.name) in
Build.setupStatus().

Original author: dustin at v.igoro.us
Date: 2008-04-04 02:54:25+00:00

Index: buildset.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/buildset.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- buildset.py	6 Sep 2006 00:41:54 -0000	1.5
+++ buildset.py	22 May 2008 22:11:36 -0000	1.6
@@ -10,7 +10,7 @@
     source.revision), or a build of a certain set of Changes
     (source.changes=list)."""
 
-    def __init__(self, builderNames, source, reason=None, bsid=None):
+    def __init__(self, builderNames, source, reason=None, bsid=None, scheduler=None):
         """
         @param source: a L{buildbot.sourcestamp.SourceStamp}
         """
@@ -20,6 +20,7 @@
         self.stillHopeful = True
         self.status = bss = builder.BuildSetStatus(source, reason,
                                                    builderNames, bsid)
+	self.scheduler = scheduler
 
     def waitUntilSuccess(self):
         return self.status.waitUntilSuccess()
@@ -34,7 +35,7 @@
 
         # create the requests
         for b in builders:
-            req = base.BuildRequest(self.reason, self.source, b.name)
+            req = base.BuildRequest(self.reason, self.source, b.name, self.scheduler)
             reqs.append((b, req))
             self.requests.append(req)
             d = req.waitUntilFinished()

Index: scheduler.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scheduler.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- scheduler.py	21 Mar 2008 01:32:00 -0000	1.28
+++ scheduler.py	22 May 2008 22:11:36 -0000	1.29
@@ -170,7 +170,8 @@
 
         # create a BuildSet, submit it to the BuildMaster
         bs = buildset.BuildSet(self.builderNames,
-                               SourceStamp(changes=changes))
+                               SourceStamp(changes=changes),
+                               scheduler=self)
         self.submit(bs)
 
     def stopService(self):
@@ -304,7 +305,7 @@
         return d
 
     def upstreamBuilt(self, ss):
-        bs = buildset.BuildSet(self.builderNames, ss)
+        bs = buildset.BuildSet(self.builderNames, ss, scheduler=self)
         self.submit(bs)
 
 
@@ -343,7 +344,7 @@
     def doPeriodicBuild(self):
         bs = buildset.BuildSet(self.builderNames,
                                SourceStamp(branch=self.branch),
-                               self.reason)
+                               self.reason, scheduler=self)
         self.submit(bs)
 
 
@@ -501,7 +502,7 @@
         # And trigger a build
         bs = buildset.BuildSet(self.builderNames,
                                SourceStamp(branch=self.branch),
-                               self.reason)
+                               self.reason, scheduler=self)
         self.submit(bs)
 
     def addChange(self, change):
@@ -623,7 +624,7 @@
                 return
 
         reason = "'try' job"
-        bs = buildset.BuildSet(builderNames, ss, reason=reason, bsid=bsid)
+        bs = buildset.BuildSet(builderNames, ss, reason=reason, bsid=bsid, scheduler=self)
         self.parent.submitBuildSet(bs)
 
 class Try_Userpass(TryBase):
@@ -675,7 +676,7 @@
                 return
         ss = SourceStamp(branch, revision, patch)
         reason = "'try' job from user %s" % self.username
-        bs = buildset.BuildSet(builderNames, ss, reason=reason)
+        bs = buildset.BuildSet(builderNames, ss, reason=reason, scheduler=self)
         self.parent.submitBuildSet(bs)
 
         # return a remotely-usable BuildSetStatus object
@@ -702,7 +703,7 @@
         """Trigger this scheduler. Returns a deferred that will fire when the
         buildset is finished.
         """
-        bs = buildset.BuildSet(self.builderNames, ss)
+        bs = buildset.BuildSet(self.builderNames, ss, scheduler=self)
         d = bs.waitUntilFinished()
         self.submit(bs)
         return d





More information about the Commits mailing list