Author: Ho Yin Cheng
/
Created: March 12, 2018
I had my first pull request merged recently! 🎉
It was exciting, and I learned a lot along the way. For those of you looking to get involved in open source, this post is my attempt at helping you take that first step by retracing my journey.
Before you even begin thinking about contributing, I actually suggest to take a step back and do the following:
If you spend time doing this, you’ll already be contributing to open source in a roundabout way - you’re helping keep questions off the issue tracker.
As you build your expertise helping people, you will inevitably find issues with documentation. Maybe there’s a misspelling, a grammatical mistake, or a part of the API that is completely undocumented. This is inevitable as open source projects are built on the contributions of people from around the world. There is rarely time or money spent having technical writers make professional documentation. This is where you’re going to cut your teeth on open source.
So I flubbed a bit when I said it was my first merged pull request. It wasn’t. I’ve had documentation pull requests merged in the past, and that is how I got started. By doing this, I learned how to:
This taught me that getting involved in open source wasn’t as simple as diving in and fixing some bug. You’re participating in a community and there’s a learning curve to that; especially for us introverts. There’s a good reason why everyone suggests helping out with documentation as a good first step.
Once you’re familiar with a project and feel confident in your ability to help out, it’s time to dive into the bug tracker. If you’re lucky, maybe there’s a bug you submitted or ran into that seems fixable. If not, checking out the labels and looking for something labeled Good First Issue or Good First PR is the perfect place to start.
Me? I got lucky and the first issue I tried to tackle was both a Good First Issue and a bug that I had run into multiple times in the past. It was time to fix it!
You’re going to notice that a lot of people ignore the issue template and rarely include anything more than a short description of the bug. So before you can even begin to try and fix a bug, my advice it to put on your QA hat and turn that ticket into something workable:
Those are the minimum steps required of any QA Analyst (speaking from experience). If you can give that to a dev, it will make fixing the issue magnitudes easier.
With a fully fleshed out bug ticket in hand, you can now dive in and try to fix it yourself. Exploring any new code base is going to be a challenge, but hopefully your experience using the library and answering questions will give you a running start. Barring that, my best advice is to use copious amounts of print statements to first understand the flow of the code. On React Native, you’d use commands like this:
|
|
For native modules:
|
|
|
|
You don’t have to go all the way of making a flowchart like back during your CS course or internship days, but you do need to understand the logical structure well enough to pinpoint the root cause of the error.
In the bug I fixed, I was able to trace the offending behavior back to a single line of code. From there, I was able to research and learn about how React Native bubbles up events on iOS and lo and behold, the root cause was found.
At this point, fixing the bug is not that far out of reach. A bit of extra research or poking around in the code base might be required, but you’ll probably see a few different ways to fix the issue. So what’s the best approach?
This is where your prior experience conversing with the community kicks back in. You can:
@
,Suggestions and code will be reviewed, edits made, and eventually your pull request will be merged. Just don’t forget to update that documentation if needed!
That’s it! The end to the wild ride of your first commit.
It’s up to you now to continue contributing to this same project or go out and look for others to help. No pressure on sticking around. If this wasn’t the right community for you, then start all over again. Only this time you’ll be a seasoned explorer! 🔍
Copyright © 2011-2020 Ho Yin Cheng