Dear PC readers!
Welcome back to my blog.
As the name suggests, this is a blog for Release 0.3 PR 1. In release 0.3, we had to make two PRs: one in Telescope which is kind of an internal project to this course, you could say. This blog feed server is created by Open source students only. So it was one of the tasks to complete a PR for this and get it merged in order to gain full marks for this PR. Although the second PR, could be in any open source and does not necessarily has to be merged( Although I will try it to be).
Let's start with the process, I started looking through the issues on Telescope. I see many of the students are working on CSS and other things, so I thought let's get something bigger and fix a bug. As a tester in my whole IT experience, I have been only logging bugs. Now, for a change, let's debug. But ofcourse, destiny plays its role, all the debugging issues had the writing of the test cases also. Lol, test cases are back in my life(in a different way, but yeah back). Anyway, I accepted that and picked one issue. https://github.com/Seneca-CDOT/telescope/issues/1312
The issue was to validate the query route parameters i.e. text and filter using Express Validator and write the unit tests to check my code. I started by researching about the Express validator and learnt to how to use it. I installed it using
npm install --save express-validatorhttps://express-validator.github.io/docs/
I added the functions called queryValidationRules and validateQuery which is a query Validation Function in Validation.js file.I used chaining with express validaiton like this.
And then used the queryValidation in the query.js
I went ahead and added few of the test cases to test my code coverage. I then pushed the PR.
Devansh, Dave and Tony were my reviewers and they gave me some good feedback to improve my code and add more test cases for my work to better cover the code I created.There were some also very stupid issues that I left like saying 0 to 256 characters instead of 1 to 256. So thankfully Dave caught them and let me know. I fixed all of them.
I was then asked to squash all of my commits into one in order to get it merged in the project. I did that and thankfully my PR got merged in the holy project of "TELESCOPE" 😃
I was so happy to see that!
FYI, I also reviewed my peer's PR which were similar to my issues. It felt like a teacher who dont know much lol. What if I say something that is wrong, what if it is not something that should be done and I break the code through my review, with lots of thoughts in my mind. I still tried to review a bit that I thought was not gonna break the code, if I did .. oops sorrryyy! 😜JK
So yeah, here is my PR link : https://github.com/Seneca-CDOT/telescope/pull/1334
Take care, Stay well! I will see you in my next blog!
Best,
PC
No comments:
Post a Comment