Hi There,
Today I want to talk about my first experience collaborating in someone’s project and review someone’s pull request. My partner was Leyang Yu.
First things first, Git stuff…
I need to say that before this week, git for me was a scary and confusing tool. I used “GitHub for Desktop” in order to push files to my repo when needed but my knowledge ended there.
After David's lecture this week I was able to understand how git works, I wasn’t afraid of messing up someone’s work. I learned how to use branches, add and remove files from the staging area and commit these changes to branches before pushing it to the repo and see the log to check all the other commits.
Choosing a Project
For this lab, I decided to contribute to Leyang Yu project, Jellybean SSG, . He is also using JavaScript so I decided that it would be a good idea to try adding to his project, so I filled and Issue Issue #6.
Besides using the same language, Leyang Yu approach was way different from mine, but still his code was clean, very organized and well documented which made my life easy. My task was to add a feature to parse Markdown files to HTML files, which first I did as an independent function. To make it work I also had to modify some of his other functions. I also updated his README file.
Making a Pull Request
After it was done, and after testing everything, I made a Pull Request.
As expected, he wanted me to make some changes on the code, instead of having a function to read from markdown to HTML, he wanted me to merge it with the getHtml function that previously read only txt files. Also, I needed to fix some typo on the README file and add some examples to it.
It is important to say that I had to adapt to his codding style, also I had to turn off my formatting tool (Prettier) in order to not mess with his formatting.
Trying Again
After adapting my code as Leyang Yu asked, I pushed the code again to the origin which automatically updated the Pull Request page. I sent him another detailed message on the Pull Request explaining how the new changes worked. After reading it, he understood what I did and decided to approve my code and merged it to his repo which felt great to be honest.
Reviewing Someone’s Pull Request
In the other hand, Leyang Yu filled an issue in my repository. Issue #8.
His issue goal was to add the Markdown feature to my project.
The Pull Request
Leyang Yu Pull Request
At first look already I could see that Leyang Yu adapted his code to my coding style. He solved the issue he filled and updated the README file.
I asked him to make a small change on his Regular Expressions to accept any number of empty spaces when parsing the # tags for markdown.
The Pull Request – After Applying Changes
Leyang Yu was fast, the communication between us was good and in a matter of minutes he had corrected what I wanted.
I approved his changes and merged the Pull Request.
Finally
This lab was really interesting, collaborating in someone’s code make me feel capable and useful.
Also learning git is one of the most useful things I learned since I started programing, I’m not sure why they don’t teach this earlier on college.
If you reached this line, Thank you so much for reading this!
Top comments (0)