Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rebase LegNeato repo on top of mozilla repo. Update Readme, fix line …

…endings
  • Loading branch information...
commit ad5b265451f04e02c90fb117a19b1047dd95f558 1 parent f3978bc
@LegNeato LegNeato authored
View
4 Bugzilla.php
@@ -168,8 +168,8 @@ function BugzillaRender($input, array $args, Parser $parser, $frame ) {
// Cache settings
$wgBugzillaUseCache = TRUE;
-$wgCacheObject = 'BugzillaCacheDummy';
-$wgBugzillaCacheMins = 10;
+$wgCacheObject = 'BugzillaCacheMysql';
+$wgBugzillaCacheMins = 5;
$wgBugzillaChartStorage = realpath($cwd . '/charts');
$wgBugzillaFontStorage = $cwd . '/pchart/fonts';
View
1  BugzillaOutput.class.php
@@ -28,7 +28,6 @@ protected function _render_error($error) {
}
public function render() {
-
// Get our template path
$this->template = dirname(__FILE__) . '/templates/' .
$this->config['type'] . '/' .
View
7 BugzillaQuery.class.php
@@ -234,8 +234,11 @@ public function _fetch_by_options() {
return;
}
- // Now that we have the data, process it
- // $this->_process_data();
+ // Check for REST API errors
+ if( isset($this->data['error']) && !empty($this->data['error']) ) {
+ $this->error = "Bugzilla API returned an error: " .
+ $this->data['message'];
+ }
}
}
View
127 README.md
@@ -4,13 +4,13 @@ MediaWiki extension for Bugzilla
This is a MediaWiki extension that provides read-only access to the
[Bugzilla REST API](https://wiki.mozilla.org/Bugzilla:REST_API)
-__Please note that this isn't finished / ready for production yet!__
+__Please note that there are still big outstanding bugs!__
Requirements
================================
* Requires HTTP_Request2 from PEAR
-* Requires the SMARTY template library installed
+* For charting, requires gd
Installation
================================
@@ -26,9 +26,9 @@ Please substitute your installation path if it is different*
configuration variables. Current configuration variables and their defaults
can be found at the end of `Bugzilla.php`
5. Run the MediaWiki update script to create the cache database table
- `php /var/lib/mediawiki/maintenance/update.php`. *Note that you may need to
+ `php /var/lib/mediawiki/maintenance/update.php`. __Note that you may need to
add `$wgDBadminuser` and `$wgDBadminpassword` to
- `/etc/mediawiki/LocalSettings.php` depending on your MediaWiki version
+ `/etc/mediawiki/LocalSettings.php` depending on your MediaWiki version__
Usage
================================
@@ -39,7 +39,17 @@ You use this extension in this way:
(JSON REST API query key/value pairs)
</bugzilla>
-An example:
+By default, it will output a colored table:
+
+![Example output](http://i.imgur.com/IM6xd.png"Example output")
+
+Note that the wiki tag name defaults to "bugzilla" but is
+configurable by the administrator.
+
+Examples
+================================
+
+All P1 bugs in the Bugzilla product:
<bugzilla>
{
@@ -48,24 +58,101 @@ An example:
}
</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:
+
+ <bugzilla>
+ {
+ "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](https://wiki.mozilla.org/Bugzilla:REST_API)
-Note that the tag name defaults to "bugzilla" but is configurable.
-There is also __exploratory__ support for charting:
+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](http://i.imgur.com/p3u7r.png "Screenshot of the above")
+
+
+Charting
+================================
+
+There is also _some_ support for charting:
<bugzilla type="count" display="bar">
{
- "product": "Bugzilla",
- "priority": "P1",
- "x_axis_field": "severity"
+ "whiteboard": "[snappy:p1]",
+ "x_axis_field": "status"
}
</bugzilla>
Screenshot of the above:
-![Screenshot of the above](http://i.imgur.com/1H868.png "Screenshot of the above")
+![Screenshot of the above](http://i.imgur.com/tDUZ1.png "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](http://i.imgur.com/mobHA.png "Screenshot of the above")
+
Limitations
================================
@@ -74,12 +161,16 @@ Limitations
* This extension currently queries as a public (not logged in) user
* Charts are fairly hardcoded and don't work in many cases
-TODO
+Known Issues
================================
+* The __size__ attribute only works on pie charts
+* Rendering a page with an uncached query can take a bit
+* Large queries may exceed the allocated memory causing a blank page to be displayed. In this case you can recover by editing the page as follows:
+If your wiki page has the URL
+ https://wiki.mozilla.org/PagePath/PageTitle
+The URL to edit your page is
+ https://wiki.mozilla.org/index.php?title=PagePath/PageTitle&action=edit
-1. This is basically a prototype right now...needs to be cleaned up a lot
-2. The JQuery UI table doesn't render correctly...make it better
-3. Support more types of queries than just "bug" (the default)
-4. Support more types of wiki display than just a bug table
-5. Caching and cache invalidation for queries
-6. Support charting as a 1st class citizen
+TODO
+================================
+* Add more/smarter field display templates
Please sign in to comment.
Something went wrong with that request. Please try again.