Level up my PR game

Tony Vu
3 min readOct 21, 2020

--

After having some good experience fixing the front end of Telescope. I decided to learn more about the famous app that was developed by Senecacians. This time I wanted to learn about the backend and there is no better way to do so than fixing an backend bug. Luckily, professor Dave filed a couple of them that I can get my hands on. I decided to work on issue #1190 to remove the empty anchor elements in some of the posts.

Telescope backend is much more complicated than front end and It was challenging to get a hold off for new contributors. I learned that the backend involves of three parts: a Redis database, a feed processor server and analytics engine in the name of ElasticSearch. My issue lied in the feed processor server. It was nice of professor Dave to point out for me where I should look at.

I spent the whole day just to learn about every single file in that module. I was a bit disappointed as I expected myself to quickly understand it. This acts as a reality check for that I need to add more backend knowledge. I finally got a hold of the problem and had an idea how to fix it. I then went back to the issue to discuss if I am on the right track.

Professor Dave suggested me to look at the filter option for the sanitize function that could help fixing the issue. When I looked at the docs for it, I realized how it works is similar to my original idea and I just need to add one line of code. I was ready to create a PR if all the tests passed locally. Surprise! Surprise! It failed two tests! For some reason, the options also removed the cases where there are media tags between the anchor tags. Initially, I thought that this was intentional from the developers and decided to track back to the commit that updated this feature. It turned out the purpose of this feature was to keep the anchors containing media tags. So, this is a bug in the original package. I decided to improvise and implement my own solution.

This time, everything worked as expected and NO fail tests! A little proud moment for me. I then created a PR and wait for review. You can find my PR here. Professor Dave quickly reviewed my PR and suggested me to add unit tests to my new added functions despite it worked correctly in deployment. I guess, it is never too much to be careful because a small bug could cost big time in the long run.

I started to realize how it would be in real cases where a small change in backend code requires dedicated testing. Another lesson learned through Open Source Contribution.

It keeps getting better and better with my Open Source journey. It acted as an interesting story to bring up during interviews and it seems to me that the interviewers are also interested in what you do in the Open Source world. I will try to complete the test case and move on the the third PR of the October. I wonder where should I go next, maybe next stop would be “NASA” as professor Dave has suggested.

Eventually, It does sound cool when the interviewers ask me what have I done and I can answer back that I have fixed NASA (That actually sounds glamorous :D)

Thanks Telescope team for being very supportive this past week. You guys deserves kudos for dedication to this app.

That’s it for today post. I will come back next week, hopefully not late, to tell my story of how I find NASA’s repos.

Thank you for reading

Tony Vu.

--

--

No responses yet