aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-06-06 04:37:34 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-06-06 04:37:34 +0000
commit2a66e5ce6968703979bcbe6e9eec188c03bf9bd5 (patch)
tree7bd6dded7fb1d110d2bf91beceed402cb2a23e92
parentAdd baseline help. (diff)
downloadrbot-bugzilla-2a66e5ce6968703979bcbe6e9eec188c03bf9bd5.tar.gz
rbot-bugzilla-2a66e5ce6968703979bcbe6e9eec188c03bf9bd5.tar.bz2
rbot-bugzilla-2a66e5ce6968703979bcbe6e9eec188c03bf9bd5.zip
implement bugstats.
-rw-r--r--bugzilla.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/bugzilla.rb b/bugzilla.rb
index 16ad676..fe8a2b5 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -476,6 +476,40 @@ class BugzillaPlugin < Plugin
end
end
+ # Produce support of all bug status counts
+ def bugstats(m, params)
+ begin
+ if params[:zilla]
+ check_zilla(params[:zilla])
+ zilla = @zillas[params[:zilla]]
+ elsif get_zilla(m)
+ zilla = get_zilla(m)
+ else
+ m.reply "Wrong parameters (no bugzilla specified), see 'help bugstats' for help."
+ return
+ end
+
+ title = "#{zilla.name.capitalize} bug status totals"
+
+ # Build our URL
+ query = 'x_axis_field=bug_status'
+ #status.each { |s| query += "&bug_status=#{s}" }
+ #reso.each { |r| query += "&resolution=#{r}" }
+
+ # Get the data
+ results = zilla.report(query)
+
+ # Remove the CSV header
+ results.shift
+
+ # Display output
+ m.reply title+" "+(results.map { |b| "#{b[0]}(#{b[1]})" }.join(' '))
+
+ rescue ::Exception => e
+ m.reply e.message
+ end
+ end
+
# Produce architecture statistics using Bugzilla reports
#
# Using the bugzilla reporting functionality, we can produce a
@@ -878,6 +912,16 @@ plugin.map 'bug :zilla :number',
:action => 'bug',
:auth_path => 'view'
+plugin.map 'bugstats :zilla',
+ :requirements => {
+ :zilla => /^[^ ]+$/,
+ },
+ :defaults => {
+ :zilla => nil,
+ },
+ :action => 'bugstats',
+ :auth_path => 'view'
+
plugin.map 'archstats :zilla :status :reso',
:requirements => {
:status => STATUS_INPUT_N,