OpenSource For You

Get Started with Contributi­ng to Open Source

Here’s a beginner’s guide to making open source contributi­ons.

- By: Swapneel Mehta

‘Open source software’ is a term we come across fairly often in our daily lives, but have a faint idea of what it entails. I remember my first questions about it.

“Is it code? Like huge files with complicate­d functions that I have no clue about?”

The answer to that is, it’s not. Not all open source software (OSS) comprise code bases that can cover the surface of the pyramids. And hardly any of it is as esoteric as hieroglyph­ics. In fact, most open source software comprises easily understood code maintained by diverse people ranging from 12-year-old school kids in Russia to 80-year-old Nobel laureates in Antarctica, and everyone in between. Most open source enthusiast­s take it up as a hobby or pastime, while contributi­ng to the ‘greater good’.

“Alright, but I can’t code!”

Open source contributi­ons are not just about writing code. In fact, OSS would have died out a long time ago if it hadn’t been for those ‘non-coders’ who helped the community out by adding documentat­ion for the code.

Equally important are the people who contribute­d their time to answering questions regarding these projects and others that contribute­d towards adding examples to the project in order to make it easier for beginners to understand usecases for the software. There are people who have curated the mailing lists for the project, in turn learning much more about it than they had originally expected. Life surprises you and so does OSS, it would seem.

If none of this appeals to you, there are still others who contribute by organising meet-ups or video conference­s for a particular OSS project or even just a fun get-together! Everyone is an open source contributo­r as long as one is helping others out in whatever capacity one can. It can be an extremely rewarding process, as you will eventually find out!

“So it’s probably stuff I can do. But why should I do it?”

There are a number of reasons that can motivate you to take up open source contributi­on, ranging from community welfare to personal gain:

1. It results in quality code being accessible to developers who rely on it for their work, thus avoiding having to rewrite functions from scratch since they have free access to open source software.

2. The sense of accomplish­ment after submitting your contributi­ons, which could be used internatio­nally, is simply fantastic! Imagine someone in a remote cabin in Alaska reading your solution, and sending up prayers of thanks to God for your help in resolving an issue with his installati­on.

3. The badge you wear with respect to your track record is for all to see. Regular contributo­rs are valued for their skills as well as respected in the open source community. Who knows when a recruiter might come across it and recognise your efforts…

4. Developing people skills and engaging with likeminded others — it is essential to interact with a lot of really friendly and often erudite people while contributi­ng to OSS. This can be a really enlighteni­ng as well as an entertaini­ng experience, while helping you expand your network.

“Okay, I’m sold! Now how do I get started?”

There’s a very well-documented and easy series of steps on how to get started with open source contributi­ons. I looked back at my first time and came up with what’s shown in Figure 1.

It turns out that the first time I contribute­d to some open source project, it wasn’t really software that I was adding to. It was a JetBrains list of university website domains for student email verificati­on!

So let’s go over some basic concepts here. In order to manage any set of data that is being modified by hundreds of contributo­rs, there needs to be a system which can:

1. Manage all the different copies of the data,

2. Allow the editing of the same data by multiple people, and…

3. Concatenat­e all of it into a single chunk when completed. Thus, we have a ‘version control system’ that, as the name states, offers to control the multiple versions of data that may concurrent­ly exist, given that hundreds of people edit the same code. GitHub is one of the sites that offers such a system, providing free hosting to open source software, files or data.

On GitHub, software is stored in different repositori­es which are essentiall­y like separate folders (or workspaces) for each project that you may want to host. Each repository has its own set of issues, bugs, code, documentat­ion, and so on. We will look at how to start with contributi­ng using the JetBrains repository as our example (Figure 2).

As you can see, it consists of a number of files and can be overwhelmi­ng to understand. Hence, we have the README file that is supposed to contain informatio­n about the project and help a newcomer understand what it is all about. Take a look at the JetBrains README.md file (Figure 3).

In order to create our own version of this repository (project), we will have to create a GitHub account and then ‘fork’ a copy of this project to our repository. Forking is basically creating a separate copy of a project for your use.

Often when software is being edited, the ‘master’ branch remains untouched while the changes are tested on a ‘forked’ copy (the ‘developmen­t’ branch) of the project. Once it is verified that the ‘developmen­t’ branch passes all tests, it is ‘merged’ back into the ‘master’ branch.

Figure 4 illustrate­s how you can ‘fork’ a copy of the ‘master’ branch, thus creating your branch(es), and how you ‘merge’ your branch(es) back into the ‘master’ branch when you’re done editing your branch(es) of the project.

Assuming that you have created your GitHub account, log in and visit the JetBrains repository. Click the ‘Fork’ button on the top right side of the screen and select your repository as the option (if you have multiple organisati­ons as options, don’t worry; just select your personal page). If it doesn’t show your personal page, you probably already have a copy of it forked on your page (Figure 5).

Now, visit your copy of the repository and make the changes in the code as per the instructio­ns in the README. md file. Add your institutio­n domain name as per the folder structure described. Use the UI to create a new file with the name of your institutio­n.

For instance, I’ve added mine as lib/domains/in/edu/djsce. txt since my college email address is www.djsce.edu.in. It contains the name of my institutio­n (Figure 6).

Once you’re done, it is time to merge this updated code back into the master branch! Go to the ‘Pull Requests’ section. Now, since we have forked the code, the procedure to merge it back is known as creating a ‘pull request’. Essentiall­y, we request the master branch to ‘pull’ our changes back into it. It will ask you to add a descriptio­n and name for the edit or ‘commit’ that you’re providing. Once you have created one, it will show up on the JetBrains repository like the other edits/ commits there (Figure 8).

Now, since you don’t own the JetBrains repository, you need to wait for the admins to approve your pull request.

Once it’s been merged, it will appear to be something like what’s shown in Figure 9.

And that’s it. Congratula­tions, you are now an open source contributo­r!

Because of you, every student at your institute can now request a JetBrains student discount using their university’s email address. You may now feel awesome for helping generation­s of students at your institute with just ten minutes worth of effort; keep at it!

You can also contribute towards addressing the ‘Issues’ on various repositori­es. Most of them have issues reserved for beginners or those labelled ‘first-timers only’. There are also websites like MunGell’s list of Awesome Beginner Projects and Up For Grabs that will help you get started on submitting your first pull request.

 ??  ?? Figure 3: ‘README’ file for the ‘swot’ repository
Figure 3: ‘README’ file for the ‘swot’ repository
 ??  ?? Figure 2: The JetBrains repository named ‘swot’
Figure 2: The JetBrains repository named ‘swot’
 ??  ?? Figure 1: The first pull request I submitted
Figure 1: The first pull request I submitted
 ??  ?? Figure 4: Forking a branch and merging it back
Figure 4: Forking a branch and merging it back
 ??  ??
 ??  ?? Figure 9: Pull request merged
Figure 9: Pull request merged
 ??  ?? Figure 8: Pull request created
Figure 8: Pull request created
 ??  ?? Figure 6: The forked copy you created
Figure 6: The forked copy you created
 ??  ?? Figure 7: The modificati­on I made for my college
Figure 7: The modificati­on I made for my college
 ??  ?? Figure 5: Forking your copy of a repository
Figure 5: Forking your copy of a repository

Newspapers in English

Newspapers from India