My first contribution to Webmaker App…

Hey everyone,

So I’m a little late in writing my blog and I apologize for my horrible time management.

I was working on the bug I planned on for release 0.2 in my open source class. Turns out, it was easier than I thought it would be.

The issue basically was to write tests that would make sure that the file that contains app templates as simple JSON data is in fact valid JSON and confines to a proper format. One of the contributors even suggested an excellent library, tv4 for getting this done. Luckily, my previous experience with JSON schemas proved to be very helpful. However, even though I had experience with schemas before, I often found myself referencing the JSON schema docs for refreshers.

I began by doing some prep work which included installing the library and going through their docs, writing the basic skeleton for my tests and determining what my tests would be. I ended up coming up with two tests in mind – one that makes sure that everything in that JSON file has the necessary properties that templates need along with some simple data type validation, format validation, etc.; as for my second test, it basically checked to make sure that every template name was localized, i.e. was present as a key in another JSON file.

I began writing the schema piece by piece. Building it based on a breadth first approach. This meant that I would first, exam the outermost object, create a ‘shallow’ schema for each property with simple checks. If a property was an object, I would basically assign a variable that would later be defined to hold the schema, to that property’s schema. In that way, I created the outermost objects schema. However, if I ran the test, it wouldn’t work as there were several references to variables that did not exist. These were the variables that I was going to create next that would hold the schemas for the properties that were objects. I kept using this approach until I was completely done writing the schema. After running the test a few times, couple of small bug fixes and voila…my first test was finished.

The second one needed some thinking. I had to do something tricky to only validate one property of each object, viz. the name. I had to create the schema skeleton for the JSON object and effectively provide ’empty’ validation for the properties that I did not care about. Then, I was able to provide a custom validation for the name by checking whether it was in the localization file (the tv4 docs allowed me to provide my own validation function…yay)!

I submitted my PR on Saturday very very early in the morning (like at 2am). Unfortunately, by the time I came to write this blog post, it was already merged into the main repo…whoops 😛

r.gideonthomas@gmail.com / October 20, 2014 / Open Source / 0 Comments

UI is not my thing!

Hello everyone,

Sorry for being away for a week. Have had a lot going on and just couldn’t find the time to voice my thoughts.

So we had to find a bug to work on for release 0.2 which is due in less than a week. And as much as I would have loved to, I could not work on MakeDrive for this. So, I found it hard to find a way to approach searching for an appropriate bug to work on. I looked at the different options available to me – Mobile Webmaker, Cordova/Firefox OS, Appmaker and Brackets.

Brackets was something that I decided to work on possibly for release 0.3 by finding a bug that was not UI related. As far as Cordova is concerned, a lot of my peers have told me to stay away from it due to its sheer complexity. I was thus left with two options – Appmaker and Mobile Webmaker. From a Github standpoint, I wanted to get a ‘Repositories Contributed To’  entry for one of these, so as to show my versatility for web development. However, based on previous experience with Appmaker, I decided to search in Mobile Webmaker instead as I knew that otherwise I would be stuck dealing with something that primarily dealt with UI.

So I began searching through bugs in the Mobile Webmaker repository. I was disappointed. Contrary to my expectations, the bugs were primarily UI related bugs/features. I tried several bug filtering techniques to find a bug that was appropriate for me. Searching by keywords such as ‘feature’ or ‘work’ and searching by labels did not help. So I decided to filter by their milestones. As I searched through the milestones, ascending the periods by date, I finally found a bug that seemed to be sort of back-end related part of their Mozfest milestone.

This issue pertained to testing their localization files which were in JSON, for adherence to a JSON schema. Luckily, I know a decent amount about JSON schemas and since there was enough information in the bug, I decided to take it on. I did so by asking (in the issue itself) two of the lead developers for permission to tackle the bug, which was promptly granted to me.

Hence, after some great work, I was able to find a good bug for me in the UI haystack. Now to begin working on it…

r.gideonthomas@gmail.com / October 14, 2014 / Open Source / 0 Comments