This week was the beginning of HackotberFest 2019! This is the first time participating in a hackathon, and so far it has been going well.
My first challenge was finding an issue to work on. Last week I had looked through some of the available issues on GitHub and found a couple I thought would be a good first step. I messaged the owner of the repo of one of these issues and asked to work on it. They replied really quickly and assigned me the issue. I didn’t begin working it right way as I wanted to wait until the official beginning of HacktoberFest. Unfortunately when I did go to work on the issue someone had already fixed it and submitted a pull request for it.
This was a bit discouraging at first. I had been thinking that I had an issue I could work on and that it would be my first step into the open source community. But after a bit of thought I realized it wasn’t a big deal. The person who fixed it just did so as part of a bigger commit. They didn’t come in a try to step on any ones toes. Not to mention it was a rather small and easy fix to make. I had not begun working on it yet so i really hadn’t wasted any time.
So I began my search all over again. Fortunately with Hacktoberfest in full swing now there are plenty of issues on GitHub to work on. I came across a few issues I thought I could handle as a first attempt. I settled upon a project called CivicDataLab, whose goal is “Harnessing Data, Tech, Design and Social Science to strengthen the course of Civic Engagements in India”. The project it self is rather large and made up several different repositories, I choose to work on a specific one, civicdatalab.github.io. This repository contains their actual website. They had a couple of issues in this repositories, issue #30 which was the one I chose was fairly easy. On their website they had their logo in their website which did not do anything. They were looking for the logo to be clickable.
To begin my pull request I made a comment on the issue offering to work on the fix.
I decided to start working on the project before they assigned it to me. I forked their project then cloned it to my local machine. Once that was done I created a new branch before beginning work on the project. The first challenge I faced was just finding where I was supposed to make a change. With a project this large there were many folders and sub folders. Eventually I was able to find there the footer was kept. The edit it self was fairly easy to make. I found the line where the footer was being displayed and made it into a link to their homepage.
<div class="col-md-3"> <img class="logo" src="../assets/img/logo_black.png" alt="civicdatalab"> </div>
<div class="col-md-3"> <a href="https://www.civicdatalab.in/"> <img class="logo" src="../assets/img/logo_black.png" alt="civicdatalab"> </a> </div>
My code change was quite straight forward. I wrapped the image element in a <a> tag which is what is used to make links. The href attribute determines where the link takes you too.
Once I was done making the changes I had to test it to make sure the code worked and did not mess up any other part of the code. I launched the website locally and tested the link the footer. It worked perfectly. So then I added the file, and then committed it. After pushing it to the origin (my GitHub repo) I created a pull request.
This is where I encountered my next problem. I hadn’t realized was my editor changed all the line endings to Windows line ends from what they were originally. When I submitted my pull request I got a message back from the reviewer stating that all the lines of the file were edited not just the lines I need too. In order for them to accept my code I would need to make sure only to edit the lines I needed to.
So I went back to the project and changed the settings on my computer keep line endings the way they were. After that I moved my working branch back to the previous commit, which was the same as the latest master commit in the upstream repo. I then made the changes I needed and went through the steps to create the pull request again.
As of right now I have submitted the new pull request with the necessary changes and am hoping it will be accepted. However if it is not I will continue to make the changes needed to get it accepted.
Original Project: CivicDataLab/civicdatalab.github.io
My fork: varshannagarajan/civicdatalab.github.io
Original Issue: https://github.com/CivicDataLab/civicdatalab.github.io/issues/30
My 1st Pull Request: https://github.com/CivicDataLab/civicdatalab.github.io/pull/32
My 2nd Pull Request: https://github.com/CivicDataLab/civicdatalab.github.io/pull/34