DEV Community

DenisC
DenisC

Posted on

First Pull Request on Open Source Project by Classmate

A week ago, I contributed to other repository by reviewing codes and carrying tests, to simply point out issues spotted for the owner to fix. This time, we are pushing it a bit further by implementing new features on repository by others.

The new feature I am working on is to add an optional flag to filter the output to display only recent files (details refer to Pull Request I made). In Python, I have to import the time module to get the current time, and use function from os module to get the last modification date of files, in order to check if the modification date is within the specified period.

In details, the Pull Request I made includes importing relevant module, adding argument to parser, adding function to check if a file is recent, and modifying relevant program logic to alter the output when the flag is selected. I also amended the README.md file to add instruction for the use of the flag. The implementation of the new function was quite straight forward, but checking which parts of the existing codes should be modified in order to blend in the new feature could be time consuming. Through forking the repo and working on the codes in a separate branch, pushing changes to the forked repo and then making pull request, my changes were eventually accepted by the repo owner.

For the Pull Request from classmate made to My Repo, I faced difficulty resolving conflicts when trying to merge the changes to main branch, due to the fact that multiple users are working on the same project in parallel. I have learnt how to use different tools to compare the code changes, and gracefully merge the changes after resolving conflicts after some research. I have also realized the importance of proper modularization of program to minimize the chances of having conflicts.

Overall, it is a great experience in working on projects originated from others, and allowing others to work on my own project. I have become more familiar with collaboration on GitHub, and explored more features such as making pull request and resolving conflicts.

Top comments (0)