Setup is Easier the Second Time

Published in Open Source

Since my last blog post, I have been actively working on addressing all of my pull request feedback and have taken on two new bugs on the Marketplace project. A lot of interesting bugs have been coming up on Bugzilla lately and the only factor that is preventing me from working on them is time!

Splitting Out The Add-ons Project

One small update that occurred recently is that the Marketplace and Add-ons project have been split apart into their own respective Git repositories. Marketplace is still a part of the Zamboni codebase and all future work on the Add-ons project will now be a part of Olympia. Even though there is a lot of overlap between the projects I think this split is ultimately for the better. As a contributor, submitting a pull request for one particular project was always a little daunting with the notion that I could possibly be breaking functionality in another project without even knowing it. Hopefully this will make it easier for other contributors to continue submitting patches in the future.

I found out about the split after I opened an Add-ons related pull request last week. I had to re-submit my pull request to the Olympia project and with this came the process of forking and cloning the project and following through to get the project back up and running locally. This was a bit of a pain but since I could see the merit, it put me at ease. Setting up the project for the second time was certainly an easier task than when I originally did it the first time around. Having 10 weeks of working on the project has definitely allowed me to gain knowledge of the common gotchas. My new pull request on Olympia can be found here. I got some great feedback regarding some of the structure of my code and after addressing those changes the pull request was merged right away.

One piece of feedback that I received was to install and use a plugin called flake8. flake8 is a source code checker that is used to ensure that particular Python coding standards are followed. This should hopefully help me catch some of the minor cosmetic code offences that I make prior to submitting my pull requests.

Removing Category From the Marketplace Search Box

With my previous pull requests wrapped up, I started in on a new front-end bug related to search and feature apps in the Marketplace. Upon clicking to view all featured apps in a particular collection, the category name gets placed within the search box but it really should not be. To begin, I updated both the Zamboni codebase and the Fireplace codebase after learning my lesson from last week. My first step was to determine how to make an app featured. From examining the database, I was able to figure out that I had to add a new featured app collection. I added an entry to the app_collections table but still featured apps were not displaying. After a few dead ends, I figured there must be a better way without directly modifying the database. Through some searching, I found that there was actually an admin panel called Curation that is to be used to add new collections and featured app collections – exactly what I was search for. Using the tool it was very easy to add a new collection and subsequently add an application to it. One tripping point that I came across was that I had to set the region field of the collection to be restofworld in order for me to get it work locally.

I was able to locate the template function in the front-end code that runs when the featured category is clicked. It seemed to include a conditional that would set the search bar context to be either the search parameters if they existed or else it would set it to the current category. After removing the category conditional, I found that everything worked as outlined in the bug and I submitted a pull request for my change here.

While looking through the front-end code for this bug, I found an interesting Easter egg. If you type “do a barrel roll” into the Marketplace search box, the entire page will spin around! This must be a tribute to the Google Easter egg that does the same thing.

Reverse “My Apps” List Order

After submitting that front-end change, I began looking at a new bug. Whenever you install an application on the Marketplace it gets added to a list that you have access to called “My Apps”. The entries in this list are ordered from the oldest installed app to the newest installed app. The bug reporter suggested that it would make more sense to list these in reverse chronological order since typically you will go to “My Apps” in order to delete an application that you just installed (perhaps it wasn’t exactly what was expected).

I was able to simulate installed applications on my test user by modifying the users_install table. I added a couple new rows with my particular user_id and I also changed the install_type field to be 0 to indicate that it was a user install (rather than an install by a reviewer). Upon doing that, I as able to see apps listed in my “My Apps” page and verify the order described in the bug. I modified the ORDER_BY statement to change the list to reverse chronological order.

Once this change was made, I had to modify one of the existing tests that was related to pagination. The test was expecting a particular order so it was a matter of changing some of the expected test results. I also added another similar test to verify that the new ordering was satisfied. I opened a new pull request here for this change.

Bugzilla Permissions

Another high point of the week is that I finally have editbugs permission on Bugzilla, which means I can assign myself to the bugs that I am working on and also close/resolve the bugs once they are fixed. I’m sure a lot of the guys that I bother on a regular basis to update bugs for me will be relieved.

Overall, this past week was excellent. I am consistently amazed at the amount that I learn week over week by tackling a couple a new bugs. One of the beauties of open source projects is that there is always more to learn!


Written By

Andrew Halligan

Published March 22, 2014