Aklapper has uploaded a new change for review. https://gerrit.wikimedia.org/r/53128
Change subject: Add query and formatting for most urgent issues in Bugzilla ...................................................................... Add query and formatting for most urgent issues in Bugzilla Change-Id: I717a48d48d1c0ad2bc06087238c33078bcd2b9f5 --- M templates/misc/bugzilla_report.php 1 file changed, 54 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/28/53128/1 diff --git a/templates/misc/bugzilla_report.php b/templates/misc/bugzilla_report.php index 6f9ea0f..e06adce 100755 --- a/templates/misc/bugzilla_report.php +++ b/templates/misc/bugzilla_report.php @@ -135,6 +135,36 @@ 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)) { @@ -154,6 +184,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 @@ -196,6 +241,7 @@ $totalStatistics = array ('getTotalOpenBugs',); +$urgentStatistics = array('getHighestPrioTickets',); print "Status changes this week\n\n"; foreach ($statesToRun as $state) { @@ -234,3 +280,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/53128 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I717a48d48d1c0ad2bc06087238c33078bcd2b9f5 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Aklapper <aklap...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits