This is the final blog post for OSD600 Release 0.3.
At the end of this Release, I have had a total of 4 PRs:
- https://github.com/joelnet/MojiScript/pull/250
- https://github.com/yevseytsev/SenecaBlackboardExtension/pull/39
- https://github.com/deepanjali19/GitHub-Dashboard/pull/12
- https://github.com/deepanjali19/GitHub-Dashboard/pull/17
The third and fourth PR are about the GitHub Dashboard project that I’m doing for internal Pull Requests.
Basically in this project we’re trying to revamp the GitHub front page, creating a dashboard that allows user to see important and relevant details for his/her issues and pull requests, as well as other information about the repositories that they’re interested in.
Some of these new features will be implemented as components on the dashboard, for example:
- Display issues that match given labels for a repo the user is interested in
- List most recent activity for a repo the user is interested in
- Display issue with least amount of comments/most amount of comments in a given repo
- Display and list comments related to recent pull request/issue a user has made
- Display the user’s recent activity in a list
- Display total number of stars for all the user’s repos
- a list of issues the user is currently working on
- a pie chart showing a distribution of languages the user worked with based off the repositories they have
- a simple list of languages the user has used
But for now we have to create mock-up pages to house these components, as well as setting up testing environments and making the page responsive.
My fourth PR has actually accomplished creating mock-up pages for the dashboard but I will go into the details in the next blog post.
For the moment, I want to talk about something that I have learnt through creating my first external PR that I haven’t mentioned.
To recap, for that PR, I was tasked with creating a new type for MojiScript Language, based on similar existing type. Through the creation of new type, many new functions were created as well.
And when I’m pretty sure that everything works perfectly by running local test (npm test), I got stuck when I tried to commit my changes. At first I didn’t understand what or why something would stop me from committing on a local clone of the project (not to mention it was a fork repo).
I just didn’t understand what the error was about (it says something like global test coverage not satisfied). After a while I got frustrated, and figured out that I could uninstall the node_modules folder (in other word, not running npm install from the start) to prevent my commit from being blocked by whatever it is when I tried to run git commit. Then I was able to commit successfully and pushed the code to my origin repo and made a PR.
This is where I figure out the problem I encountered earlier, all thanks to the awesome third party services connected to GitHub like TravisCI and coveralls.io, because they give much better visual information about what is problematic with your code, rather than the boring, plain terminal. So it turned out that because I have created new type and more functions, I’m also required to create additional tests to cover additional and new cases. Furthermore, I also learned that there is a thing called pre-commit hooks (the one that I saw was husky), that are basically procedures to run on my code before it get committed (or whenever I call `git commit`), like ESLint, or tests that check whether my new codes have broken anything, and of course the test coverage, which gave me trouble.
I then go back to write additional tests for my new functions, but I still get the test coverage not fulfilled error. I was so annoyed that I couldn’t figure out which tests hasn’t been covered by looking at the table of percentage in the terminal and can’t make a commit, that I deleted the node_modules folder again to push my code to the PR.
This is where coveralls.io comes in very handy. It shows me a nice clean GUI of which test still needs to be covered or created, by putting check marks over every functions. Then I see the one function that I haven’t written test for, I wouldn’t had been able to do this just by looking at the statistical data in the table in the terminal. After that, everything was fixed and I got no errors and my PR was merged.
The point to pull out of this experience is that GitHub works with many other third-party services that are connected to repositories that enhance the quality and workflow of open source collaboration.