How to contribute to open source

A guide on how to get started with open source contribution

Rafiullah Hamedy
Jun 21 · 8 min read

In this article, I will briefly show you how I contributed to the following open source projects

I will also share why its important to contribute, lessons I have learned so far, how did I get started, what is my contribution strategy and motivations, as well as some examples of my contributions to date.


Why contribute to open source?

We use open-source software on every step of our development, and it is a moral thing to contribute back. StackOverflow surveys in the past few years indicate that the percentage of those contributing to open source is increasing

According to a 2016 Future of Open Source Survey Results by BlackDuck, around 67% of participation in open source has been to fix bugs and add new features, and 59% of developers participate in open source to gain a competitive edge.

Be the change that you wish to see in the world — Mahatma Gandhi


What can be considered an open-source contribution?

There are many different ways that you can contribute to open source. Here are a few of the ways

If you can think of more, please feel free to share it in the comments.


Why it took me so long to make my first open-source contribution?

Image for post
Image for post
source: shutterstock.com

A vast majority of developers love to contribute to open source, but we end up failing to do so for a variety of reasons. Here is why it took me a long time to make my first contribution

Image for post
Image for post

How did I find the drive and motivation to contribute?

Image for post
Image for post
source: https://www.procaffenation.com/motivation-the-four-ways-to-a-happy-life/

I enjoy writing articles, and after I finished writing about habits and things I wish I knew earlier as a developer.

I thought to myself, an article on open source contribution would be amazing but, I had no track record of open source contribution.

Writing an article and sharing my knowledge was the motivation and drive for me to get started with open source contributions.

So far, my article on medium https://medium.com/@rhamedy has reached over ~120K views and ~25K reads.

Here are some of the advantages of contributing to open source

Anything else you can think of, please feel free to share it with the rest of us in the comments.


My strategy to contributing to open source

I decided that I will contribute to a Spring Framework, a library that I have used before. I was reading the Contribution Guidelines when I noticed a few broken links so, and I created a pull request to fix them.

Image for post
Image for post
Link: https://github.com/spring-projects/spring-security/pull/6522

The pull request got merged, and it felt so good that I decided to keep going; however, there was a problem.

A majority of GitHub issues (i.e., bugs, first-timer, help-needed, feature) would get picked by other contributors before I even have a chance to express interest and so I had to come up with a plan and here is what I did.

Image for post
Image for post
Showing interest to work on a bug/issue

This strategy worked so well for me that I had the right amount of open source work to do over the next few weeks.


My open-source contributions so far

I started my open-source contribution by fixing broken links in the documentation, and the next issue I worked on was an enhancement.

Image for post
Image for post
Link: https://github.com/spring-projects/spring-security/pull/6550

I worked on Clear Site Data to Spring Security’s LogoutHandler and the requirement was to read through the Clear Site Data specification, and this was an opportunity to both learn and contribute back.

My initial contributions started in the spring-security project, and then I made a few contributions to spring-boot as well.

Image for post
Image for post
Link: https://github.com/spring-projects/spring-boot/pull/18566

In the above pull request, I helped deprecate a server property and add a new server property. During the code review, there were some great suggestions.

Once your changes make it into a release in spring projects, then you get a nice shoutout in their release page.

Image for post
Image for post
https://github.com/spring-projects/spring-security/releases?after=5.0.16.RELEASE

and in case of spring boot, you also get a nice Author mention in their documentation

Image for post
Image for post
Link: https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.html

Below screenshot shows a listing of all my open source pull requests so far, and I am hoping to add some more.

Image for post
Image for post
https://github.com/rhamedy

In addition to spring projects, I also made one contribution to elasticsearch, and unlike spring, it was a very bumpy ride.

Image for post
Image for post
Link: https://github.com/elastic/elasticsearch/pull/39605

Why was it a bumpy ride?

So it’s crucial to pick issues where you have adequate knowledge, experience, and time. Or at least, you are willing to invest time in it.

If you see an issue in an open-source project, then offer a fix

While at work one day, I wanted to fix a few security vulnerabilities with maven dependencies and in particular, I came across the following highlighted in https://commons.apache.org/proper/commons-collections/security-reports.html

High: Remote Code Execution during object de-serialization

and when I analyzed the dependencies, I found out that the affected dependency was coming from https://github.com/intuit/QuickBooks-V3-Java-SDK and so I created an issue and followed it with a pull request that got merged.

Image for post
Image for post
https://github.com/intuit/QuickBooks-V3-Java-SDK/pull/120

Tips and Suggestions

No article is complete without tips and suggestions, and here is my list

If you think of any, please feel free to share them in the comments.


The Startup

Medium's largest active publication, followed by +707K people. Follow to join our community.

Rafiullah Hamedy

Written by

A Human first • Senior software developer • Loves to write with over 170K+ views on Medium • Co-founder in the making • Let’s connect on linkedin.com/in/rhamedy

The Startup

Medium's largest active publication, followed by +707K people. Follow to join our community.

Rafiullah Hamedy

Written by

A Human first • Senior software developer • Loves to write with over 170K+ views on Medium • Co-founder in the making • Let’s connect on linkedin.com/in/rhamedy

The Startup

Medium's largest active publication, followed by +707K people. Follow to join our community.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store