return distinct_builds(result.order_by(Desc(StormBuild.upload_time)))
def get_summary_builds(self):
+ """returns tree and status to the ViewSummaryPage class"""
store = self._get_store()
- return store.execute("SELECT tree,status FROM build GROUP BY tree,host,compiler having max(age);")
+ return store.execute("""
+SELECT obd.tree, obd.status AS status_str
+FROM build obd
+INNER JOIN(
+ SELECT MAX(age) age, tree, host, compiler
+ FROM build
+ 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;
+""")
def get_tree_builds(self, tree):
result = self._get_store().find(StormBuild,
os.link(build.basename+".log", new_basename+".log")
if os.path.exists(build.basename+".err"):
os.link(build.basename+".err", new_basename+".err")
- #they are supposed to be in unicode only but since comparision for sumary page depends on them the unicode conversion is done to avoid duplicates when running query in summary_builds
+ # They are supposed to be in unicode only but since comparision for sumary page depends on them
+ # the unicode conversion is done to avoid duplicates when running query in summary_builds
new_build = StormBuild(new_basename, unicode(build.tree), unicode(build.host), unicode(build.compiler), rev)
new_build.checksum = build.log_checksum()
new_build.upload_time = build.upload_time
builds = self.buildfarm.get_summary_builds()
- for build in builds:
- host_count[build[0]]+=1
- status = BuildStatus.__deserialize__(build[1])
+ for tree, status_str in builds:
+ host_count[tree]+=1
+ status = BuildStatus.__deserialize__(status_str)
if status.failed:
- broken_count[build[0]]+=1
+ broken_count[tree]+=1
if "panic" in status.other_failures:
- panic_count[build[0]]+=1
+ panic_count[tree]+=1
return (host_count, broken_count, panic_count)
def render_text(self, myself):