Open Source 101

Naveen Sundar
NITRR Open Source
Published in
4 min readApr 4, 2020

An unconventional introduction to open-source…

Examples of open-source software

In open-source people join together and create software for free. The software made is publicly available, which means it can be modified and redistributed by anybody.

Example of open-source softwares are: vlc media player, mozilla firefox, ubuntu(and all linux), python programming language etc.,

Many questions may arise in your head — why, how etc. Grab a cup of caffeine and pair of spectacles, the answer lies ahead!

Why should I contribute to open-source?

  1. Companies consider your open-source contributions seriously. It will make your resume/CV that much more valuable than a pet project.
  2. You will learn industry best practices and your code quality will improve dramatically.
  3. You will comes across a lot of different technologies, the skills you acquire can be directly used in a software engineering job.
  4. It will show that you can work with a lot of people and your communication skills. Which are important traits for any job and have been looked after by all companies.
  5. You will contribute to a good cause and your work is likely to be used by thousands or millions of people.

How open-source software is created?

  1. An Issue is created.
  2. The issue is fixed by Pull Request.

I am not kidding that’s all it takes. All the other complexity and coding stuff comes under these two steps.

What is an Issue?

Issue — Bug report
  1. Issue may be one of few things: a new feature request, a bug report, a code remodelling request, a documentation update request etc.,
  2. Issue is a well defined description of a single problem to be solved.
  3. Our example Issue #487 is a bug report
  4. Here I asked one of the project maintainer to assign this issue to me. So others wont work on the same issue. Reducing duplicate efforts.

What is a Pull Request:

Pull Request (PR) — to fix previous issue.

A Pull Request(PR) is a piece of code written to fix a particular issue. Since you request to “pull” your code from fork to original, it is named as a “pull request”. These are the steps taken by me to create Pull Request #459.

Click on fork button to fork the repo

Create fork of the repository and setup project in my local machine:

Forking a repo means creating your own personal copy of the original repo. I cloned the forked repo into my local machine. Setup the project as the instructions provided.

Bug fix

Finding the bug and fixing it

I tried a few ways to find the bug. Finally I discovered that the solution is this 2 lines of code ( LOL ) . Made the fix. Wrote a comment. Made a commit.

A Unit Testcase (1 of 3) which i wrote for the bug.

Write test cases for the fixed bug

A test case consists of an input to the code and an expected output. I am just simulating the scenario and checking whether I get the correct output.

Run the entire test suite

Ensure that my additional code doesn’t break any existing logic!

This can be achieved by running the test cases written by the previous developers. Since it ran the tests successfully, now we can safely push the code to the fork.

Comparing changes between fork and original repo

Create the pull request

We can now compare the changes between our fork and original repo. The changes are made into a PR.

Travis CI in action after PR

Once the PR is made Automatically the CI (Continuous Integration pipeline) kicks into action. It checks if the PR code is good or faulty. If it is all good, we will get a green check mark. Then a maintainer of the repo checks the changes. If he/she is satisfied with the code, then the PR will be merged.

A successfully merged PR

This concludes one life cycle of code contribution. we repeat the same cycle with another Issue.

Things to take away:

  1. Open Source is not a hackathon or a freelance project.
  2. Things are to be performed is a systematic manner.
  3. So try to get assigned an “Issue” and break down the complexity into small consumable chunks.
  4. PR’s will take even 1 or 2 weeks to be merged.
  5. Patience is key.
  6. You can work on multiple PR’s at the same time.

This article is one of a many part series into open-source. Please follow OUR publication for detailed articles on open source !!!

--

--

Naveen Sundar
NITRR Open Source

Full Stack Developer. Open Source Contributor. Space Enthusiast. Viva la SpaceX.