Jenkins BuildMonitor – 20000 Downloads Later

Yesterday, Jenkins BuildMonitor Firefox Add-on surpassed 20,000 downloads. I uploaded the first version on June 8th, 2008, so that’s almost 3 years ago, and there have been 26 releases since.

On average, there are about 2500-2700 active daily users on weekdays. That became the basis of my release mantra: “Let’s not piss 2500 people off.”

The top locales are en-US, de, en-GB, fr, ja, pl. We’ve got en, fr, and ja locales covered https://github.com/jenkinsci/firefox-extension-buildmonitor/tree/master/src/main/resources/firefox/chrome/locale. Any German or Polish translator around? please feel free to submit a pull request.

While the top operating systems are Windows, Linux, Darwin, Solaris, FreeBSD.

And as you know, this add-on is now named Jenkins BuildMonitor, though in practice it should still work with both Jenkins and Hudson just fine. As for the project management, I’m staying with the original Hudson – now Jenkins – community, source code on GitHub, mailing list on Google Groups, etc.

Hudson BuildMonitor v1.5.5

FIFA World Cup 2010 update: Australia was demolished by Germany 0-4.

After ten months since the last public approval (v1.0.2) and four review rejections from the Mozilla editors, Hudson BuildMonitor v1.5.5 was finally approved a couple of weeks ago.

This version contains a major refactoring effort, attempting to separate the generic JavaScript code from the Firefox specific code. The goal was to make it easier for me to create a Chrome extension version of Hudson BuildMonitor, but of course I never had the time to do it and by now there are already two Chrome extensions out there, Hudson Extension by sanitz and Hudson Monitor by Henning Hoefer.

What I didn’t know back then when I started the refactoring effort was that Mozilla introduced an add-on verification suite about a month after v1.0.2, and that the Mozilla editors started working on reducing global namespace pollution. Those two things were good of course, it’s just that I had to put more sporadic efforts to work on those changes, which then stretched this release even longer.

Some of those changes are:

  • Everything is now namespaced, and I really mean everything. The editors even picked up un-namespaced external libraries, which means Dean Edward’s Base is now name_edwards_dean.Base .
  • setTimeout usage should be replaced by nsITimer.
  • Login details management should use *drumroll* nsILoginManager.
  • Datejs can’t be used anymore because it extends native Date, I replaced it with Matt Kruse’s Date library.

Out of the bug fixes included in the 1.5.x releases, I’m particularly happy with:

  • Finding a workaround for HUDSON-2979, a problem that has been a blocker for OS X users. I bought a MacBook Pro about six months ago and was finally able to investigate this error myself.
  • Fixing the mysterious error with French translation files. It used to work in older versions prior to v1.0.2 because the property files were UTF-8 without byte order mark and they contained non-ASCII characters, then at one point it was accidentally encoded as ISO-8859-1 while still having those non-ASCII characters which then broke the add-on. To avoid this problem from happening again in the future, I decided to take the safer option and unicode-escape those non-ASCII characters.

Working on Hudson BuildMonitor on and off for the past two years (the first release was on 8 June 2008, wow, has it been _that_ long?) has been a good opportunity to revisit JavaScript, a language many developers used to look down at. I agree with Douglas Crockford that JavaScript has been misunderstood, checkout his talk on JavaScript: The Good Parts at Google, and with the emergence of server side JavaScript, I believe this language is going to take off next year.

And to those who are still using Hudson BuildMonitor, thank you.

Introducing Wordnik Search Firefox Add-on

For those Firefox users who often need to look up for a word.

Having lived in Australia for the last decade or so after the first 18 years growing up in Indonesia, I’m now at a point where I’m fluent enough in English but still occasionally need to look up for the definition of rarely used words and phrases, while at the same time I lost track of the more recent Indonesian slang and, again, I have to look for the meaning on the Internet.

I used to rely on multiple web sites like Dictionary.com, Wikipedia, and Google, to find out the definition of a word and how it’s supposed to be used. A simpler solution is long overdue, and I finally found out about Wordnik early last week. Wordnik provides the definitions of the word, examples with links to quality articles, Twitter messages containing the word, and also pronunciations, etymologies, and sample phrases, all in one convenient page.

Here’s how Wordnik page looks like for some English words: dissonances, crystallography. The tweets are instant win for Indonesian slang: jayus, jomblo. Pretty handy, eh? It would be even better if Wordnik can expand their dictionary to non-English languages.

Now, Firefox is my primary browser, how do I use Wordnik on FF? There are three options I can think of (1) search the word on Wordnik.com, (2) add Wordnik search engine to Firefox, or (3) use a bookmarklet. Each of these options uses too many mouse clicks, too many mouse movements, or too many keystrokes for me.

So I decided to scratch this itch and wrote Wordnik Search Firefox Add-on.

All you need to do is highlight a word or a phrase, right click, and select ‘Search In Wordnik’ option. A new tab with Wordnik page for the highlighted word/phrase will then appear.

If there’s no highlighted text, you can still right click and select ‘Search In Wordnik’, a search dialog window will appear and you can search for any word/phrase you want.

You can install this add-on from Mozilla.org, but it’s still currently beta so you have to tick the ‘Let me install this experimental add-on.’ checkbox. Any question? Please leave a comment. If you find any bug, please raise an issue.

Update (12/5/2010):

The add-on has been approved for public access by a Mozilla.org editor. Translation: no checkbox ticking is needed, install away!

BuildMonitor v1.0

It’s been a long time since the last one (v0.9.2 – November 2008), but I’ve finally managed to release Hudson Build Monitor v1.0 .  This add-on is still in the sandbox, I’ve been waiting for approval from the Mozilla editors for the last 9 months, so unfortunately you still have to login to download it.

A new feature in this release is build executor monitoring. This feature will work only on Hudson instance feeds (non-job feeds), and you have to enable it via Prefereces window -> Feeds tab -> Enable executor monitoring check box.

The executor status will be displayed next to the build status. It’s blue when one of the executors is running a build, red when one of the executors is stuck, and grey when all executors are idle or offline.

Another new feature is the support for HTTP Basic Authentication, this has been requested by a number of users with password-protected Hudson feeds. You can set the username and password in Preferences windows -> Network tab -> Username and Password fields.

Thanks to Jason Meridth who helped with testing this feature and wrote up his experience.

Other minor changes in this release:

  • ‘Add Link To Hudson Build Monitor’ menu only appears when you’re right clicking Hudson feed links (for all, for failures, for just latest builds), and no longer for all links.
  • Preference window is now tab-ified as seen from the above screenshot.
  • Hudson icon tooltip on Firefox status bar now displays a message that recommends user to add Hudson feed link via right click menu instead of manually adding the URL to Preferences window Feeds section. This feature was already implemented in v0.9 (released in November 2008) and documented on the wiki page, however, there are quite a number of users who are still not aware of it and keep adding the feed URL manually following the old tooltip message.

As usual, translations have been updated thanks to Eric Lefevre-Ardant and Seiji Sogabe. Unfortunately I had to temporarily disable the French translation in v1.0 due to something wrong with the file/text(s) which breaks the add-on. I’ll do a patch release when it’s all sorted out, in the mean time, users with French locale on Firefox will get the default English texts.

XStringBundle NS_ERROR_FAILURE

I got this error message on Firefox Error Console after adding fr-FR locale to BuildMonitor, which caused it to fail initialising the status bar feeds.

1="[Exception..." 2="Component" 3="returned" 4="failure" 5="code:" 6="0x80004005" 7="(NS_ERROR_FAILURE)" 8="[nsIStringBundle." 9="<div" id=":sd" 10="class="ArwC7c" 11="ckChnd">GetStringFromName" language="Error:"]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: XStringBundle :: getString :: line 17"  data: no] Source File: XStringBundle Line: 17</div>

Googling gave me some clues but still nothing obvious to solve the problem. At first I thought it has something to do with the non-ASCII characters, so I did a binary-replace on the property values, but still no luck. It’s only after I cat-ed the file then I noticed an empty space before the first property key. This empty space turned out to be a weird character that didn’t show up on Eclipse text editor, gedit, and vi.

I still don’t know what that character is. Here’s what Eclipse compare editor showed when I compared the cleaned up line with the original line, notice the non-ASCII character before monitor.init property key.

And BuildMonitor speaks French after that character is removed. Parlez-vous anglais?

Update (20/11/2008): This problem kinda irked me, so I investigated it further.

The weird character is actually the ISO-8859-1 character for UTF-8 byte-order mark. It seems like XStringBundle expects ISO-8859-1 property file, hence interpreting the BOM as part of the monitor.init property key.

A handy tool to inspect the BOM is octal dump, where you should be able to see EF BB BF hex at the beginning of the file. And instead of manually cleaning up the property key, I should’ve used native2ascii.

BuildMonitor v0.8

BuildMonitor v0.8 is finally here, you can download it from Firefox Add-ons page. This release has a number of nice improvements…

Multiple feeds monitoring

Now you can monitor multiple Hudson instances by configuring their feeds in BuildMonitor preferences. All feed status icons will be displayed on the Firefox status bar, you can mouseover or click each icon to get the build details for the corresponding feed.

Feed status display

The way BuildMonitor uses the orbs to represent the health summary of the feed in v0.7 has been a source of confusion to the users. Many users thought that the orb indicates the latest build status, and not the overall health of the feed.

Another source of confusion is the fact that some users use a Hudson feed with multiple projects, some use a Hudson feed with only 1 project, and some use job-specific feeds, which led to different expectation of what status should be displayed.

With that, I decided to (1) make the status icon configurable with an option to display the overall feed health or the latest build status, and (2) use the weather icon for the overall feed health, while the latest build status keeps using the orbs.

Sound and alert window notifications

v0.8 now has configurable options to enable sound and alert window notifications when there’s a build failure.

When enabled, BuildMonitor plays a shattered glass sound (kudos to The Freesound Project) following a build failure. While alert window notification is enabled by default, it shows an alert a la Growl at the bottom right corner of your desktop.

Note that alert window on OS X only works since Firefox 3.

Green is the new blue

Quite surprisingly, I got asked a number of times about why Hudson uses blue to indicate success (to which I just pointed to this thread and that thread) and why can’t BuildMonitor uses green instead.

I was quite reluctant to add green-for-success as an option in BuildMonitor considering that Hudson still uses blue and the option to use green is not there yet. But I guess if the users want to use green by configuring via BuildMonitor’s preferences menu, then at least they’re aware of the difference, so this option is included in v0.8 . Blue is still the default though.

Personally, I like blue better :p.

Crisper icons

I added several new icons from Tango Project in v0.8, and updated the existing icons with new PNGs having transparent background.

Open page in new/current tab

Now you have the option to open build pages in a new tab or the current tab.

The preferences page now looks like this in v0.8…

Firefox add-on status

The add-on is still listed as experimental on addons.mozilla.org’s sandbox, it has been 4 months since I nominated it for approval. The AMO editors are still working on clearing up a huge list of add-ons to approve, I don’t know when BuildMonitor will be approved. I agree that the approval process can scale, but it doesn’t.

With almost 400 active BuildMonitor users (according to addons.mozilla.org), it would be very nice to auto-upgrade all of them. But since we’re still waiting for approval, you have to login again to download, sorry.

Please let me know what you think about this new release. Any comments? suggestions? criticisms?

Kaptcha v2.3 And BuildMonitor v0.7

Jon released Kaptcha 2.3 which includes a patch I submitted about 2 months ago. This patch replaced imaging library with pixels. If you look closely at the new kaptcha image…

you will notice that the water effect (at the centre of the image) is now visible with pixels, whereas it wasn’t at all with imaging library in the original simplecaptcha implementation. I tested various settings of the water effect, and opted to minimise the effect so lowercase letters on a small font size are still easy on human eyes. Another change with 2.3 is the ripple effect on the characters. It’s not too obvious on the above image, but it’s more visible on uppercase letters with larger font size.

All in all, I think Kaptcha is a nice simple library that does the job. I started using it with Blojsom SCode Plugin, and contributed some improvements back to Kaptcha. Another (more popular) java-based captcha library is JCaptcha, which is also used by SCode Plugin. I’m not a big fan of JCaptcha for the simple reason that their generated captchas are hard to read. It’s interesting that similar comments were made on Hudson mailing list.

Now, on to Hudson Build Monitor. I just released BuildMonitor 0.7 last night. This version is compatible with the recently released Firefox 3.0.1, and it includes id-ID l10n as the first translation. Next version will have build executors monitoring. I’ve started working on the UI, but the data feed is yet to be added to Hudson core.

As you can see from the add-on page over at mozilla.org, this add-on still hasn’t received an approval for public access. I understand that the AMO editors (which all/mostly are volunteers) have been working hard with the crazy number of submissions per day since Firefox 3 release, but I believe that the current approval process will keep facing the same problem every time there’s a sudden jump in the number of add-on reviews, unless Mozilla allocates additional editors to help out. This is not a rant or gripe towards the editors, on the contrary, kudos to them for the work that they’ve been doing.

If I can suggest a change to the approval review process, I think it’s better to distribute the review tasks to the submitters by specifying a detailed list of tests that must be done by those submitters, and keep the tasks that the editors must do as minimal as possible. For example, if AMO provided me with 50 things to test, then I would go through the list, record the tests as a video, and put them on youtube. The reviewers can then just review the video, and still perform only the really really necessary checks, like scanning the source code for any obvious security issues.

So, Hudson users, please be patient, you have to keep logging in to add-ons.mozilla.org to download the add-on for now :).

BuildMonitor Development Notes

Usage Scenario

When I first developed BuildMonitor, I thought that the typical users would be something like a team of 5-10 developers working on a project, and they would be located in the same building.

After v0.1 was released and feedback started coming in, I learned that some users want to monitor 10-20 projects on the same Hudson instance, there are projects with developers scattered across different time zones, and there was someone who asked for non-English translations since Hudson itself has been translated to 7 languages.

Feed Processing

On v0.1 BuildMonitor attempted to parse a complete Atom feed using jFeed & jQuery, which was ok on my tiny test feed, but failed misserably on real projects with lots of builds resulting in large feed. The full Atom feed parsing slowed Firefox for several seconds and froze the user interface, specially on low-spec machines.

This had since been fixed by parsing only the minimum required elements and by limiting the number of builds to parse. I also decided to use plain DOMParser instead of jFeed.

Testing

Javascript and XUL coding was the fun part of the add-on development, testing was the annoying part. I haven’t found any way to automate Firefox Add-on testing, and as everyone knows, manual UI testing sucks.

Mozilla Add-ons Policy

Mozilla has been doing a great job with ensuring the quality of the add-ons with their policy which protects Firefox users from malicious add-ons. The policy requires user reviews for public access nomination, but at the same time the site requires user registrations / login to download a sandboxed add-on, something that most people like to avoid.

This introduces a chicken or egg situation. Add-on needs users to test and review the site, but the potential users and reviewers are chased away by the requirement to login. This is even worse for BuildMonitor because the intended audience is targeted to Hudson users, a much smaller portion of Firefox users.

L10N

New translation can easily be added to BuildMonitor by adding new locale files to /trunk/hudson/extras/firefox-extension/buildmonitor/src/chrome/locale/ .

As someone who is quite fluent in Indonesian, I attempted to translate BuildMonitor to Bahasa Indonesia (id-ID locale). And it turned out that translating IT terms to Indonesian wasn’t easy, even with the use of Glosarium. I left Indonesia before the era of Internet, and by now there are tons of Indonesian technical terms that I’ve never heard of before.

What’s Next

Figure out a way to implement automated unit testing, at least for the javascript code, consider using JSMock and JsUnit. Try using Maven to build BuildMonitor, to make it consistent with the rest of Hudson.

BuildMon v0.1 – Bringing Hudson Orbs To Firefox

Update: documentation and screenshots have been moved to Hudson wiki.

I’ve just released BuildMon Build Monitor v0.1, a Firefox Add-on that displays Hudson Build status on Firefox status bar panel. You can install it from https://addons.mozilla.org/en-US/firefox/addon/7522 .

This add-on is currently sandboxed (only registered users can click the ‘Add to Firefox’ button). It still needs at least a user review before I can nominate it for public access. So if you can help with a review, it will be highly appreciated. I’ve tested it on Firefox 2.0.14 and 3.0RC2 (Gran Paradiso), on Windows Vista and Ubuntu Gutsy Gibbon, against Hudson 1.211’s feed.

BuildMon uses Hudson orbs as the build status indicator.

  • Blue orb (success) – all builds were successful.
  • Yellow orb (warning) – there’s at least one failed build, but the latest build was a success.
  • Red orb (failure) – the latest build failed, someone should fix it, the build breaker is not allowed to go for lunch or go home :p.

BuildMon development was quite straightforward. Mozilla Developer Center has a nice tutorial on Building an Extension, and XUL Planet’s Element Reference is very handy. The only problem I had was on the weird behaviour of the tooltip and popupmenu elements, it took me a while to figure out that placing them within the wrong parent elements resulted in the elements appearing when there are other add-ons installed, but not when it’s the only installed add-on.

BuildMon uses jQuery, Datejs, Pretty Date, and jFeed. I slightly modified jFeed to pass error callback from jQuery.ajax .

Hope you’ll find this add-on useful, and remember… thou shalt not ignore the red orb!

I’ve been using Hudson since its early version (way way before m2 support), mostly for my personal projects. Back then I used CruiseControl at work, and I also briefly looked at Continuum as another option. Hudson has by far been the best at providing the right balance between convenience and flexibility, mad props for that.