bug 614946: Unimportant l10n changes still get run eventually. r=catlee
authorDustin J. Mitchell
Mon, 06 Dec 2010 17:31:10 -0500
changeset 111 e7d90277a2a92a7e77780d048e92bc99b7e0c3ba
parent 107 5904e51e155bc07b7c3bb2e7f9515b249720cbe7
child 112 c901b723778d97cbb46aeb9e414355073410ffb9
push id44
push userbhearsum@mozilla.com
push dateMon, 06 Dec 2010 22:39:22 +0000
reviewerscatlee
bugs614946
bug 614946: Unimportant l10n changes still get run eventually. r=catlee
master/buildbot/schedulers/basic.py
--- a/master/buildbot/schedulers/basic.py
+++ b/master/buildbot/schedulers/basic.py
@@ -136,39 +136,44 @@ class Scheduler(base.BaseScheduler, base
             self.stableAt = most_recent + self.treeStableTimer
             if self.stableAt > now:
                 # Wake up one second late, to avoid waking up too early and
                 # looping a lot.
                 return self.stableAt + 1.0
 
         # ok, do a build
         self.stableAt = None
-        self._add_build_and_remove_changes(t, all_changes)
+        self._add_build_and_remove_changes(t, important, unimportant)
         return None
 
-    def _add_build_and_remove_changes(self, t, all_changes):
-        # all_changes is segregated into important and unimportant
+    def _add_build_and_remove_changes(self, t, important, unimportant):
+        # the changes are segregated into important and unimportant
         # changes, but we need it ordered earliest to latest, based
         # on change number, since the SourceStamp will be created
         # based on the final change.
-        all_changes.sort(key=lambda c : c.number)
+        all_changes = sorted(important + unimportant, key=lambda c : c.number)
 
         db = self.parent.db
         if self.treeStableTimer is None:
-            # each Change gets a separate build
-            for c in all_changes:
+            # each *important* Change gets a separate build.  Unimportant
+            # builds get ignored.
+            for c in sorted(important, key=lambda c : c.number):
                 ss = SourceStamp(changes=[c])
                 ssid = db.get_sourcestampid(ss, t)
                 self.create_buildset(ssid, "scheduler", t)
         else:
+            # if we had a treeStableTimer, then trigger a build for the
+            # whole pile - important or not.  There's at least one important
+            # change in the list, or we wouldn't have gotten here.
             ss = SourceStamp(changes=all_changes)
             ssid = db.get_sourcestampid(ss, t)
             self.create_buildset(ssid, "scheduler", t)
 
-        # and finally retire the changes from scheduler_changes
+        # and finally retire all of the changes from scheduler_changes, regardless
+        # of importance level
         changeids = [c.number for c in all_changes]
         db.scheduler_retire_changes(self.schedulerid, changeids, t)
 
     # the waterfall needs to know the next time we plan to trigger a build
     def getPendingBuildTimes(self):
         if self.stableAt and self.stableAt > util.now():
             return [ self.stableAt ]
         return []