Extension:Bugzilla Reports

From MediaWiki.org
(Redirected from Extension:BugzillaReports)
Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
BugzillaReports

Release status: stable

Implementation Parser function
Description Generate bugzilla reports
Author(s) Ian Homer from bemoko
Last Version 1.1 (July 7th, 2009)
MediaWiki 1.15.1
License GPLv2
Download BugzillaReports

check usage (experimental)

BugzillaReports generates great looking reports from Bugzilla which you can include in your MediaWiki pages (or in fact any PHP application). Great to provide access to Bugzilla info, for example:

  1. Generate release notes when you release
  2. Generate roadmap reports for what's coming in a future release
  3. Generate your personal task radar - what should you be doing next
  4. Access controlled reports - if you want to expose bugzilla summaries to those who don't have access to Bugzilla
  5. Provide reports easy for non-techies to read.

Displays dependency reports, last comments for bug when you hover over the bug, supports interactions with voting & flagging and helps you to see what needs to be done next. Read below for more bells and whistles. Makes reporting on your bugs much easier than through the standard Bugzilla search UI. It's your controlled window onto Bugzilla ...

Report issues, make enhancement requests and get involved @ bugzillareports.

Also see here for an active discussion thread on this extension.

Contents

[edit] Pre-requisites

[edit] Installation

  1. Download the extension bundle from BugzillaReports
  2. Unpack bundle into your extensions directory of your MediaWiki install. This should give you
    BugzillaReports/BugzillaReports.i18n.php
    BugzillaReports/BugzillaReports.php
    BugzillaReports/skins/bz_main.css
    etc

Add the following to your LocalSettings.php file:

require_once("$IP/extensions/BugzillaReports/BugzillaReports.php");
$wgBugzillaReports = array(
  'host'        => "localhost", 
  'database'    => "bugzilla",
  'user'        => "user",
  'password'    => "(your password)",
  'bzserver'    => "http://host"
);

or if you want to use interwiki links (which is recommended and worth the extra effort of setting up)

...
  'interwiki'   => "bugzilla"
...

where parameters are defined as follows:

  1. host ⇒ defaults to localhost, but if Bugzilla not on same machine as your mediawiki install then set the hostname here
  2. user and password of the database user with read access to the bugzilla database
  3. To get the bugs to link through to Bugzilla server, use one of:
    1. bzserver ⇒ the URL of the bugzilla server for which the click through links should point to e.g. http://host". Note that the path "/show_bug.cgi?id=" is automatically added for you by the extension
    2. interwikiinterwiki prefix linking to bugzilla instance
      For example set up interwiki prefix of bugzilla to point to URL http://host/show_bug.cgi?id=$1
  4. maxrows ⇒ set maximum number of rows to display (defaults to 200)
  5. maxrowsbar ⇒ set maximum number of rows to use in bar chart generation (defaults to 500)

[edit] PostgreSQL

$wgBugzillaReports = array(
  'host'      => "localhost", 
  'dbdriver'  => "pg",
  'database'  => "bugzilla",
  'user'      => "bugs",
  'password'  => "password",
  ...
);

[edit] Example Output

Bugzilla Report

Note that the bubble appears as you roll over a bug that has a last comment set.

[edit] Usage

[edit] By Example

Generate a report from Bugzilla based on search criteria, e.g.

Bugzilla Report

List all open bugs - note that status defaults to NEW,ASSIGNED,UNCONFIRMED,REOPENED and maximum of 200 rows (by default) are returned. Results are sorted by priority.

{{#bugzilla:}}

Report on P3 and higher bugs

{{#bugzilla:
  |priority=P1,P2,P3
}}

Report on a particular product version

{{#bugzilla:
  |product=myproduct
  |version=1.3
  |lastcomment=1
}}

Report on specific bug ids

{{#bugzilla:id=30,56,78,93}}
Last Comment Bubbles

Report on all enhancements with the text wiki in the summary with last comment bubbles

{{#bugzilla:
  |search=wiki
  |severity=enhancement
  |header=hide
  |lastcomment=1
}}

Setting the lastcomment parameter will generate a report which renders the last comment in bundles in bubbles as you hover each row (see image left) This has been tested on Firefox 3 and Safari 3, but this option may have issues with other and older browser. I'd be happy to hear feedback on this feature.

Report on all bugs that are not new

{{#bugzilla:status=!NEW}}

Everything except P1 and P2 bugs

{{#bugzilla:
  |priority=!(P1,P2)
  |status=*
}}

Set the message when no results are returned

{{#bugzilla:
  |product=doesntexist
  |noresultsmessage=all tasks complete
}}

Tasks with votes against them

{{#bugzilla:columns=+votes|votes=+}}

Bugzilla-reports-screenshot4.png

{{#bugzilla:
  |group=deadline
  |groupformat=radar
}}

Bugzilla-reports-screenshot5.png

{{#bugzilla:
  |group=version
  |bar=status
}}

All tasks created by me but not assigned to me

{{#bugzilla:columns=+to|from=me@bemoko.com|to=!me@bemoko.com}}

All tasks I'm cc'd on but not created by me and not assigned to me

{{#bugzilla:columns=+to,+from
  |to=!me@bemoko.com
  |from=!me@bemoko.com
  |cc=me@bemoko.com}}

Display list in a format that's handy for cutting and pasting into emails

{{#bugzilla:format=list}}

for example:

[IHO] (2008-07-22) Do something (#19)
[IHO] (2008-07-25) Do something else (#45)
[JBL] Don't forget this (#54)

[edit] Task Radar

This example gives you an idea of how to use the Bugzilla Reports extension to report on what you should be doing next:

{{task radar|me@bemoko.com}}

where task radar is defined as:

{{#bugzilla:flag={{{1}}}|lastcomment=1|heading=Flagged|noresultsmessage=|columns=+modified}}
{{#bugzilla:to={{{1}}}|columns=-version,+deadline,+modified|deadline=+3m|group=deadline|groupformat=radar
  |lastcomment=1|noresultsmessage=|heading=Up & Coming|depends=*}}
{{#bugzilla:to={{{1}}}|lastcomment=1|deadline=-|severity=enhancement|columns=-version,+component,+modified
  |product=live|noresultsmessage=|group=milestone|heading=Live Enhancements|sort=priority,status|link=milestone~live}}
{{#bugzilla:to=
{{{1}}}|lastcomment=1|severity=!enhancement|priority=!P5|deadline=-|columns=+component,+severity,+modified
  |product=live|noresultsmessage=|heading=Live Bugs|sort=priority,status}}
{{#bugzilla:to=
{{{1}}}|product=IS|deadline=-|group=component|lastcomment=1|columns=-version,+modified
  |sort=deadline,priority|noresultsmessage=|depends=*|heading=IS}}
{{#bugzilla:to=
{{{1}}}|lastcomment=1|deadline=-|severity=enhancement|columns=-version,+component,+modified
  |product=sites|noresultsmessage=|group=milestone|heading=Live Sites|sort=priority,status}}
{{#bugzilla:to={{{1}}}|columns=+deadline|votes=+|noresultsmessage=|heading=Voting
  |columns=+modified|sort=priority,status}}

[edit] Parameter Usage

parameter values description
alias alias value(s) alias query field
bar column name field to summarise in a bar chart - note that this also works in conjunction with the group parameter to provide a set of bar charts.
bzurl hide Set to hide to hide the link to the Bugzilla search page that is by default provided in the header of each report
blocks id of blocking task (or "*" to include blocking tasks inline) blocks query field
cc single username Query for any task cc'd to the specified username, only supports single value
columns id, cc, component, deadline, modified, priority, product, severity, status, summary, to, version, estimated, remaining comma separated list of columns to display in the specified order
component component name component query field
created date created date query field
customprefix cf_ Prefix that all custom fields begin with, by default it is "cf_", but some installations do use a different prefix
deadline "*" ⇒ (any), "+" ⇒ (set) deadline query field
debug 0 or 1 Set to enable debugging - outputs SQL at end of table
depends id of dependent task (or "*" to include dependent tasks inline) dependent query field
dependsstatus status query field Specify criteria for display depends (and blocks rows), e.g. dependsstatus=!(CLOSED,VERIFIED) will not display CLOSED and VERIFIED tickets in dependency or blocks report. It defaults to !(CLOSED,VERIFIED,RESOLVED)
detailsrow same as values for columns comma separated list of columns to display in the specified order on a second row
detailsrowprepend any text Text to prepend the details row with
disablecache 0 or 1 Whether to disable the page caching or not. If this is false then the bugs up updated dynamically each time the wiki page is accessed - note that this will affect performance.
estimated number query Estimated query field
filters e.g. cf_mycustomfield%3Dmyvalue%26cf_application_server%3DTomcat% filter on any field including custom fields
flag username, e.g. me@bemoko.com search for all tasks flag for the specified user
format table (default), inline, count or list format for the report
group any column name as described in the columns field field to group report on
format table (default), list, inline or count format of the report
groupformat radar (headings set to relative date names, e.g. today, tomorrow, next week) format to be applied to group headings
grouporder (same as order parameter) order for group sorting
heading any text Heading to display above table (if there are tasks displayed in the report)
headers hide Set to "hide" to hide the header row
hide true Hide all detail rows, useful in conjunction with totals (and perhaps group) to just display sub-totals
id bugzilla id ID query field
instance Alternative instance of Bugzilla as defined in the LocalSettings.php
keywords Search against keywords
lastcomment 1 display the last comment for each bug
maxrows any integer less than that configured in the LocalSettings.php configuration Maximum number of rows to return
maxrowsbar any integer less than that configured in the LocalSettings.php configuration Maximum number of rows to return in calculation of bar reports
milestone milestone value(s) milestone query field
noresultsmessage any text message Set the message when there are no results matching the query
nameformat "real" (default), "login" or "tla" format of names, either real name, e.g. Ian Homer, login name, e.g. blah@blah.com, or three letter acronym, e.g. IHO
order desc (or asc) sort order, defaults to asc
priority P1,P2,P3,P4,P5 priority query field
product bugzilla product names product name query field
quickflag 1 If flag is set against task then identify with a small "?" next to the ID which displays more info on hover over
search anything free text search - only searches short_desc at the moment
severity blocker, critical, major, normal, minor, trivial, enhancement severity query field
sort any column name (or comma separated list of column names) as described in the columns field field to sort on
status NEW,ASSIGNED,UNCONFIRMED,REOPENED,RESOLVED,VERIFIED,CLOSED status query field, note that this defaults to !CLOSED
to a valid username, e.g. me@bemoko.com assigned to query field
total any column name (or comma separate list of column names) columns to display a total at the bottom. For non numberic columns it just displays a count of the rows
version bugzilla version name/number version query field
votes "+" ⇒ display any task with votes against it votes query field


All query fields can take the following constructs

[edit] Date Query Fields

Some date time based fields can be filtered using date query values:

e.g.

[edit] Column Formats

[edit] Modified

Modified column is displayed as follows

+++ => modfied in last hour
++ => modfied in last day
+ => modified in last two days
- => modified in last three days
. => modified in last 4 days

with text description, e.g. < 1 day, in the roll over pop up.

If you prefer to have the date format in long format, i.e. YYYY-MM-DD, then set the parameter "modifiedformat=date"

[edit] With Semantic MediaWiki

This extension works well with the Semantic MediaWiki by

  1. tagging your page with a property, e.g. [[task::52]]
  2. and then passing the results of semantic search into the bugzilla reports function, e.g.

{{#bugzilla:|headers=hide|id={{#ask: [[{{PAGENAME}}]] [[task::+]] | ? task | link=none | headers=hide}}}}

[edit] Troubleshooting

  1. include the following in your LocalSettings.php file
    $wgDebugLogGroups  = array(
        'BMWExtension'      => '/tmp/logs-mediawiki-BMWExtension.log'
    );
    
    (Feel free to use any other location for your logs if /tmp is not appropriate)
  2. Include debug=1 in your bugzilla function call
    {{#bugzilla:
    |product=live
    |status=!RESOLVED
    |maxrows=10
    |heading=test 2
    |debug=1
    }}
    
  3. If the error is related to a SQL failure then you might want to try the SQL command (as shown with the debug=1 enabled) directly in the SQL command line and observe the behaviour
  4. Send to me, along with a description of the issue, the output of this log, a copy of the {{#bugzilla:}} call and the relevant output from the wiki page.


[edit] Installing on an old version of MediaWiki

We installed this extension on a 1.11.2 MediaWiki. At first, the extension reported that we didn't have a recent enough MediaWiki version: "Sorry, but your MediaWiki version is too old for BugzillaReports, please upgrade to the latest MediaWiki version."

We got around this by including ParserOutput.php before the include of BugzillaReports, like this:

 require_once("$IP/includes/ParserOutput.php" );
 require_once("$IP/extensions/BugzillaReports/BugzillaReports.php");
 $wgBugzillaReports = array(
    'host'        => "localhost", 
    'database'    => "bugs",
    'user'        => "bugs",
    'password'    => "password",
    'bzserver'    => "https://bugzilla.dom.ain/bugzilla"
    );

Hope this helps! /sjr/

[edit] Release Notes

Download latest release from [1]

[edit] v1.1 - 7th July 2009

 {{#bugzilla:resolved=2009-05-01:2009-05-31}}, {{#bugzilla:verified=2009-05-01:2009-05-31}},
 {{#bugzilla:closed=2009-05-01:2009-05-31}}, {{#bugzilla:reopened=2009-05-01:2009-05-31}}
 {{#bugzilla:columns=+hardware,os|os=Linux}}, {{#bugzilla:columns=+hardware,os|hardware=Macintosh}}

[edit] v1.0 - 12th February 2009

[edit] v0.9.9 - 21st December 2008

[edit] v0.9.8 - 3rd December 2008

[edit] v0.9.7 - 21st October 2008

[edit] v0.9.6 - 9th October 2008

[edit] v0.9.5 - 25th August 2008

[edit] v0.9.4 - 23rd August 2008

[edit] v0.9.3 - 22nd August 2008

[edit] v0.9.1 - 14th August 2008

[edit] v0.9 - 21st July 2008

[edit] v0.8 - 13th July 2008

[edit] v0.7 - 4th July 2008

[edit] v0.6 - 1st July 2008

[edit] v0.5 - 1st July 2008

[edit] v0.4 - 30th June 2008

[edit] v0.3 - 26th June 2008

[edit] v0.2 - 26th June 2008

[edit] v0.1 - 25th June 2008

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Toolbox