Blog

  • The story of hgstats

    tl;dr: I built a thing to see public graphs of hg.mozilla.org called hgstats.

    Lately, we’ve had problems with Mercurial at Mozilla. The Developer Services Team added a bunch of instrumentation to the hg webheads to help us track what is going wrong and when, to give us somewhat an early indicator of when things get shot to hell. All of these are on the Mozilla Graphite instance which are behind employee-only LDAP. However, an interesting quirk is that the image rendering is actually available without authentication. As a community Sheriff, I’ve been keeping close watch on hg throughout my shift with images that releng folks or hwine gave me. This gave an indicator of when to close trees so that we don’t end up having everything turn red. On Thursday evening, I was watching the conversation in #vcs on irc.mozilla.org, when bkero mentioned he’d made a dashboard in graphite. It suddenly dawned on me that I could just embed those images onto a page and quickly have a public dashboard!

    Armed with a bunch of images from Ben, I created a github pages repo with a lovely theme that’s available by default. I embedded the images onto a static HTML page and suddenly, we had a minimal dashboard. It wouldn’t auto-refresh or let you alter the duration of the graph, but hey, now we had one place for things! This first step took about 15 minutes.

    There were two features I had in my mind as must-haves: a) the page must let me change the hours of the graphs (i.e. last 2 hours, last 4 hours, last 8 hours, etc), and b) it should auto-refresh. I’ve looked at backbone several times in the past and I figured this was a good time as any to get cracking on building a backbone.js app.

    I started slowly, the first step was, get everything I have right now, rendered with backbone. I spent a lot of frustrating hours trying to get it to work, but couldn’t because of silly mistakes. I haven’t been coding in JS much and it shows 🙂 I think I stayed up until 2 am trying to diagnose it, but I couldn’t. When I woke up in the morning, I spotted the trouble immediately and it was a tiny typo. Instead of <{13371f13f0bf161e7595c2ac5df92e005bed3de1d132ef646d0a44f3a1a9ee62}=, I typed <{13371f13f0bf161e7595c2ac5df92e005bed3de1d132ef646d0a44f3a1a9ee62}$. After that first step, I got the router bit working and I had an app that could dynamically change the range of hours in the graph! I’d met my first goal!

    I talked to mdoglio who took a quick look at the code and thought models might be a good idea if I’m dealing with data. I refactored the code again to use models, which cleaned it up quite well! Overnight, I had a pull request from hwine to add another graph as well, which I also made more dynamic.

    The hardest bit was getting auto-refresh working. I couldn’t figure out an easy way to solve the problem. Eventually, I ended up with setTimer, but the full credit for the right incandation goes to bwinton.

    High Five!

    Working with backbone has been great, but I wish the documentation did more than just tell me what each function did. Python’s documentation often gives you more than function’s description, it tells you how you would use it practically. Of course, there quite a few resources that already fill this gap. I found backbonetutorials.com pretty useful. I got most of the basic idea of backbone from the site.

    I also submitted it to Webdev Beer and Tell (my first submission!). Mike kindly presented it for me (no, he’s not the real nigelb!) and you can watch the video on Air Mozilla if you have some free time 🙂 I would totally recommend watching the whole video, but if you don’t have a lot of time, skip to 6:37.

    This is the first time I’ve built a single-page app, so I’d love feedback (extra points if you can do a code review). The code is on GitHub.

  • OKFestival Fringe Events

    The writeup of the OKFestival is very incomplete, because I haven’t mentioned the fringe events! I attended two fringe events and they both were very good.

    First, I attended CKANCon right before OKFestival. It was informal and co-located with CSVConf. My best takeaway has been talking to people from the wider community around CKAN. I often feel blind-sided because we don’t have a good view of CKAN. I want to know how a user of a portal built on CKAN feels about the UX. After all, the actual users of open data portals are citizens who get data that they can do awesome things with. I had a good conversation with folks from DKAN about their work and I’ve been thinking about how we can make that better.

    I finally met Max! (And I was disappointed he didn’t have a meatspace sticker 😛

    The other event I attended was Write the Docs. Ali and Florian came to Berlin to attend the event. It was total surprise running into them at the Mozilla Berlin office. The discussions at the event were spectacular. The talks by by Paul Adams and Jessica Rose were great and a huge learning experience. I missed parts of oncletom’s talk, but the bit I did catch sounded very different to my normal view of documentation.

    We had a few discussions around localization and QA of docs which were pretty eye opening. At one of the sessions, Paul, Ali, Florian and I discussed rules of documentation, which turned out pretty good! It was an exercise in patience narrowing them down!

    I was nearly exhausted and unable to think clearly by the time Write the Docs started, but managed to face through it! Huge thanks to (among others ) Mikey and Kristof for organizing the event!

  • OKFestival – Berlin, 2014

    For the first time, I actually attended the OKFestival. I didn’t get to attend many sessions, but the conversations I’ve had are spectacular.

    The first surprise was meeting malev. A couple of years ago, we both worked together on the Ubuntu project. Now, he’s an Open News Fellow and I work at Open Knowledge. The FOSS world is truely small 🙂

    I finally got to meet Christie! I’ve heard of Christie since right before she started at Mozilla, when I first heard of Open Source Bridge, and later she started at Mozilla Webdev, where I was closely involved back then.

    Georg came over to say hi on Tuesday. When I realized that he was in Uganda for the Mozfest East Africa, I introduced him to Ketty who was also there, leading to an interesting conversation and great connection.

    George Sattler works for XVT solutions in Australia and is our partner. He is fairly certain that I don’t sleep 😉 We’ve been having conversations over email for quite a long time and it was great to meet George in person.

    The Venue

    It’s been a long time since I’ve met Adam Green, the editor of Public Domain Review. It was nice catching up with him. Also, Joris! I hadn’t seen him since he moved on from OKF 🙂

    I haven’t met Riju since he’s moved to Delhi and I met him in Berlin! Totally random and great running into him 🙂

    The last I met Kaustubh was at Pranesh’s farewell party in October (?). We had a good time catching up.

    Folks from local groups across OKF. As a part-time system, I talk to most of the OKF community folks at some point through RT. Additionally, I was going around asking feedback for the sysadmin team. It was great for me to put a face to names and I suspect vice versa as well.

    The usual suspects who were great to meet, are of course, my lovely teammates. It’s nice to meet in person, grab a drink, and talk.

    Congratulations again to Bea, Megan, Lou, and Naomi for making OKFestival happen!

    Cutting the Cake
  • Jinxed!

    A couple of weeks ago, I requested L3 access as part of my Sheriffing work and my request was granted. I think I’ve totally jinxed things since then 😉

    The tree. IT'S BURNING!

    The first Sunday afterward, we had a patch that was landed into aurora inadvertently causing massive spike in crashes. I saw it myself and suspect that my copy was corrupt and downloaded the latest! Of course, to no avail. I finally noticed the right bug and Kairo was looking for someone to back it out. I backed it out and triggered a rebuild which fixed the issue.

    The next Saturday, we had mobile imaging failures. This one was fun fixing, I talked to Nick Thomas and Chris Cooper on the phone. All it needed was one command, but it took us some time to get there 🙂 But hey, it got me mentioned under Friends of Mozilla.

    Having more access to fix things somehow makes me feel responsible!

  • Training in Tanzania

    On the last Monday of April, I found myself nervously standing in a room of about 15 people from the e-Government Agency and National Bureau of Statistics in Dar es Salaam. They were waiting for me to start training them in Python and CKAN. I’ve been programming in Python since 2011, but I’ve never actually trained people in Python. On the first day, I didn’t have any slides. All I had was one [PDF][pdf] from Wikibooks which I was using as material. I didn’t even cover the whole material. By the end of the day though, I could sense that it was sinking into the attendees a bit.

    It all started with an email from my manager asking me if I was available to do a training in Tanzania in April. After lots of back and forth, we finalized on a date and a trainer to assist in the trainings, and I flew in. Dar es Salaam, strangely, reminded of growing up in Salalah. I got in a day early to prep for the week and settle in. The trainer looking groggy on a Monday does not bode well!

    People who train often don’t tell you this – Trainings are exhausting. You’re most likely to be on your feet all day and walk around the room helping people who’re lagging behind. Looking back, the training was both fun and exhausting. I enjoyed talking about Python, though I feel like I need more practice to do it well. The CKAN training, I was pretty satisfied with the outcome, by the end of the week, the folks from e-Gov Agency went in and setup a server with CKAN!

    Note to self: Write these posts immediately after the trip before I forget 🙂