Skip to content

Instantly share code, notes, and snippets.

@rail
Created December 13, 2011 19:59
Show Gist options
  • Save rail/1473617 to your computer and use it in GitHub Desktop.
Save rail/1473617 to your computer and use it in GitHub Desktop.
scheduler.py | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/scheduler.py b/scheduler.py
index 5b82e9d..d4af29a 100644
--- a/scheduler.py
+++ b/scheduler.py
@@ -16,17 +16,16 @@ from buildbot.sourcestamp import SourceStamp
from buildbot.process.properties import Properties
from buildbot.status.builder import SUCCESS, WARNINGS
from buildbot.util import now
import util.tuxedo
reload(util.tuxedo)
from util.tuxedo import get_release_uptake
-from buildbotcustom.common import genBuildUID
import time
class MultiScheduler(Scheduler):
"""Trigger N (default three) build requests based upon the same change request"""
def __init__(self, numberOfBuildsToTrigger=3, **kwargs):
self.numberOfBuildsToTrigger = numberOfBuildsToTrigger
Scheduler.__init__(self, **kwargs)
@@ -401,30 +400,27 @@ class AggregatingScheduler(BaseScheduler):
state['lastCheck'] = n
for builder, ssid in newBuilds:
if builder in remainingBuilders:
remainingBuilders.remove(builder)
if remainingBuilders:
state['remainingBuilders'] = remainingBuilders
- self.set_state(t, state)
- return
-
- if not remainingBuilders:
- # generate a unique revision so every new buildset generates a build
- ss = SourceStamp(branch=self.branch, revision=genBuildUID())
+ else:
+ ss = SourceStamp(branch=self.branch)
ssid = db.get_sourcestampid(ss, t)
# Start a build!
self.create_buildset(ssid, "downstream", t)
# Reset the list of builders we're waiting for
state['remainingBuilders'] = self.upstreamBuilders
- self.set_state(t, state)
+
+ self.set_state(t, state)
def makePropertiesScheduler(base_class, propfuncs, *args, **kw):
"""Return a subclass of `base_class` that will call each of `propfuncs` to
generate a set of properties to attach to new buildsets.
Each function of propfuncs will be passed (scheduler instance, db
transaction, sourcestamp id) and must return a Properties instance. These
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment