Get Started with Con­tribut­ing to Open Source

Here’s a be­gin­ner’s guide to mak­ing open source con­tri­bu­tions.

OpenSource For You - - Contents - By: Swap­neel Me­hta

‘Open source soft­ware’ is a term we come across fairly of­ten in our daily lives, but have a faint idea of what it en­tails. I re­mem­ber my first ques­tions about it.

“Is it code? Like huge files with com­pli­cated func­tions that I have no clue about?”

The an­swer to that is, it’s not. Not all open source soft­ware (OSS) com­prise code bases that can cover the sur­face of the pyra­mids. And hardly any of it is as es­o­teric as hi­ero­glyph­ics. In fact, most open source soft­ware com­prises eas­ily un­der­stood code main­tained by di­verse peo­ple rang­ing from 12-year-old school kids in Rus­sia to 80-year-old No­bel lau­re­ates in Antarc­tica, and ev­ery­one in be­tween. Most open source en­thu­si­asts take it up as a hobby or pas­time, while con­tribut­ing to the ‘greater good’.

“Al­right, but I can’t code!”

Open source con­tri­bu­tions are not just about writ­ing code. In fact, OSS would have died out a long time ago if it hadn’t been for those ‘non-coders’ who helped the com­mu­nity out by adding doc­u­men­ta­tion for the code.

Equally im­por­tant are the peo­ple who con­trib­uted their time to an­swer­ing ques­tions re­gard­ing these projects and oth­ers that con­trib­uted to­wards adding ex­am­ples to the project in or­der to make it eas­ier for begin­ners to un­der­stand use­cases for the soft­ware. There are peo­ple who have cu­rated the mail­ing lists for the project, in turn learn­ing much more about it than they had orig­i­nally ex­pected. Life sur­prises you and so does OSS, it would seem.

If none of this ap­peals to you, there are still oth­ers who con­trib­ute by or­gan­is­ing meet-ups or video con­fer­ences for a par­tic­u­lar OSS project or even just a fun get-to­gether! Ev­ery­one is an open source con­trib­u­tor as long as one is help­ing oth­ers out in what­ever ca­pac­ity one can. It can be an ex­tremely re­ward­ing process, as you will even­tu­ally find out!

“So it’s prob­a­bly stuff I can do. But why should I do it?”

There are a num­ber of rea­sons that can mo­ti­vate you to take up open source con­tri­bu­tion, rang­ing from com­mu­nity wel­fare to per­sonal gain:

1. It re­sults in qual­ity code be­ing ac­ces­si­ble to de­vel­op­ers who rely on it for their work, thus avoid­ing hav­ing to re­write func­tions from scratch since they have free ac­cess to open source soft­ware.

2. The sense of ac­com­plish­ment af­ter sub­mit­ting your con­tri­bu­tions, which could be used in­ter­na­tion­ally, is sim­ply fan­tas­tic! Imag­ine some­one in a re­mote cabin in Alaska read­ing your so­lu­tion, and send­ing up prayers of thanks to God for your help in re­solv­ing an is­sue with his in­stal­la­tion.

3. The badge you wear with re­spect to your track record is for all to see. Reg­u­lar con­trib­u­tors are val­ued for their skills as well as re­spected in the open source com­mu­nity. Who knows when a re­cruiter might come across it and recog­nise your ef­forts…

4. De­vel­op­ing peo­ple skills and en­gag­ing with like­minded oth­ers — it is es­sen­tial to in­ter­act with a lot of re­ally friendly and of­ten eru­dite peo­ple while con­tribut­ing to OSS. This can be a re­ally en­light­en­ing as well as an en­ter­tain­ing ex­pe­ri­ence, while help­ing you ex­pand your net­work.

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

There’s a very well-doc­u­mented and easy se­ries of steps on how to get started with open source con­tri­bu­tions. I looked back at my first time and came up with what’s shown in Fig­ure 1.

It turns out that the first time I con­trib­uted to some open source project, it wasn’t re­ally soft­ware that I was adding to. It was a JetBrains list of univer­sity web­site do­mains for stu­dent email ver­i­fi­ca­tion!

So let’s go over some ba­sic concepts here. In or­der to man­age any set of data that is be­ing mod­i­fied by hun­dreds of con­trib­u­tors, there needs to be a sys­tem which can:

1. Man­age all the dif­fer­ent copies of the data,

2. Al­low the edit­ing of the same data by mul­ti­ple peo­ple, and…

3. Con­cate­nate all of it into a sin­gle chunk when com­pleted. Thus, we have a ‘ver­sion con­trol sys­tem’ that, as the name states, of­fers to con­trol the mul­ti­ple ver­sions of data that may con­cur­rently ex­ist, given that hun­dreds of peo­ple edit the same code. GitHub is one of the sites that of­fers such a sys­tem, pro­vid­ing free host­ing to open source soft­ware, files or data.

On GitHub, soft­ware is stored in dif­fer­ent repos­i­to­ries which are essen­tially like sep­a­rate fold­ers (or workspaces) for each project that you may want to host. Each repos­i­tory has its own set of is­sues, bugs, code, doc­u­men­ta­tion, and so on. We will look at how to start with con­tribut­ing us­ing the JetBrains repos­i­tory as our ex­am­ple (Fig­ure 2).

As you can see, it con­sists of a num­ber of files and can be over­whelm­ing to un­der­stand. Hence, we have the README file that is sup­posed to con­tain in­for­ma­tion about the project and help a new­comer un­der­stand what it is all about. Take a look at the JetBrains README.md file (Fig­ure 3).

In or­der to cre­ate our own ver­sion of this repos­i­tory (project), we will have to cre­ate a GitHub ac­count and then ‘fork’ a copy of this project to our repos­i­tory. Fork­ing is ba­si­cally cre­at­ing a sep­a­rate copy of a project for your use.

Of­ten when soft­ware is be­ing edited, the ‘mas­ter’ branch re­mains un­touched while the changes are tested on a ‘forked’ copy (the ‘de­vel­op­ment’ branch) of the project. Once it is ver­i­fied that the ‘de­vel­op­ment’ branch passes all tests, it is ‘merged’ back into the ‘mas­ter’ branch.

Fig­ure 4 il­lus­trates how you can ‘fork’ a copy of the ‘mas­ter’ branch, thus cre­at­ing your branch(es), and how you ‘merge’ your branch(es) back into the ‘mas­ter’ branch when you’re done edit­ing your branch(es) of the project.

As­sum­ing that you have cre­ated your GitHub ac­count, log in and visit the JetBrains repos­i­tory. Click the ‘Fork’ but­ton on the top right side of the screen and se­lect your repos­i­tory as the op­tion (if you have mul­ti­ple or­gan­i­sa­tions as op­tions, don’t worry; just se­lect your per­sonal page). If it doesn’t show your per­sonal page, you prob­a­bly al­ready have a copy of it forked on your page (Fig­ure 5).

Now, visit your copy of the repos­i­tory and make the changes in the code as per the in­struc­tions in the README. md file. Add your in­sti­tu­tion do­main name as per the folder struc­ture de­scribed. Use the UI to cre­ate a new file with the name of your in­sti­tu­tion.

For in­stance, I’ve added mine as lib/do­mains/in/edu/djsce. txt since my col­lege email ad­dress is www.djsce.edu.in. It con­tains the name of my in­sti­tu­tion (Fig­ure 6).

Once you’re done, it is time to merge this up­dated code back into the mas­ter branch! Go to the ‘Pull Re­quests’ sec­tion. Now, since we have forked the code, the pro­ce­dure to merge it back is known as cre­at­ing a ‘pull re­quest’. Essen­tially, we re­quest the mas­ter branch to ‘pull’ our changes back into it. It will ask you to add a de­scrip­tion and name for the edit or ‘com­mit’ that you’re pro­vid­ing. Once you have cre­ated one, it will show up on the JetBrains repos­i­tory like the other ed­its/ com­mits there (Fig­ure 8).

Now, since you don’t own the JetBrains repos­i­tory, you need to wait for the ad­mins to ap­prove your pull re­quest.

Once it’s been merged, it will ap­pear to be some­thing like what’s shown in Fig­ure 9.

And that’s it. Con­grat­u­la­tions, you are now an open source con­trib­u­tor!

Be­cause of you, ev­ery stu­dent at your in­sti­tute can now re­quest a JetBrains stu­dent dis­count us­ing their univer­sity’s email ad­dress. You may now feel awe­some for help­ing gen­er­a­tions of students at your in­sti­tute with just ten min­utes worth of ef­fort; keep at it!

You can also con­trib­ute to­wards ad­dress­ing the ‘Is­sues’ on var­i­ous repos­i­to­ries. Most of them have is­sues re­served for begin­ners or those la­belled ‘first-timers only’. There are also web­sites like MunGell’s list of Awe­some Be­gin­ner Projects and Up For Grabs that will help you get started on sub­mit­ting your first pull re­quest.

Fig­ure 3: ‘README’ file for the ‘swot’ repos­i­tory

Fig­ure 2: The JetBrains repos­i­tory named ‘swot’

Fig­ure 1: The first pull re­quest I sub­mit­ted

Fig­ure 4: Fork­ing a branch and merg­ing it back

Fig­ure 9: Pull re­quest merged

Fig­ure 8: Pull re­quest cre­ated

Fig­ure 6: The forked copy you cre­ated

Fig­ure 7: The mod­i­fi­ca­tion I made for my col­lege

Fig­ure 5: Fork­ing your copy of a repos­i­tory

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.