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

Jelmer Vernooij jelmer at samba.org
Sun Nov 21 08:31:18 MST 2010


The branch, master has been updated
       via  f4e6c42 Only display fields if they are available.
      from  bd8f53b Cope with a single revision having multiple builds.

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


- Log -----------------------------------------------------------------
commit f4e6c4263180908d7f6cd902e4c3d28479befa05
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 21 16:30:38 2010 +0100

    Only display fields if they are available.

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

Summary of changes:
 buildfarm/sqldb.py        |   13 ++++++++-----
 buildfarm/web/__init__.py |   33 +++++++++++++++++++--------------
 2 files changed, 27 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py
index 934a7ad..c5d2825 100644
--- a/buildfarm/sqldb.py
+++ b/buildfarm/sqldb.py
@@ -54,9 +54,7 @@ class StormBuild(Build):
     compiler = RawStr()
     checksum = RawStr()
     upload_time = Int(name="age")
-    commit = Unicode()
     status_str = RawStr(name="status")
-    commit_revision = RawStr()
     basename = RawStr()
     host_id = Int()
 
@@ -220,12 +218,17 @@ class StormCachingBuildResultStore(BuildResultStore):
             StormBuild.host == host,
             StormBuild.compiler == compiler).order_by(Desc(StormBuild.upload_time))
 
-    def get_build(self, tree, host, compiler, revision):
-        result = self.store.find(StormBuild,
+    def get_build(self, tree, host, compiler, revision=None, checksum=None):
+        expr = [
             StormBuild.tree == tree,
             StormBuild.host == host,
             StormBuild.compiler == compiler,
-            StormBuild.revision == revision).order_by(Desc(StormBuild.upload_time))
+            ]
+        if revision is not None:
+            expr.append(StormBuild.revision == revision)
+        if checksum is not None:
+            expr.append(StormBuild.checksum == checksum)
+        result = self.store.find(StormBuild, *expr).order_by(Desc(StormBuild.upload_time))
         ret = result.first()
         if ret is None:
             raise NoSuchBuildError(tree, host, compiler, revision)
diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py
index 3506250..6f2b225 100755
--- a/buildfarm/web/__init__.py
+++ b/buildfarm/web/__init__.py
@@ -104,7 +104,7 @@ def html_build_status(status):
 
 
 def build_status_html(myself, build):
-    return "<a href='%s?function=View+Build;host=%s;tree=%s;compiler=%s;revision=%s'>%s</a>" % (myself, build.host, build.tree, build.compiler, build.revision, html_build_status(build.status()))
+    return "<a href='%s?function=View+Build;host=%s;tree=%s;compiler=%s;revision=%s;checksum=%s'>%s</a>" % (myself, build.host, build.tree, build.compiler, build.revision, html_build_status(build.status()), build.log_checksum())
 
 
 def build_status_vals(status):
@@ -442,25 +442,25 @@ class ViewBuildPage(BuildFarmPage):
 
         yield "</tbody></table>\n"
 
-    def render(self, myself, tree, host, compiler, rev, plain_logs=False):
+    def render(self, myself, tree, host, compiler, rev, checksum=None,
+            plain_logs=False):
         """view one build in detail"""
 
-        uname = ""
-        cflags = ""
-        config = ""
+        uname = None
+        cflags = None
+        config = None
         try:
-            build = self.buildfarm.get_build(tree, host, compiler, rev)
+            build = self.buildfarm.get_build(tree, host, compiler, rev,
+                checksum=checksum)
         except data.NoSuchBuildError:
-            yield "No such build: %s on %s with %s, rev %s" % (tree, host, compiler, rev)
+            yield "No such build: %s on %s with %s, rev %r, checksum %r" % (
+                tree, host, compiler, rev, checksum)
             return
         try:
             (revision, revision_time) = build.revision_details()
         except data.MissingRevisionInfo:
             revision = None
 
-        if rev:
-            assert re.match("^[0-9a-fA-F]*$", rev)
-
         try:
             f = build.read_log()
             try:
@@ -500,14 +500,17 @@ class ViewBuildPage(BuildFarmPage):
         yield "<tr><td>Host:</td><td><a href='%s?function=View+Host;host=%s;tree=%s;"\
               "compiler=%s#'>%s</a> - %s</td></tr>\n" %\
                 (myself, host, tree, compiler, host, self.buildfarm.hostdb[host].platform.encode("utf-8"))
-        yield "<tr><td>Uname:</td><td>%s</td></tr>\n" % uname
+        if uname is not None:
+            yield "<tr><td>Uname:</td><td>%s</td></tr>\n" % uname
         yield "<tr><td>Tree:</td><td>%s</td></tr>\n" % self.tree_link(myself, tree)
         yield "<tr><td>Build Revision:</td><td>%s</td></tr>\n" % revision_link(myself, revision, tree)
         yield "<tr><td>Build age:</td><td><div class='age'>%s</div></td></tr>\n" % self.red_age(build.age)
         yield "<tr><td>Status:</td><td>%s</td></tr>\n" % build_status_html(myself, build)
         yield "<tr><td>Compiler:</td><td>%s</td></tr>\n" % compiler
-        yield "<tr><td>CFLAGS:</td><td>%s</td></tr>\n" % cflags
-        yield "<tr><td>configure options:</td><td>%s</td></tr>\n" % config
+        if cflags is not None:
+            yield "<tr><td>CFLAGS:</td><td>%s</td></tr>\n" % cflags
+        if config is not None:
+            yield "<tr><td>configure options:</td><td>%s</td></tr>\n" % config
         yield "</table>\n"
 
         yield "".join(self.show_oldrevs(myself, tree, host, compiler))
@@ -922,8 +925,10 @@ class BuildFarmApp(object):
                 tree = get_param(form, "tree")
                 host = get_param(form, "host")
                 compiler = get_param(form, "compiler")
+                revision = get_param(form, "revision")
+                checksum = get_param(form, "checksum")
                 page = ViewBuildPage(self.buildfarm)
-                yield "".join(page.render(myself, tree, host, compiler, get_param(form, "revision"), plain_logs))
+                yield "".join(page.render(myself, tree, host, compiler, revision, checksum, plain_logs))
             elif fn_name == "View_Host":
                 page = ViewHostPage(self.buildfarm)
                 yield "".join(page.render_html(myself, get_param(form, 'host')))


-- 
build.samba.org


More information about the samba-cvs mailing list