Only show builds in the last seven days.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 2 Aug 2014 19:23:22 +0000 (21:23 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 2 Aug 2014 19:23:22 +0000 (21:23 +0200)
buildfarm/__init__.py
buildfarm/web/__init__.py

index 52ac0859c7e453a1c709e9bc2368b9f13acc5570..933e5fd2113d0deac7f29c69998b03610666c79f 100644 (file)
@@ -144,9 +144,10 @@ class BuildFarm(object):
         result = self._get_store().find(StormBuild)
         return distinct_builds(result.order_by(Desc(StormBuild.upload_time)))
 
-    def get_summary_builds(self):
+    def get_summary_builds(self, min_age=0):
         """Return last build age, status for each tree/host/compiler.
 
+        :param min_age: Minimum timestamp of builds to report
         :return: iterator over tree, status
         """
         store = self._get_store()
@@ -157,12 +158,13 @@ FROM build obd
 INNER JOIN(
     SELECT MAX(age) age, tree, host, compiler
     FROM build
+    WHERE age > ?
     GROUP BY tree, host, compiler
 ) ibd ON obd.age = ibd.age AND
          obd.tree = ibd.tree AND
          obd.host = ibd.host AND
          obd.compiler = ibd.compiler;
-"""))
+""", min_age))
 
     def get_tree_builds(self, tree):
         result = self._get_store().find(StormBuild,
index 0368022dbfde9f4f6e86996b4fa1e41c6f31f632..bd29cc1a4b9976548be118ad41761e2e9b2ea6a1 100755 (executable)
@@ -727,7 +727,7 @@ class ViewSummaryPage(BuildFarmPage):
         # output when we want
         broken_table = ""
 
-        builds = self.buildfarm.get_summary_builds()
+        builds = self.buildfarm.get_summary_builds(min_age=(7 * 24 * 60 * 60))
 
         for tree, status in builds:
             host_count[tree]+=1