Code-In with Wikimedia

Last month, I posted about the starting of my participation in Google Code-in. I introduce Google Code-in in that post so be sure to check it out! Since then, I have decided to switch from Sugar Labs to Wikimedia for various reasons. Without further adieu, let’s get started!

Wikimedia

For those of you who don’t know, Wikimedia is an awesome organization that focused on tons of awesome projects. Their most well known project has to be the ever-so-popular Wikipedia, but they have so many more wonderful projects that you can check out here.

Workflow

To complete a task, here is my current workflow:

  1. Search and signup for a task on the Code-in Melange website: If you didn’t know, Melange is the open-source software that runs Code-in and other contests such Google’s Summer of Code (a contest similar to Code-in but for college students). The Melange Code-in website holds your account and all the tasks available to you for specific organizations. In fact, you can find the task I am working on right now (writing this blog post) here (how meta is that!). Once you find a task you like, claim it and it’s off to work! (If the task is non-programming, I work on it and skip to the last step.)

  2. Observe with Phabricator: Free and open source, Phabricator is used by Wikimedia to manage their projects. One of the main features is issue and bug tracking. Once I claim a task, I usually check out the Phabricator issue linked in the Melange description. There, I observe the history of the issue and try to dissect what needs to be done to fix it. If clarification is needed, a request for more information or help can be commented on the issue. Next, IRC!

  3. Discuss on IRC: This is my favorite part of this whole event. I spent most of my IRC time on the #pywikbot channel (mentioned later) and the mentors there were incredible! None of my CS friends contribute to open-source, so it is really nice to interact with and look up to somebody who does this type of stuff on a regular basis. They were very nice and open and receptive to any questions I had. They definitely made me feel at-home while I was working on the projects. I CANNOT stress enough how awesome these mentors are. I can tell that they try to push me to do my best. Anyways, if I ever need help, this is the first place I go.

  4. Program: This is the meat of the challenge! I program using IntelliJ using the Python plugin (which is really just PyCharm). While I am programming, I am mindful of adhering to the coding style and rules of the project. flake8 is used to check these conventions. This is a constant battle between adding new code, testing it, discussing on the IRC, and the repetition of these until the task is completed.

  5. Send a Patch to Gerrit: Gerrit is used to submit patches and do code reviews with git (a version control system). Gerrit uses git-review, a Python commandline tool, to submit patches. Before committing, you must first run git commit -s to set it in the correct format. After committing the code with an appropriate commit message, it is time to git review -R which submits your code for review (#pywikibot channel receives updates from Phabricator and Gerrit on changes relating to Pywikibot). Next Jenkins reviews your format-wise to make sure it matches the conventions of the code. If this passes, you wait for a human to review your code and add comments. After you read the comments, make the necessary changes and repeat steps 3-4 and then git commit --amend and then another git review -R. Hopefully at the end, your changes are accepted and merged and pass TravisCI.

  6. Mark Done on Melange: When you are all finished, you are ready to mark your task as done on Melange! After this you wait for somebody to judge your work. If it still needs work, you will be notified and will need to repeat steps 3-5 until satisfactory. Make sure to submit before your task time ends (I had a particularly difficult time with this part :))!

If you follow these steps, you should complete a task with no difficulty at all.

My Projects

So far, I have completed 5 tasks (4 of which are for Wikimedia). As said earlier, I had a blast doing these and would recommend to anyone to do this next year. Below are the Wikimedia tasks I have completed thus far.

Logo For European Hackathon

This was my first task I completed for Wikimedia and had a great time doing it. The objective was to create an SVG logo for this year’s European Wikimedia Hackathon, held this year in Lyon, France. For this, I decided on using Adobe Illustrator (which I had purchased previously), however tools like Inkscape work perfectly as well. I ended up creating two logos for this task:

Eiffel Tower European Wikimedia Hackathon

This Eiffel Tower logo is the first one that I worked on. This logo is influenced heavily by Wikimedia’s logo, except it is flipped upside-down, rearranged, and has the Eiffel Tower incorporated into it. The colors taken from both logos are extracted from the Wikimedia logo as well. This one is my favorite of the two, however I unfortunately created this before I learned that the contest would be held in Lyon and not Paris. Oh well.

Cube European Wikimedia Hackathon

Above is the second design I created, focusing on a modern-ish, geometric design. This one was very interesting to make because it was very math-based. The creation consisted of shearing/skewing the objects by certain values and rotating them along 45° angles to create an isomorphic view.

As mentioned earlier, the event is going to be held in Lyon and not Paris, so I might end up creating another logo. This task gave me a general acquaintance with how other wikis, particularly MediaWiki, work.

Tutorial Video for Phabricator

The next task I worked on was creating a video tutorial showing how to use the previously mentioned Phabricator profile page.

What you did not see was the near a million re-takes I had to record to get the video to my liking! The hardest part was not messing up and fitting all of the content into the advised 1 minute length. I captured the video using Fraps, however I would not recommend this proprietary software. After recording I converted it into the free Ogg audio video format using VLC.

Porting Code for Pywikibot

This is the task that pushed me to take the plunge to actually write code for an open-source project (other than my own). For this task, I was assigned to port some code over from pywikibot-compat to pywikibot-core. Before you get too confused, let me explain. Pywikibot is a super awesome Python library to interact with wikis, such as Wikipedia.

For example: Let’s say you have a wiki all about penguins (we’ll call it Pengwiki) and the news just broke that the Emperor Penguin’s feet were renamed to ‘Royal Flippers’! Oh no! It would take a substantial amount of time to rename all instances of ‘foot’ or ‘feet’ in the Emperor Penguin page. However, Pywikibot comes to the rescue! You can easily write a script using the Pywikibot module to do this in a few minutes! This also might accomplished with using an existing script. Other awesome things can done with much ease, such as categorizing all the pictures in the ‘Emperor Penguin’ category to the ‘Royal’ category as well.

Other than those silly examples, there are literally millions of use cases for this useful tool. Anyways, pywikibot-core is the refactored and updated version of pywikibot-compat; core solidifies the product significantly as compared to the original compat (which is still around for, well, compatibility). I was assigned moving a page generator (think of it like a printer that returns wiki pages for certain queries), specifically LogpagesPageGenerator, from compat to core.

The process I went through to complete the task closely follows my workflow mentioned above (Melange -> Phabricator -> IRC -> Code -> Gerrit -> Done!). Porting the code was very interesting as I had to observe how other pieces of code were ported over and try to emulate and adapt the new code that I was writing accordingly.

Creating Tests for Pywikibot

Creating good tests is arguably more important than the actual code itself. It insures that the code is working as presumed and will work correctly for the users.

For the tasks with pywikibot, I was assigned to create various unit tests. For creating these, I would think of different situations in which the code would be used and assert the results to those values. To actually test the tests in Python I would use nosetests, however coverage is also used.

If something did not work as I expected, I investigated further. With the help of #pywikibot, we were able to identify many hidden bugs and problems that were not previously known.

Closing Words

Overall, Wikimedia is a really marvelous group of people that put effort into everything they do and make an effort to help those who need it. The biggest takeaway that I recieved from participating is learning how organized and fun contributing to open-source projects can be! Unfortunately, I won’t be able to participate next year, due to the fact that I will probably be 18 before the contest starts. But hey! I could possibly be a mentor next year! Anyways, I will be sure to keep contributing these awesome projects!


~Davis Robertson

Licensed Under Creative Commons BY 4.0.

Google Code-In and Sugar Labs

I recently found out about the wonderful program, Google Code-In. To give you a basic summary, this is an event where high-schoolers ages 13-17 can contribute to different Open Source/Non-Profit Organizations. Encouraged by my choice organization, Sugar Labs, I have created this first blog post to talk about it!

Motivation

I have found that events/opportunities for high-school students in the computer science field have been somewhat lacking. Most Hackathons require participants to be in at least college and the ones that don’t are few and far between. As well as this, I have always wanted to get involved in the Open Source community but I just couldn’t find a way to get started. This is why I was absolutely delighted when I found out about Google Code-In!

The Contest Itself

If it is before mid-January, I encourage you to participate here!

As stated earlier, this is an event for 13-17 year old high-schoolers to participate in different Open Source contribution activities sponsored/mentored by 12 different open organizations. These organizations range from KDE, to WikiMedia, and also my organization of choice, Sugar Labs (the full list of organizations can be found here). So basically, you complete different assigned tasks in a healthy competitive atmosphere (there are prizes/incentives).

Sugar Labs

I ended up choosing Sugar Labs for my organization for the following reasons:

  • I am familiar with Python and HTML/JS.
  • The product of Sugar Labs (the Learning Platform) looks very fun and interesting.
  • I want to gain more experience with GNOME and GTK.
  • I want to put myself out of my comfort zone without biting off more than I could chew.
  • (Although this applies to all of the organizations) I want to gain experience working on a large open source project.

Sugar Labs Learning Platform

Sugar Labs Learning Platform Screenshot Creative Commons Sugar Labs

Overall, I am very excited to start completing tasks for this great organization.

What I Hope to Learn

As stated earlier, I wanted to work on a large open source project, and jump right into the community. I hope to learn how to adapt to the different workflows of the organizations, specifically Sugar Labs. I do want to go into computer science for a profession, so this seems like a perfect opportunity to soak in experience that might prove invaluable in the workplace.

As for my mentors, I would love to improve my programming skills through them. If I have a problem (as I often have) or I am just brain-dead, I will be sure to drop by the IRC channel for much needed help. I look forward to improving my team participation skills.


Anyways, I will be sure to post updates here over the duration of the event.

~Davis Robertson

Licensed Under Creative Commons BY 4.0.