Starting Work on an Open Source Project

Published in Open Source

For my final semester at the University of Guelph, I have been lucky enough to take on a project course to work on open source software. The School of Computer Science has a course called CIS*4900 in which upper year students can be supervised by a professor and work on a project that is generally related to that particular professor’s research area. Back during the course selection period, I inquired about working on an open source project for the course and I was delighted to hear that it would be a possibility.

Looking back on my academic sequence and co-op work terms, I have used a lot of different open source projects. These projects have made me vastly more productive and I have always considered giving back but continually thought that it would be too difficult. I am hoping to break that mindset during the next 4 months as I embark on the journey from open source consumer to open source contributor and I will be using this blog to chronicle my adventures!

The Project

After much debate, I have chosen to work on Mozilla’s Firefox Marketplace and Firefox Add-ons projects for the semester. My supervisor, Dr. Greg Klotz, informed me about these projects. Firefox Marketplace is the official portal to search, download and install Firefox applications on both the Firefox browser and Firefox OS on mobile devices (think: App Store). The Firefox Add-ons project is the official website to download extensions and themes for a variety of Mozilla products including Firefox, Thunderbird and SeaMonkey. These two projects collectively boast over 500 million users daily, which is very impressive. Knowing that any code that I write will have such a wide reach is really quite exciting.

The technology stack for the projects is mainly Python, Django and MySQL along with web-based technologies including HTML, CSS and JavaScript. These required skills are quite fitting, as this was mainly what I was working with over my two co-op terms at Polar. I haven’t done a lot of Django development since that time but I am thrilled to get a chance to put those skills to good use.

Getting Started

In order to effectively get started with an open source project, the first thing that you should do is get the project working locally so that you can test all of the changes that you are going to make. This can sometimes be a very frustrating experience in itself so I am going to try to document any troubles that I had for any future developers.

Since such a wide range of individuals work on Mozilla projects, their documentation is really quite good. I went through the installation guide for three separate projects that can be found on Github: Zamboni, Fireplace and Commonplace.

The first discrepancy that I ran into while going through the installation guide for Zamboni was that the project only supports Python 2.6. My system Python was 2.7.5 at the time, which meant that I would have to downgrade. This was less than ideal but I really wanted to be consistent with the environment that Mozilla uses in production to minimize any silly errors on my part. I installed Python 2.6 using Brew and overwrote a few existing symlinks to get everything working properly.

The next issue that I experienced was during the installation of all of the project dependencies into my virtual environment. PIL (Python Imaging Library) would not complete installation correctly since it was complaining about not finding the proper freetype headers. I was able to solve this by creating a symlink to the proper headers like so (I had already installed freetype via Brew):

ln -s /usr/local/opt/freetype/include/freetype2 /usr/local/include/freetype

Once all of the dependencies installed correctly, I had to configure the application to use a few local settings just as suggested by the documentation. The project provides a settings template file within docs/settings/ so I copied this to add a settings file for both the Add-ons project (AMO) and the Marketplace project (MKT).

cp docs/settings/

cp docs/settings/

Within, I had to change the import statement to the following:

mkt.settings import *

After this seemed to be working, I had to create the database. The documentation suggests using the command line program mysqladmin to do this but I just ended up creating it in Sequel Pro, a really nice MySQL front-end program for OSX.

Side note: If you get a message complaining that there is no module named chances are that you are not within the proper virtualenv that you installed the dependencies in. This problem bit me for a while after I opened a new tab in my terminal!

Upon running the Zamboni project for the first time, I experienced a generic error message. As it turns out, the project requires LESS to compile some of the stylesheets and I didn’t have this installed. This should have been a simple npm install away but that process conked out as well with a CERT_UNTRUSTED error. After a little bit of searching around, I found that changing the main npm registry to use http rather than https would alleviate this error:

npm config set registry=

After that installation was complete, the server seemed to run without any issues! Overall, the process of getting the projects running locally was not as challenging as I initially anticipated. For good measure, I tried to run the test suite and found that it did run but it took a long time to complete. I suppose this is natural given the extent of the project and the coverage that it has.

Now that I have all of the projects cloned, installed and functioning, I have begun looking for some bugs to tackle in Bugzilla. This is a bit of a daunting process because even though a few bugs are designed to be easy for contributors, I still don’t know where all of the components in the system live or how they work together. I am going to try to read up on all of the documentation that I can find and then dive in headfirst!

Written By

Andrew Halligan

Published January 12, 2014