🦊

Revision 0.1: New Projects

Sean Prashad
Open Source @ Seneca
7 min readFeb 10, 2018

--

Catching up on what’s happening!

With a few weeks into the new year, a lot has been happening — quite so much that I’ve neglected to write any blog posts about any of it. Co-op and classes, hackathons and helping others, in combination with my own bugs have taken over the past few weeks. But nevertheless, I’m not a stickler for excuses and so going forward, I’ll be keeping a written timeline of events such that I can whip up my blog posts more quickly and consistently.

In my absence, I have great and not-so-great news to share. Let’s get straight into it!

Unfortunate Events

As previously mentioned, I was planning to continue with the Activity Stream team for an on-going bug dealing with React and Redux. I ran into a roadblock due to my limited knowledge of the respective technologies and even with reading documentation, ended up being stumped with how to proceed. Unfortunately, the Activity Stream team was out of the country for a week which led to frustration on my end and with a deadline quickly approaching, I knew that I had to pivot to a new project in order to be successful. However, that’s not to say that I nor any other individual can’t be successful with Activity Stream but that I was just in the wrong place at the wrong time — it happens! If you’re interested in helping get my bug across the finish line, please do reach out on the PR itself or via Twitter!

Moving Forward

Searching for a new home for this semester wasn’t as hard as I thought! I ended up browsing Mozilla’s organizational page on GitHub and landed upon Addons-Server:

Finding a new home

This project centralizes all of the add-ons for Firefox (like Ad-Blocker for example). With a handful of GFB labels for me to explore, 300+ issues and 370+ contributors, I knew this project was alive and kicking!

Side note: Choosing a project can seem quite difficult — what if I don’t know X, Y or Z technology? Docker? You mean the clothing company?! Python? React? My head feels like it’s going to explode! Some of David’s Intro. to Open Source students must be thinking “Sheesh.. why didn’t I choose an easier course like Computer Vision”. News Flash: School only teaches you an extremely small fraction of what’s required when you start working. In essence, you develop the ability of “learning how to learn” throughout your academic career and OSS allows you to put it to the test. By choosing a project that is challenging, both horizontal and vertical growth can occur.

Building Addons-Server with Docker

With the easiest part over and done with, I was hoping that I had a seamless experience building Addons-Server just like how I did with Firefox. Well, not all movies have happy endings and it turns out that this one wasn’t going to be so straightforward. Addons-Server is built via Docker — a piece of software that essentially bundles everything needed to run your program into a “container” that is independent of any Operating System. This means that you don’t need to worry about having cross-platform issues with Windows, Linux or MacOS! Check out more at Docker.com and on Twitter!

The instructions for building the project were laid out in a straightforward fashion with Linux, Windows and Mac commands present as well as prerequisites:

Commands for building Addons-Server

Note: Two key things I did wrong during the build process set me back ~6 hours! See below..

  1. Editing the /private/etc/hosts file incorrectly. Appending the new configuration line to your file via a text editor like Sublime should look like so:
Adding addons-server to /private/etc/hosts

2. Not using Firefox to browse to my local instance of Addons-Server via olympia.test . Originally I thought that this was a bug and as such, filed one:

Google Chrome bug.. or so I thought!

But eviljeff later responded and updated me that this was to be expected as outlined in a previous bug found here.

And so with a weekend spent on building the project I was going to invest my blood, sweat and tears into for the next few months, I was set on my way to find some bugs!

Catching Up

My first bug was one that I considered a warm-up — removing a redundant anchor in a footer hyperlink. All I needed to do was to strip out the anchor #addons.mozilla.org_service_history from multiple files, verify my fix locally and submit my PR.

Moving on with my second bug, I was tasked with figuring out the necessary CSS changes to separate listboxes in the section for reviewing an add-on:

Notice no spacing between the button and pink section?

By adding margin: 1em 0 1em 0; to the CSS class .whiteboard-private, I was able to add spacing consistent across the web page.

Side note: The reason for adding that specific pattern to the margin element was that values correspond in a clockwise manner (top, right, bottom and left). Therefore I needed to add spacing above and below the listbox.

After implementing this simple change, spacing was looking pretty sweet 😎:

After updating the margin contents

Side note: I should note that I used the built-in Developer Tools within Firefox to diagnose if my solution would work. I didn’t need to touch any code at all! Toggle them on Mac using Alt + Command + I:

Making use of the browsers Developer Tools in Firefox

Within a day or so my PR was successfully merged! But that wasn’t it — I had my eyes set on a third and final bug for Revision 1.0 — fixing a routing problem for addon reviews.

This bug required more work understanding how the Python template engine, Jinja, operated and also updating the respective unit tests to reflect the new URL structure. By searching the entire project structure for #reviews, I was able to isolate the respective unit tests which pointed me in the right direction to find the two specific code spots:

eviljeff confirming that I was on the right track

After an initial attempt at removing the code block that caused the original bug, eviljeff reviewed my code and informed me that I could clean it up even further as well as remove some unnecessary dependencies (ie.link_to_list). With those fixes implemented, I then ran across a very peculiar problem — an .xpi file with a unicode character (src/olympia/files/fixtures/files/jétpack.xpi) was being modified for some reason and I accidentally added it during an earlier commit.

Having squashed multiple commits to clean up my submission means that I made it harder on myself to undo this problem. git checkout commitId path/to/file was not working due to my shell escaping the unicode character in a strange way and so I reached out for help during my in-class presentation. With the help of David and Timothy, we perform some Git surgery to eliminate this unicode character file from my PR:

  1. First we made a new branch, issue-7111b: git checkout -b issue-7111b
  2. Then we backed up our old branch, issue-7111: git checkout -b issue-7111backup issue-7111
  3. Next we cherry picked each file that we wanted to include in the commit on the branch issue-7111b
  4. Next, we resetted the old branch, issue-7111 to be what issue-7111b is: git checkout -B issue-7111b issue-7111
  5. Lastly, it was simply a matter of force pushing the intended branch, issue-7111 to GitHub using: git push origin issue-7111 -f

Side note: The capital -B means “create or reset if it already exists” whilst the lowercase -b means “create this branch if it doesn’t already exist”.

With all said and done, we were left with a PR that contained all the changes it should have minus that one pesky file. The next day, my PR was reviewed and I was met with a beautiful purple “Merged” symbol.

Watching from afar…

Throughout my work, little did I know that others were watching from afar. On one of my PR’s, I woke up one morning to find Caitlin Neiman, Addon Community Manager at Mozilla offering to vouch for me on Mozillians.org!!! I could not believe my eyes and squealed in excitement as I quickly tried to remember my username and password. By the end of the day, it was official — I became a Mozillian:

You never know who's watching” — @humphd
A dream come true

You never know who's watching your bugs, reading your blog posts or checking on your PR’s. This has been a milestone not only in my OSS career but my personal and academic as well. It gives me the hope that one day I will be good enough to help build the browser that I used over 16 years ago!

I would love for my peers to receive recognition for their great work. Check them out: Svitlana, Margaryta, Ray, Michael, Earle, Timothy and Marco.

Until next time,

Sean

~ Mozillian, Student and Sticker collector

--

--