Aklapper has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/53387


Change subject: bugzilla_report.php: Add query and formatting for list of 
urgent issues
......................................................................

bugzilla_report.php: Add query and formatting for list of urgent issues

Change-Id: I3b13a8353c200bf63197668bcfc711848cab23c6
---
M templates/misc/bugzilla_report.php
1 file changed, 54 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/87/53387/1

diff --git a/templates/misc/bugzilla_report.php 
b/templates/misc/bugzilla_report.php
index 8cb8f8c..cf4c1d6 100755
--- a/templates/misc/bugzilla_report.php
+++ b/templates/misc/bugzilla_report.php
@@ -148,6 +148,35 @@
 END;
 }
 
+function getHighestPrioTickets() {
+         return <<<END
+SELECT
+        products.name AS product,
+        components.name AS component,
+        bugs.bug_id AS bugID,
+        bugs.priority,
+        bugs.delta_ts,
+        profiles.login_name AS assignee,
+        bugs.short_desc as bugsummary
+FROM
+        bugs
+JOIN
+        profiles ON assigned_to = profiles.userid
+JOIN
+        products ON bugs.product_id = products.id
+JOIN
+        components ON bugs.component_id = components.id
+WHERE
+        resolution = ""
+AND
+        priority = "Highest" OR priority = "Immediate"
+ORDER BY
+        product, component, delta_ts
+LIMIT
+        200;
+END;
+}
+
 function formatOutput($result) {
         while ($row = mysql_fetch_row($result)) {
                 if (is_array($row)) {
@@ -166,6 +195,21 @@
 function reportFailure($text) {
                 print "Wikimedia Bugzilla report (FAILED), $text ";
                         die( "FAILED\n\n$text\n" );
+}
+
+function formatOutputHighestPrio($result) {
+        printf( "%-13.13s | %-13.13s | %5s | %-9.9s | %-10.10s\n %-20.20s | 
%-37.37s\n",
+                "Product", "Component", "BugID", "Priority", "LastChange", 
"Assignee", "Summary" );
+        printf ( "%-60s", 
"--------------------------------------------------------------" );
+        print "\n";
+        while ($row = mysql_fetch_row($result)) {
+                foreach ($row as $row_i) {
+                        $row = str_replace ( '@', '[AT]', $row);
+                }
+                printf( "%-13.13s | %-13.13s | %5s | %-9.9s | %-10.10s\n 
%-20.20s | %-37.37s",
+                        $row[0], $row[1], $row[2], $row[3], $row[4], $row[5], 
$row[6] );
+                print "\n";
+        }
 }
 
 # main
@@ -212,6 +256,8 @@
 
 $createdStatistics = array('getBugsCreated',);
 
+$urgentStatistics = array('getHighestPrioTickets',);
+
 print "Status changes this week\n\n";
 foreach ($statesToRun as $state) {
         $sql = 
getBugsChangingStatus(date('Y-m-d',$begin_date),date('Y-m-d',$end_date), 
$state);
@@ -258,3 +304,11 @@
         formatOutput($result);
         print "\n";
 }
+print "\nMost urgent open issues\n\n";
+foreach ($urgentStatistics as $report) {
+        $sql = getHighestPrioTickets();
+        $result = mysql_query($sql);
+        if (!$result)
+                reportFailure("Query failure");
+        formatOutputHighestPrio($result);
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/53387
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b13a8353c200bf63197668bcfc711848cab23c6
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Aklapper <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to