External ContributionThis week we begin release 0.4 in our Fall 2019 DPS 909 course. I am growing a bit more confident in contributing to shippable OSS now, so for my external contribution I continued by Python work from last week by submitting a PR to another Python-based web application. This time, the project was LibreOffice Crash Reporter, which aggregates crash reports from the well-known, open source office software suite, LibreOffice. I found this tool to be useful because I have used LibreOffice for quite some time on my laptop, which unfortunately did not come bundled with the full Microsoft Office package (student offers are only good for one key, and I used it on my desktop workstation already!). While LibreOffice is a reliable alternative, I can personally vouch that it is a bit more crash-prone than Microsoft Office, which made contributing to the LibreOffice Crash Reporter project all that more interesting for me.
The issue itself is simple: there is a dropdown list on the app that allows you to select which LibreOffice version you want to view crash reports for. In the current version, the options in the dropdown are unsorted, making it difficult to find a specific version. Someone requested that a change be made so that the dropdown list is sorted by version number, so I decided to tackle that feature. To do so, I had to battle through yet another gauntlet of dev environment setups, this time it was in Django and PostgreSQL. Once again, developing on a native Windows machine proved to be troublesome, as many shortcuts in setting up the dev env did not exist as they would on Unix-based systems. And also once again, Anaconda came to my rescue, providing me with the tools to create a virtual environment and to find and install the correct dependencies for this project. One particular thing I had trouble with was a mysterious executable called minidump-stackwalker. I still don't know exactly what it does, but from the research I've done, it seems it's responsible for producing compressed dump files of OS-relevant crash records. A unique binary executable of the minidump-stackwalker was required for the LibreOffice Crash Reporter project, as well as some very specific dependencies in the form of DLLs to get it to run on Windows. It was quite a detour to find these, but I did manage to stumble across this thread in the Electron repo that pointed me to everything I needed. Having done all of that, I still needed to install and set up PostgreSQL. Good thing I did have some experience in doing that from a previous project!
After getting past the hurdle of setting up the dev environment, I had to dig into the project to understand the codebase and know where to write my actual feature code. This was also quite a challenge, as I had no previous knowledge of Django, which is a full-stack framework for creating web apps in Python - much more complex than Flask, which I studied for my previous contribution! Even though the feature was as simple as producing a sorted dropdown list, just tracing the codebase to pinpoint the source of the dropdown's data tested my ability to read and follow code. It was obvious this project was still in its shallow stages, as there were no helpful contribution notes, nor was the code properly documented at all - a lot of research went into pushing such a small feature! After digging through template after template and data model after data model, I finally found the most logical place to write my data-sorting script. I then rebased my code and submitted a formal PR, which you can find here.
|Before - unsorted dropdown.|
|After - sorted dropdown.|