DEV Community

Emre Savcı
Emre Savcı

Posted on

How To Become an Open Source Contributor

Open Source

As a software developer, I feel happy when I contribute to the community. It is an opportunity to improve your development skills and learn new things. It is both an educative and entertaining process. There are few things that satisfy me as much as an accepted pull request :)

Becoming an open source contributor is a dream for some developers. If you are a new developer or never made a contribution before and want to become a contributor, in this post, I have several suggestions for you.

Where To Start

Well, let’s assume you found a project on Github and you want to contribute to that project. Which steps to follow to become a contributor? What might be helpful to the contribution process? I will list those baby steps that I followed and made the contribution process easy for me.

1- Use that project in production as much as possible

This might be the most important part of becoming a contributor. Using a tool in production or in daily life helps you to understand it better. While using the tool, you will probably face errors that are actually bugs that need to be fixed.

At this point, you can start contributing by creating an issue that describes the steps to reproduce that error.

After that, you can get your hands dirty to get dive into the source code to investigate the root cause of that bug.

When you find the problem and fix it, you can create a pull request.

As an example, about 2.5 years ago, when I was writing C#, we used to use RestSharp as http client like most of the other developers. At that time, we had trouble comparing two almost identical DateTime; we investigated it and found that RestSharp had missed a DateTime format while deserializing json string. And I decided to fix that issue by opening a pull request. After that, my pr merged, and I became a contributor to RestSharp.


2- Take a look at the source code

Image description

When I am curious about a project, I will clone it and take a look at the source code of it. It is not always a good starting point to contribute but it might help you to find some code to refactor.

As an example, when I started my career at Trendyol, I forked a project which was an internal framework used for legacy projects. When I looked at the source code, I found a piece of code to refactor.

Another example of looking at source code is while we were using Consul in our project, I looked at the source code, and I saw an array declaration without specified length (declaring length while initialization is a performance improvement for arrays in Golang ). So I made one line contribution by specifying the length of that array. Even that was satisfying for me :)

There is one more thing to do in the source code: “Measuring test coverage.” Writing unit tests to increase test coverage is another way to contribute to the project. For example, I am preparing a pr to Kubernetes that contains unit tests which increase test coverage.


3- Read documentations and apply examples

Image description

Reading documentation helps you to understand how to use the tool. There are two things related to reading docs. One is that you might need information about a feature and you can not find it in docs. Here you can contribute by writing documentation about that part. The second one is that sometimes documentation might not be up to date or have typos. When you are faced with that, you can contribute by fixing docs.

I remember I was following an example on Istio documentation, applied it, and got an error. I realized that the example has a typo on yaml configuration. I created a pr and fixed that documentation to save other developers time.


4- Use the client of that project (if exists)

Diving right into the source code of an open source project might be hard, especially if the project has a huge source code. At this point, it might be helpful to start using the client code of that project. This also helps to understand the internal structures of that project.

Let’s take Kubernetes as an example, it has quite a huge source code, and it is not straightforward to dive into source code as a stranger. But, you can use Kubernetes client and make some example projects which interact with Kubernetes. You will see that it helps you to understand the internals of Kubernetes better.


5- Search for issues

Image description

Searching for issues to resolve is another alternative to start contributing, but it might be hard for a beginner. You can always start searching for issues labeled as GoodFirstIssue.

When I wrote Java, we used to use OpenFeign within our Spring Boot projects. I decided to search for issues to find if there is an easy one to get involved in the project. And I found it!

I start to resolve that issue and opened a pr for it. It was accepted by authors, and I got my name in contributors.

There are sites that help you to find projects to contribute to. You can filter projects by tags or languages.

Up For Grabs

Want to contribute to open source, but not sure where to start?

favicon up-for-grabs.net

You can also use Github directly to find projects by filtering:

6- Create an open source project

Creating an open source project might sound very hard at first glance. But in time you will realize that open sourcing your codes, even basic automated tasks, might help others too.

So following this thought, I created a repository called docker-shell, which does auto-completion and suggestions for docker commands. It grew further than I expected. It helps developers who use docker in daily life.

You can contribute to the docker-shell project as well:

GitHub logo Trendyol / docker-shell

A simple interactive prompt for docker

docker-shell

A simple interactive prompt for Docker. Inspired from kube-prompt uses go-prompt.

License: MIT Contributor Covenant

Table Of Contents

Features

  • Suggest docker commands
  • List container ids&names after docker exec/start/stop commands
  • Suggest command parameters based on typed command
  • List images from docker hub after docker pull command v1.2.0
  • Suggest port mappings after docker run command v1.3.0
  • Suggest available images after docker run command v1.3.0

Installation

Homebrew

You can install by using homebrew:

brew tap trendyol/trendyol-tap

brew install docker-shell
Enter fullscreen mode Exit fullscreen mode

Build From Source Code

You can build the command from source code by following the steps below:

git clone git@github.com:Trendyol/docker-shell.git

cd docker-shell

sudo go build -o /usr/local/bin/docker-shell .

docker-shell
Enter fullscreen mode Exit fullscreen mode

How To Use

After installation, you can type docker-shell and run the interactive shell.

asciicast

Image suggestion from docker hub:

asciicast

Port mapping suggestion:

asciicast

How To Contribute

Contributions are welcome and will be fully credited

Another open source project created by me is "kubernetes-kitap" project, which is a book written in Turkish for Kubernetes to help Turkish developers to understand Kubernetes:

k8s

Hoş geldiniz

Open Source severler olarak bir araya gelip, Kubernetes için Türkçe kaynak olması açısından bu kitabı hazırladık ve siz değerli okuyuculara sunduk.

Kitabın adresi: https://mstryoda.github.io/kubernetes-kitap/#/

Konu Başlıkları


Before finishing the post, I want to say that contributing to other projects has its own benefits. The first and obvious one is that it improves your development skills. Your code is reviewed by other developers, and this gives you a new perspective. Also, you are making new networks and friendships with other developers.


Bonus: Here is another site that might be helpful to start open source:

Open Source Guides | Learn how to launch and grow your project.

Learn how to launch and grow your project.

favicon opensource.guide

You can follow me on:

mstrYoda (Emre Savcı) · GitHub

Sr. Software Engineer @Trendyol | K8S <3 | Loves Golang | Contributions: [docker-shell, awesome-istio, awesome-dapr, @gofiber, @swaggo, kustomize, gocb] - mstrYoda

favicon github.com

Twitter


Thank you for reading so far. Take care of yourself until next post.

Buy Me A Coffee

Oldest comments (1)

Collapse
 
wjplatformer profile image
Wj

Beautiful. Beginners, bookmark this ✅