[Buildbot-commits] buildbot/buildbot buildset.py, 1.6, 1.7 master.py, 1.111, 1.112 scheduler.py, 1.29, 1.30

Brian Warner warner at users.sourceforge.net
Thu May 22 22:12:07 UTC 2008


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

Modified Files:
	buildset.py master.py scheduler.py 
Log Message:
[project @ #87:customprops.patch]
Patch by Paul Gain, Roch Gadson <rochester.gadsdon at bakbone.com>, and
Aaron Maxwell <amax at snaplogic.org> to implement "custom properties":
build properties that can be specified when the build is initially
created, e.g., by a scheduler.

Original author: dustin at v.igoro.us
Date: 2008-04-04 03:52:33+00:00

Index: buildset.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/buildset.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- buildset.py	22 May 2008 22:11:36 -0000	1.6
+++ buildset.py	22 May 2008 22:12:05 -0000	1.7
@@ -10,13 +10,18 @@
     source.revision), or a build of a certain set of Changes
     (source.changes=list)."""
 
-    def __init__(self, builderNames, source, reason=None, bsid=None, scheduler=None):
+    def __init__(self, builderNames, source, reason=None, bsid=None,
+                 scheduler=None, custom_props=None):
         """
         @param source: a L{buildbot.sourcestamp.SourceStamp}
         """
         self.builderNames = builderNames
         self.source = source
         self.reason = reason
+
+        if not custom_props: custom_props = {}
+        self.custom_props = custom_props
+
         self.stillHopeful = True
         self.status = bss = builder.BuildSetStatus(source, reason,
                                                    builderNames, bsid)
@@ -35,7 +40,8 @@
 
         # create the requests
         for b in builders:
-            req = base.BuildRequest(self.reason, self.source, b.name, self.scheduler)
+            req = base.BuildRequest(self.reason, self.source, b.name, 
+                                    self.scheduler, self.custom_props)
             reqs.append((b, req))
             self.requests.append(req)
             d = req.waitUntilFinished()

Index: master.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- master.py	21 Nov 2007 09:25:48 -0000	1.111
+++ master.py	22 May 2008 22:12:05 -0000	1.112
@@ -339,6 +339,7 @@
     projectURL = None
     buildbotURL = None
     change_svc = None
+    customBuildProperties = None
 
     def __init__(self, basedir, configFileName="master.cfg"):
         service.MultiService.__init__(self)
@@ -494,6 +495,7 @@
                       "schedulers", "builders",
                       "slavePortnum", "debugPassword", "manhole",
                       "status", "projectName", "projectURL", "buildbotURL",
+                      "customBuildProperties"
                       )
         for k in config.keys():
             if k not in known_keys:
@@ -521,6 +523,7 @@
             projectName = config.get('projectName')
             projectURL = config.get('projectURL')
             buildbotURL = config.get('buildbotURL')
+            customBuildProperties = config.get('customBuildProperties')
 
         except KeyError, e:
             log.msg("config dictionary is missing a required parameter")
@@ -666,6 +669,7 @@
         self.projectName = projectName
         self.projectURL = projectURL
         self.buildbotURL = buildbotURL
+        self.customBuildProperties = customBuildProperties
 
         # self.slaves: Disconnect any that were attached and removed from the
         # list. Update self.checker with the new list of passwords, including

Index: scheduler.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scheduler.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- scheduler.py	22 May 2008 22:11:36 -0000	1.29
+++ scheduler.py	22 May 2008 22:12:05 -0000	1.30
@@ -665,7 +665,8 @@
         self.parent = parent
         self.username = username
 
-    def perspective_try(self, branch, revision, patch, builderNames):
+    def perspective_try(self, branch, revision, patch, builderNames,
+                        custom_props):
         log.msg("user %s requesting build on builders %s" % (self.username,
                                                              builderNames))
         for b in builderNames:
@@ -676,7 +677,13 @@
                 return
         ss = SourceStamp(branch, revision, patch)
         reason = "'try' job from user %s" % self.username
-        bs = buildset.BuildSet(builderNames, ss, reason=reason, scheduler=self)
+
+        bs = buildset.BuildSet(builderNames, 
+                               ss,
+                               reason=reason, 
+                               scheduler=self,
+                               custom_props=custom_props)
+
         self.parent.submitBuildSet(bs)
 
         # return a remotely-usable BuildSetStatus object
@@ -699,11 +706,11 @@
     def getPendingBuildTimes(self):
         return []
 
-    def trigger(self, ss):
+    def trigger(self, ss, custom_props={}):
         """Trigger this scheduler. Returns a deferred that will fire when the
         buildset is finished.
         """
-        bs = buildset.BuildSet(self.builderNames, ss, scheduler=self)
+        bs = buildset.BuildSet(self.builderNames, ss, scheduler=self, custom_props=custom_props)
         d = bs.waitUntilFinished()
         self.submit(bs)
         return d





More information about the Commits mailing list