[Blends-commit] [SCM] website branch, master, updated. 93e635d223b6629eb17e059b3733b9ea2d75d3b0

Andreas Tille tille at debian.org
Fri Jul 19 20:56:12 UTC 2013


The following commit has been merged in the master branch:
commit 01d455100815d06fb9538e3c2c49050d04aad5a1
Author: Andreas Tille <tille at debian.org>
Date:   Thu Jul 18 09:16:17 2013 +0200

    Also query for bug tags

diff --git a/misc/sql/bugs.sh b/misc/sql/bugs.sh
index d42b20f..9fb1e12 100755
--- a/misc/sql/bugs.sh
+++ b/misc/sql/bugs.sh
@@ -34,11 +34,16 @@ SELECT distinct sources.source, tasks.tasks, CASE WHEN dependency = 'd' AND comp
 EOT
 
 psql udd > $1_bugs_packages.out <<EOT
-SELECT distinct bu.source, bu.id, bu.title, bu.status, bu.done
-  FROM blends_dependencies b
-  JOIN packages p ON p.package = b.package
-  JOIN bugs bu    ON bu.source = p.source
-  WHERE blend = '$1' AND b.distribution = 'debian'
-  ORDER BY source;
+SELECT source, bu.id, title, status, done_by, tags FROM (
+  SELECT distinct bu.source, bu.id, bu.title, bu.status, bu.done AS done_by
+    FROM blends_dependencies b
+    JOIN packages p ON p.package = b.package
+    JOIN bugs bu    ON bu.source = p.source
+    WHERE blend = '$1' AND b.distribution = 'debian'
+  ) bu
+  LEFT OUTER JOIN (
+    SELECT id, array_agg(tag) AS tags FROM bugs_tags GROUP BY id
+  ) bt ON bu.id = bt.id
+  ORDER BY source, bu.id;
 EOT
 
diff --git a/webtools/bugs_udd.py b/webtools/bugs_udd.py
index 80898a3..c8c7269 100755
--- a/webtools/bugs_udd.py
+++ b/webtools/bugs_udd.py
@@ -93,12 +93,17 @@ def main():
     _execute_udd_query(query)
 
     query = """PREPARE query_bugs (text) AS
-      SELECT distinct bu.source, bu.id, bu.title, bu.severity, bu.status, bu.done AS done_by
-        FROM blends_dependencies b
-        JOIN packages p ON p.package = b.package
-        JOIN bugs bu    ON bu.source = p.source
-        WHERE blend = $1 AND b.distribution = 'debian'
-        ORDER BY source, id;
+      SELECT source, bu.id, title, severity, status, done_by, tags FROM (
+        SELECT distinct bu.source, bu.id, bu.title, bu.severity, bu.status, bu.done AS done_by
+          FROM blends_dependencies b
+          JOIN packages p ON p.package = b.package
+          JOIN bugs bu    ON bu.source = p.source
+          WHERE blend = $1 AND b.distribution = 'debian'
+        ) bu
+        LEFT OUTER JOIN (
+          SELECT id, array_agg(tag) AS tags FROM bugs_tags GROUP BY id
+        ) bt ON bu.id = bt.id
+        ORDER BY source, bu.id;
     """
     _execute_udd_query(query)
     

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list