Last week, I worked on a pull request that fixed a minor bug I spotted on my own, but I still haven't got respond from the project maintainer. Because of that, I've changed my approach this week. I tried to fix an issue that was spotted by the other, and well acknowledged by the project maintainer.
Issue that I worked on
The issue I found was the reoccurrence of languages in the language dropdown list on Open Web Calendar, which was mainly written in Python. At first it seemed to be straight forward, and I found that no one attempted to fix the issue according to the issue poster, who wanted to show the language in native name only (e.g. Português), so I gave it a try.
Pull request after several trials
After several attempts, I finally made a pull request that passed all the checks on GitHub, it turns out that the solution was not quite straight forward.
The first step was to get the project running, which I got stuck at first, as there was no instruction on the README.md telling how to run the project. Later, I found the Contributing Guide, and was able to set up the development environment and get it running.
Then I studied the structure of the project, and spotted out the function that needs to be changed to fix the bug. This already cost me some time before I can fix the bug. At the end, only a few lines of codes have been changed for the fix, but the time required to understand the project, and spot out the erroneous parts took most of the time.
After fixing the codes, I tested out the project locally, thinking that I've done my job and thus made a pull request, but the result wasn't as expected. It turned out that I didn't pass the tests when the pull request triggered the check on GitHub, then I realized that I had to change the test cases as well, as they did not use the native language in checking (e.g. Français for French, Português for Portuguese).
Finally, I checked the test log to find out the test cases which need to be modified, added one more test to ensure that the language names were not duplicated, and ended up changing two more files in order to pass the check on GitHub.
Lesson learnt and future planing
Through working on this pull request, I've learnt the importance of documentation, not only for users, but also for developers, especially in open source projects to which everyone can contribute. I also realized that changing the codes may not be the hardest part in bug fixing, reviewing the project structure and finding the erroneous parts sometimes take more time than changing the codes, especially for large projects. Lastly, I appreciate more about testing, which not only prevents commits with bugs, but also helps spot out erroneous parts in codes by sufficient logging.
The pull requests I've done for the first two weeks were mainly bug fixing for projects. In the next two week, I would like to work on issues of different types, possibly to add a new feature or add a test, and hopefully be more proficient working on open source projects.
Top comments (0)