A MediaWiki extension that provides read-only access to the Bugzilla REST API
Перейти к файлу
Cassandra 01661f7c4b
Merge pull request #108 from mozilla/rmuller/upgrade-mediawiki
remove disableCache (deprecated) and replace deprecated wfGetCache
2024-08-16 01:43:54 -07:00
pchart Remove .DS_Store 2013-04-04 20:35:16 +01:00
templates Random fixes for bugzilla. 2024-07-23 16:52:24 -07:00
tests/phpunit Add test case 2016-09-27 16:32:09 +02:00
web Merge pull request #41 from reedy/lossless 2013-10-14 11:35:46 -07:00
.gitignore ignore charts 2017-05-11 00:50:50 -04:00
Bugzilla.class.php Use MediaWiki cache strategy and code 2016-12-30 13:15:02 +01:00
Bugzilla.i18n.php Fixes Bug 855560 - Adding the Mozilla MPL license header to all Mozilla-created source files. 2013-08-22 10:34:20 -07:00
Bugzilla.php remove disableCache (deprecated) and replace deprecated wfGetCache 2024-07-23 13:30:48 +02:00
BugzillaOutput.class.php Merge pull request #92 from rdalverny/use_wm_cache 2017-05-10 22:10:25 -07:00
BugzillaQuery.class.php Random fixes for bugzilla. 2024-07-23 16:52:24 -07:00
LICENSE add license file + listing at Special:Version 2015-10-02 00:49:47 +02:00
Makefile Add code style & linting rules for PHP 2016-09-26 20:03:33 -07:00
README.md Update README.md 2024-07-10 14:38:27 +08:00
Utils.php Fixes Bug 855560 - Adding the Mozilla MPL license header to all Mozilla-created source files. 2013-08-22 10:34:20 -07:00
composer.json Add code style & linting rules for PHP 2016-09-26 20:03:33 -07:00
phpcs.xml Add code style & linting rules for PHP 2016-09-26 20:03:33 -07:00

README.md

MediaWiki extension for Bugzilla

This is a MediaWiki extension that provides read-only access to the Bugzilla REST API

Please note that there are still big outstanding bugs!

Requirements

  • MediaWiki 1.17 or above.
  • For charting, requires gd

Installation

These directions assume your MediaWiki installation is at /var/lib/mediawiki. Please substitute your installation path if it is different

  1. Install the requirements above
  2. Check the project out into /path/to/your/mediawiki/extensions/Bugzilla
  3. Edit /path/to/your/mediawiki/LocalSettings.php and add require_once("$IP/extensions/Bugzilla/Bugzilla.php"); and change/override any configuration variables. Current configuration variables and their defaults can be found at the end of Bugzilla.php

Usage

You use this extension in this way:

<bugzilla>
    (JSON REST API query key/value pairs)
</bugzilla>

By default, it will output a colored table:

Example output

Note that the wiki tag name defaults to "bugzilla" but is configurable by the administrator.

Options

Valid bugzilla tag options are:

  • type: "bug" or "count" (defaults to bug)
  • For type bug:
    • display: "table" or "list" or "count" (defaults to table)
  • For type count:
    • display: "bar" or "pie"
    • size: "small", medium" or "large" (defaults to large)
  • stats: "show" or "hide" (defaults to "show")

Examples

All P1 bugs in the Bugzilla product:

<bugzilla>
    {
        "product": "Bugzilla",
        "priority":"P1"
    }
</bugzilla>

All new bugs flagged as uiwanted in the whiteboard:

<bugzilla>
	{
	    "whiteboard": "uiwanted",
	    "status": "NEW"
    }
</bugzilla>

All bugs in the bugzilla.org component that were resolved in 2011, with the stats summary hidden:

<bugzilla stats="hide">
    {
        "component": "bugzilla.org",
        "changed_after": "2011-01-01",
        "changed_before": "2011-12-31",
        "changed_field": "status",
        "changed_field_to": "resolved"
    }
</bugzilla>

Some commonly used query parameters are:

  • id
  • component
  • product
  • status
  • resolution
  • keywords
  • whiteboard
  • target_milestone
  • version
  • changed_after
  • changed_before

For more details on how to query in various ways, see the documentation for the Bugzilla REST API

Configurable fields/columns

Specify fields in the "include_fields" setting of BZ REST API options as you normally would. Mediawiki-bugzilla will then a) only fetch those fields and b) display those columns.

<bugzilla>
{
    "whiteboard": "[mediawiki-bugzilla]",
    "include_fields": ["id", "summary", "whiteboard", "status", "resolution"]
}
</bugzilla>

Screenshot of the above

Charting

There is also some support for charting:

<bugzilla type="count" display="bar">
    {
        "whiteboard": "[snappy:p1]",
        "x_axis_field": "status"
    }
</bugzilla>

Screenshot of the above:

Screenshot of the above

<bugzilla type="count" display="pie">
{
    "whiteboard": "[mediawiki-bugzilla]",
    "x_axis_field": "status"
}
</bugzilla>
<bugzilla type="count" display="pie" size="medium">
{
    "whiteboard": "[mediawiki-bugzilla]",
    "x_axis_field": "status"
}
</bugzilla>
<bugzilla type="count" display="pie" size="small">
{
    "whiteboard": "[mediawiki-bugzilla]",
    "x_axis_field": "status"
}
</bugzilla>

Screenshot of the above:

Screenshot of the above

Limitations

  • This extension (by design) is read-only
  • This extension currently queries as a public (not logged in) user
  • Charts are fairly hardcoded and don't work in many cases

Known Issues