[SCM] build.samba.org - branch master updated

Jelmer Vernooij jelmer at samba.org
Sat Aug 2 13:23:27 MDT 2014


The branch, master has been updated
       via  c5f371b Only show builds in the last seven days.
      from  0996a81 Fix whitespace, add basic tests for get_summary_builds.

http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c5f371b907ef13bef16bd4ac8be29e0fc7961882
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Aug 2 21:23:22 2014 +0200

    Only show builds in the last seven days.

-----------------------------------------------------------------------

Summary of changes:
 buildfarm/__init__.py     |    6 ++++--
 buildfarm/web/__init__.py |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py
index 52ac085..933e5fd 100644
--- a/buildfarm/__init__.py
+++ b/buildfarm/__init__.py
@@ -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,
diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py
index 0368022..bd29cc1 100755
--- a/buildfarm/web/__init__.py
+++ b/buildfarm/web/__init__.py
@@ -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


-- 
build.samba.org


More information about the samba-cvs mailing list