DEV Community

Cover image for First pull request
Emily
Emily

Posted on

First pull request

This week, I created my very first pull request to my classmate's project and also received the first contribution to my Shinny-ssg application.

Creating a Pull request

The project I chose to work on is OSD600-SSG, written by Hung. I am interested in this project because it is written in JS and I would love to learn more about it. I contributed to the project by adding the new feature to accept markdown file. The first challenge I had was adding new code without breaking his old code. His coding style is different from mine so it took some time to learn the logic flow of the code. Luckily, Hung was really nice and he even encouraged me to change his code. The second challenge I had was working with regular expression. I needed to transfer the emphasis sentence in markdown file to html bold text. In a markdown file, to bold the middle of a word for emphasis, you need to add two asterisks without spaces around the letters. I added an extra space to my finding pattern and it was hard to find this bug. In the end, I successfully added the new feature to the project. After testing it on my local computer, I created a pull request and got accepted by Hung.
My PR

Receiving a pull request

I had the pleasure of receiving the contribution from Andrew to add markdown processing feature to my application. He made the change to the code very quickly and it was exactly what I would do if I were the one to implement it. I especially liked the way he used LinQ in createSubfolder function. It was brilliant and now I know one more way to work with file.
Andrew's PR

Take-away

I think the most important thing to make a successful pull request is following patterns in the existing code. It will help save the reviewer's time to understand, debug and make recommendation.

Discussion (0)