April 4

Extending Bugzilla Links in Thunderbird

Posted by Bryan Clark
Filed under mozilla | 13 Comments

I took a couple hours… ok most of the day yesterday to fix a little issue that’s been bothering me for a while.

Bugzilla links inside email messages.  I get countless messages where people reference bug 426175 but then don’t link to the bug.  The other option is for the person to include the link in the email which is ugly and pushes the flow around https://bugzilla.mozilla.org/show_bug.cgi?id=426175 because there is a large link inside the text.

Despite emails not being HTML mail, for whatever reasons, I still want bugs to be linked in a reasonable manner when I’m looking at my mail.  I couldn’t find an existing solution, though there likely is one hiding somewhere.  So I started a new extension to solve my problem.

The Bugzilla Link Grabber Thing

I’m not good with names, another reason I probably shouldn’t have kids.  (Offspring of Bryan Clark Jr.)

Here is a typical message that contains a mix of bugzilla urls and shorthand bug mentions.  You can see the urls are long and a bit ugly, while the short hand link mentions (even though this example mentions the same bug) are not linked to the bug itself.

Before you view any mail the extension takes the long bugzilla urls and converts them into the shorthand form.  It also linkifies any shorthand bugs into working urls.

Right now the extension only understands mozilla bugzilla and gnome bugzilla because that’s all I have accounts for.  But others could be added and I was hoping to have a preferences dialog that allows you to add alternate bugzillas (see TODO).  But otherwise it works great.

For xpi downloads, source, TODO, and more details take a look at the Bugzilla Link Grabber wiki page.

Fixing things

If you’re interested in this working for your copy of bugzilla or see some bugs in the code, don’t ask, please dive right in and fix things. Don’t forget to grab the STEEL extension or this one won’t work.  Also it only works on thunderbird nightly builds right now; but maybe that’s something you can fix.

I put the extension source up at github, sorry if that’s not your RCS of choice.  Anybody who creates patches to fix one of the TODO items is welcome to one of my remaining invites to github.  I don’t really have anything else to give…

This entry was posted on Friday, April 4th, 2008 at 11:06 am and is filed under mozilla. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

13 Responses to “Extending Bugzilla Links in Thunderbird”

  1. Kurt on April 4th, 2008 at 12:07 pm

    Sweet! Thanks

  2. jonner on April 4th, 2008 at 12:43 pm

    Is it smart enough to convert the plaintext ‘bug xxxxx’ into a link to the right bugzilla based on the from address of the email? (e.g. if the mail came from a gnome.org address, it should create a link to gnome bugzilla, and if it came from a mozilla.org address, it should create a link to mozilla bugzilla, etc.)

  3. Bryan Clark on April 4th, 2008 at 1:07 pm

    jonner: that’s a great idea! It doesn’t have that kind of smarts, but I’d love to see it. Grab the code if you can!

    Another suggestion was that if it sees one kind of bugzilla link that it uses that for the default in that message. I’m not sure if that’s the right behavior, but we can try it.

  4. Mike McLean on April 4th, 2008 at 1:33 pm

    Yeah. Knowing which bugzilla is the real trick. Keying off of the sender’s email is interesting, but would of course fail a lot.

    I just use a handy bookmarklet for opening non-linked bugzillas that folks send me.

    Another option for making the links smaller is tinyurl. Also note that the bugzilla.redhat.com accepts urls of the form https://bugzilla.redhat.com/426175
    Still a little big, I realize, but somewhat less flow impeding.

  5. Mike McLean on April 4th, 2008 at 1:36 pm

    Yet another idea. Configure the extension to offer a (configurable) list of bugzilla links.

  6. Dave Miller on April 4th, 2008 at 2:31 pm

    Have you added this to http://wiki.mozilla.org/Bugzilla:Addons yet? :)

  7. Chris Ilias on April 4th, 2008 at 4:36 pm

    I just use Conquery.

  8. JoeS on April 4th, 2008 at 8:16 pm

    Thanks for singling out my post as an example of an “ugly post” :)
    (no offense taken, I know exactly what you meant)..The acceptance of HTML posting in newgroups is the obvious answer. IMHO it’s an example of intransigence in some parts of the community, that makes an extension neccessary when the real answer is to use available, and generally accepted practices.

  9. James Napolitano on April 5th, 2008 at 4:44 pm

    Bugmail contains all sorts of “X-Bugzilla-foo” headers to enable better filtering. I think there’s a bug to add the URL of the bug database as a new header precisely so filters can tell what database a bugmail is from. I think the easiest way to extract the URL now is from the “Do not reply to this email. You can add comments to this bug at
    https://bugzilla.mozilla.org/show_bug.cgi?id=212790” line.

  10. Bryan Clark on April 6th, 2008 at 11:37 pm

    JoeS: Yeah, I didn’t mean to single you out in anyway. The only reason it was chosen was because I tested against it a bunch. It had urls and short names, plus you included comment anchors. :) But you make a good point, there’s no reason why I’m not writing in HTML as well.

    James: it might be possible to grab those headers and use them for additional information about the bug that can be displayed or to guess the correct URL.

  11. Bryan Clark » Blog Archive » Travel, Work and Other Updates on April 7th, 2008 at 9:58 pm

    [...] I didn’t end up doing much on Saturday.  So in my recovery time I poked around with my bugzilla link grabber extension and added a little AJAX to it.  And thus I feel buzzword [...]

  12. John Resig - Simple Extensions in Firefox 3 on June 23rd, 2008 at 9:44 pm

    [...] STEEL – Example – If you’re interested in extending Thunderbird Bryan Clark provides a good example. [...]

  13. Cómo programar extensiones para Firefox on July 3rd, 2008 at 2:56 pm

    [...] estás interesado en aplicarlo a Thunderbird hay un ejemplo con STEEL. Archivado en Programación Deja aquí tu comentario ↓ Etiquetas firefox, frameworks, [...]

Leave a Reply