I’ve been looking for high leverage ways to contribute to Mozilla now that my spare time is virtually non-existent. Luckily, mediawiki-bugzilla is gaining a lot of traction at Mozilla and looks to be really helping out. Seeing as I started the project I decided to add some much needed features! These aren’t rolled out on wiki.mozilla.org yet but they will be soon (I have a couple of little things to finish first). Code can be found in my github repo (yes, I am currently working to rectify the mozilla/personal dual repo situation).

Status colors

First up, a minor yet helpful addition. When showing bug data in a table, the rows are now colored by their status. Spiffy.

Screenshot of colors

Screenshot of colors

And the code:

<bugzilla>
{
  "whiteboard": "[mediawiki-bugzilla]"
}
</bugzilla>

A couple of notes:

  • mediawiki-bugzilla adds CSS classes with the status values on the table automatically
  • The CSS can be changed by the mediawiki administrator by editing the css directly (not ideal) or adding in another css file at [extension location]/web/css/custom.css
  • The “lock” icons and such come from mediawiki. I’m working on removing them (by stopping medawiki from processing the extension’s ouput) but if you use a custom theme it shouldn’t be an issue
  • For this example, remember that type=”table” is the default…that’s why it’s rendered as a table

Configurable fields/columns

Once people started using the extension the first question was “can I choose which fields to show and hide?” With this change you 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.

Custom fields selected and columns shown

Custom fields selected and columns shown

And the code:

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

A couple of notes:

  • Columns are displayed in the order they are listed in “include_fields”
  • Not specifying “include_fields” gives the default fields
  • Not all fields have custom templates yet. This means some fields (such as assigned_to) won’t show up properly. I’m going to be writing a bunch but feel free to submit a patch!
  • Only “include_fields” is supported. mediawiki-bugzilla won’t do anything with “exclude_fields
  • _default” isn’t supported as a field, so list the fields you want explicitly

Javascript tables

Large lists of bugs on a wiki page can get a bit unwieldy. It was requested to be able to sort by columns, search through the results, and paginate to keep vertical space to a minimum. I beefed up the support for client side jquery/Datatable rendering.

Administrators can turn on client-side jquery table support

Administrators can turn on client-side jquery table support

And the code:

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

A couple of notes:

  • This is currently enabled by the mediawiki admin / all or nothing. Future plans will make it configurable on a per-table basis
  • Pagination is done client-side…it will not make the page load faster
  • Yes, the default skin is ugly. I haven’t taken a crack at it yet

Pie chart support

You can currently make bar graphs by setting type=”count”, display=”bar”, and including Bugzilla REST API /count parameters. I actually had support for other chart types stubbed out and decided to implement pie charts.

Pie charts of three different sizes

Pie charts of three different sizes

And the code:

<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>

A couple of notes:

  • You can specify a chart size by using size=”small/medium/large”. The default size is large. The size attribute doesn’t work for bar charts yet
  • I want to embed the numeric data in an accessible format for our screen reader friends. Right now, it is just an image
  • Yes, the default color scheme is ugly. I haven’t taken a crack at it yet

Unordered list support

We can make tables, we can make bar charts, and we can make pie charts…why not a simple list? While I was adding support for pie charts I added a simple unordered list display.

Bugs can be displayed in a list

Bugs can be displayed in a list

And the code:

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

A couple of notes:

  • The field/column support I talked about above works here too!
  • Field data is separated by ” – “. I haven’t taken time to add niceties like “(none)” when there isn’t data
  • The odd spacing in the screenshot is caused by mediawiki’s default css rules

Better error reporting

It’s not perfect, but I’ve put in a little more support for detecting errors. If the JSON is invalid or your “display” and “type” combination are invalid you will get a message saying so.

Invalid JSON input now shows an error

Invalid JSON input now shows an error

 

And the code:

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

A couple of notes:

  • PHP doesn’t give me the exact JSON parse error so I can’t be more helpful. This example has a trailing ‘,’, which isn’t allowed in JSON
  • Errors from the Buzilla REST API timing out or PHP using too much memory are not caught / reported
Tagged with:  

4 Responses to New mediawiki-bugzilla features

  1. It’s great to see these new mediawiki-bugzilla features and I think this is going to be a really useful tool for people.

    For the new Webdev get involved page it was really easy to get a page set up with this and we can give much more valuable information to new contributors than the previous Webdev get involved page did.

    David

  2. Anon says:

    You seem to have become more useful since leaving Mozilla. Thanks for making sure Facebook would let you work on Mozilla stuff, this is a useful feature. Next up, HTML bugmail :-)

  3. This is awesome! This covers all most all the features I wanted, thanks so much.

  4. Great additions! How do the JavaScript tables differ from what we had previously? Have you fixed the issue that prevents the tables from showing properly on wikimo using the default Mozilla skin?