Making Your First Open Source Contribution

Interested in contributing to an open source project, but aren't sure where to start? Here are a few tips you can use.

Posted August 30, 2021 ProgrammingOpen Source

Helping out with open source projects is a great way to level up your technical skills, have your code reviewed by others, and practice working collaboratively. If you're new to open source, though, it can sometimes be a bit intimidating to figure out where and how to get started. Here are some practical tips you can use to move from open source newbie to making your first open source contribution.

Figuring Out Where to Contribute

The first step is finding an open source project you would like to get involved in. If you just want to practice making a contribution, and don't necessarily have a project to target, you can also look at Good First Issue, which is a great resource for finding a place to start. Good First Issue aggregates GitHub issues labeled "Good First Issue" across numerous popular projects.

If you're interested in getting deeper into open source though, or perhaps if you've made a contribution from Good First Issue and are hungry to go deeper, it's time to find a project that interests you. There are over 100 million repositories on GitHub, and it's likely you are already using some open source software you may be interested in contributing to. If you aren't already active on GitHub, sign up and start exploring; the Explore tab can help you figure out where to begin.

Figuring Out How to Contribute

The Thinker

Your first contribution does not have to be a massive one. In fact, I'd recommend against that. A large GitHub Pull Request that changes 20 files makes it more likely that it contains a mistake, or that it will take longer to review. A small, simple change will help get you started more easily and is a good confidence builder.

Look to start off with existing issues. Often, open source projects will use a label on GitHub to indicate issues that are good for first-time contributors. You may be able to contribute by resolving existing issues without even needing to make a code change. For example, if you find an issue related to an end-user configuration, you can help the person who reported it by explaining the proper configuration steps. If, however, you find something labeled as a good first issue that does require code changes, you can snag one of those to make your first Pull Request.

Documentation can also be a great place to start. It's somewhat common for documentation to be an unfortunately neglected piece of a good project, as keeping documentation up to date is not always something developers enjoy doing. If you're using some open source software, run into a pain point that the docs don't directly address, and find a solution yourself or via a Google search, contribute that knowledge back to the docs to help others in the future! Oftentimes, the original developer might not realize there was a missed step, because it's assumed knowledge on their part. If you don't clear up the missed step, though, the original developer will never realize they had that blind spot, and others will have to do the same research you did in the future.

Making the Contribution

It Is Time

To make your first contribution, you'll want to be sure you're familiar with the steps required to use GitHub to fork a repository, make your changes, and then contribute them back in the form of a Pull Request. Marko Denic has a good high-level guide on how to create your first Pull Request, or PR.

There is another thing you'll want to keep in mind before making that first PR. Be sure to read the developer documentation. A well-run project will have some style guides and standards for how to set up a development environment, test your changes, and create a properly formatted PR. Make sure you find and follow that documentation. If you don't, it's more likely that your changes will be rejected, or that it will take longer for your changes to be approved.

Large projects often have many open PRs. For example, Home Assistant, a project I've contributed to, has 310 open PRs in their core repository alone, as of this writing. PRs that properly follow style guides and are tested properly are going to get prioritized when there are that many PRs out there to review. If you want to see a great example of developer documentation, Home Assistant has theirs at developers.home-assistant.io.

Stay Involved

Once you've made your first contribution, it can be a real confidence boost, and the sky is the limit from there. Open source can really open some great doors to further learning and collaboration, and it can be a lot of fun. If you have more questions, I'm always available on Twitter or in the comments below!

Enjoyed this post? Consider buying me a coffee to fuel the creation of more content.