What I’ve learned about my first contribution on an open-source project

Photo by Annie Spratt on Unsplash

I have contributed for the first time to an open-source project. After working for years as an engineer, I wanted to add some code to an open-source project used by the community.

My first contribution is for script a GO library which makes it easy to write shell-like scripts in Go. It is a small one but it helps me to understand the journey of pushing code in this kind of project, I will not details how to fork repository or making a pull request here but more what is the journey of adding a feature to a project.

Find where to contribute

Unless you are trying to resolve a bug you fount, the first thing before contributing to an open-source project is to find the project and this is not the easiest part.

There are several ways to find a project that fits you, you can browse Github and look for all good first issue tags, but it can take some time because of the number of issues open (16,807 issues currently).

To find script, I have checked this repository awesome-for-beginners which is a collection of projects who have open issues for beginners.

After that I checked several other links to find where to contribute, you can check it here:

Ask questions before coding

Coding on an open-source project is the same that coding for a company, you need to really understand what is the goal of what you do.

I have understood it after sending my first pull request, it was not good enough because what I had implemented was not in the philosophy of the library. It was a good start but not what the maintainer of the project wanted (he was right).

After asking more questions, it was clear for me what the goal was and it was easier to iterate. So if I have one piece of advice, ask all your questions before pushing your pull request.

Understand the feedbacks

As you can see here https://github.com/bitfield/script/pull/40 this was a long journey before my code was merged.

In my case, I was lucky because @bitfield is a great reviewer, he explains well what he likes and what he doesn’t like in the code, he also searches for nit things, this is great because it helps you to write better code.

So I think this is important to take time to read the reviews and to understand the feedbacks, it will make you a better engineer. But don’t forget that most of the time, maintaining an open-source project is not a job, so sometimes it can take time to have a review.

Conclusion

This first contribution was a good experience because it has helped me to write better GO and this feature will help a lot of the developers who use this library.

I will certainly make some other features to script so please check script you will see this is a useful library.

If you want to contribute to an open-source project, take time to find the project that fits you, and start small, you will be able to create bigger features in the future.

Techlead and cloud architect, I like to build great apps and deploy them on the cloud ☁️ ☁️ ☁️ #aws #go #java ☕️ #typescript #cicd