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

Matthieu Patou mat at samba.org
Wed Nov 10 16:42:52 MST 2010


The branch, master has been updated
       via  a6951b8 desactivate history for the moment (it's broken)
       via  cc86506 use buildfarm get_build function instead of the one of the buildstore
       via  4e12cf0 implement get_build on the buildfarm object so that it can dispatch to the adhoc object
       via  bb1a424 use buildstore function to get the cached status
       via  1c09aa4 add function to get the lcov cache status on a build store
      from  94ae43a Serve in standalone mode only files that are local the current folder

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


- Log -----------------------------------------------------------------
commit a6951b866d22bedef2450d25fdedf67a56457071
Author: Matthieu Patou <mat at matws.net>
Date:   Thu Nov 11 02:42:46 2010 +0300

    desactivate history for the moment (it's broken)

commit cc865062d99b19523c564a90383ae6f94323153c
Author: Matthieu Patou <mat at matws.net>
Date:   Thu Nov 11 02:42:24 2010 +0300

    use buildfarm get_build function instead of the one of the buildstore

commit 4e12cf023151dc138ccd007de85846fecf92943e
Author: Matthieu Patou <mat at matws.net>
Date:   Thu Nov 11 02:39:16 2010 +0300

    implement get_build on the buildfarm object so that it can dispatch to the adhoc object

commit bb1a424d137f7d153dfd5c1b278c22e1f2593634
Author: Matthieu Patou <mat at matws.net>
Date:   Thu Nov 11 02:37:48 2010 +0300

    use buildstore function to get the cached status

commit 1c09aa46acf31df23417076e1ca1be3e28ddbfb6
Author: Matthieu Patou <mat at matws.net>
Date:   Thu Nov 11 02:41:16 2010 +0300

    add function to get the lcov cache status on a build store

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

Summary of changes:
 buildfarm/__init__.py |   21 +++++++++++++++++++--
 buildfarm/data.py     |    5 +++++
 web/build.py          |   10 +++++-----
 3 files changed, 29 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py
index 2370940..118a729 100644
--- a/buildfarm/__init__.py
+++ b/buildfarm/__init__.py
@@ -99,8 +99,7 @@ class BuildFarm(object):
     def lcov_status(self, tree):
         """get status of build"""
         from buildfarm import data, util
-        cachefile = os.path.join(self.builds.cachedir, "lcov.%s.%s.status" % (
-            self.LCOVHOST, tree))
+        cachefile = self.builds.get_lcov_cached_status(self.LCOVHOST, tree)
         file = os.path.join(self.lcovdir, self.LCOVHOST, tree, "index.html")
         try:
             st1 = os.stat(file)
@@ -129,6 +128,24 @@ class BuildFarm(object):
             util.FileSave(cachefile, ret)
         return perc
 
+    def get_build(self, tree, host, compiler, rev=None):
+        if rev:
+            if host in self.hostdb.hosts() and\
+                    tree in self.trees and\
+                    compiler in self.compilers:
+                return self.builds.get_build(tree, host, compiler)
+            else:
+                from buildfarm import data
+                raise data.NoSuchBuildError(tree, host, compiler)
+        else:
+            if host in [h.name for h in self.hostdb.hosts()] and\
+                    tree in self.trees and\
+                    compiler in self.compilers:
+                return self.upload_builds.get_build(tree, host, compiler)
+            else:
+                from buildfarm import data
+                raise data.NoSuchBuildError(tree, host, compiler)
+
     def get_new_builds(self):
         from buildfarm import data
         for host in self.hostdb.hosts():
diff --git a/buildfarm/data.py b/buildfarm/data.py
index 493badb..f709422 100644
--- a/buildfarm/data.py
+++ b/buildfarm/data.py
@@ -396,6 +396,9 @@ class BuildResultStore(object):
         """
         self.path = path
 
+    def get_lcov_cached_status(self, host, tree):
+        return None
+
     def get_build(self, tree, host, compiler, rev):
         logf = self.build_fname(tree, host, compiler, rev) + ".log"
         if not os.path.exists(logf):
@@ -477,5 +480,7 @@ class CachingBuildResultStore(BuildResultStore):
     def cache_fname(self, tree, host, compiler, rev):
         return os.path.join(self.cachedir, "build.%s.%s.%s-%s" % (tree, host, compiler, rev))
 
+    def get_lcov_cached_status(self, host, tree):
+        return os.path.join(self.cachedir, "lcov.%s.%s.status" % (host, tree))
 
 
diff --git a/web/build.py b/web/build.py
index 5c342ea..6d06c3d 100755
--- a/web/build.py
+++ b/web/build.py
@@ -48,7 +48,7 @@ basedir = os.path.abspath(os.path.join(webdir, ".."))
 buildfarm = BuildFarm()
 
 db = data.BuildResultStore(basedir)
-history = history.History(db)
+#history = history.History(db)
 hostsdb = buildfarm.hostdb
 
 compilers = buildfarm.compilers
@@ -173,7 +173,7 @@ def view_summary(myself, output_type):
         for compiler in compilers:
             for tree in trees:
                 try:
-                    build = db.get_build(tree, host.name.encode("utf-8"), compiler)
+                    build = buildfarm.get_build(tree, host.name.encode("utf-8"), compiler)
                     status = build_status_html(myself, build)
                 except data.NoSuchBuildError:
                     continue
@@ -275,7 +275,7 @@ def view_recent_builds(myself, tree, sort_by):
     for host in hosts.values():
         for compiler in compilers:
             try:
-                build = db.get_build(tree, host.name.encode("utf-8"), compiler)
+                build = buildfarm.get_build(tree, host.name.encode("utf-8"), compiler)
                 status = build_status_html(myself, build)
             except data.NoSuchBuildError:
                 pass
@@ -393,7 +393,7 @@ def view_build(myself, tree, host, compiler, rev, plain_logs=False):
     uname = ""
     cflags = ""
     config = ""
-    build = db.get_build(tree, host, compiler, rev)
+    build = buildfarm.get_build(tree, host, compiler, rev)
     age_mtime = build.age_mtime()
     (revision, commit_revision, revision_time) = build.revision_details()
     if commit_revision:
@@ -522,7 +522,7 @@ def view_host(myself, output_type, *requested_hosts):
         for compiler in compilers:
             for tree in sorted(trees.keys()):
                 try:
-                    build = db.get_build(tree, host, compiler)
+                    build = buildfarm.get_build(tree, host, compiler)
                 except data.NoSuchBuildError:
                     pass
                 else:


-- 
build.samba.org


More information about the samba-cvs mailing list