Posts

Showing posts from November, 2020

OSD600- Release 0.4 Part 1

Image
 The semester is almost over and we have one more release! For  Release 0.4  we must top everything we have done before in the class! Sounds challenging but fun! I first read the assignment and saw the ideas our professor gave us. I decided I want to work on Telescope again. What drew me to Telescope was the community. They were all very nice, and I enjoyed working with them last time, so why not work with them again! I went on Slack and let them know I am interested in working on Telescope again, and asked if there is anything I can do. I was told to look at this pinned issue. They are currently porting GastbyJs code to Next.js code and can use some help porting the modules. I decided to do Login/, To be honest, I have no idea how to do this (although I haven't read any of the documentation provided yet) but I'm really not worried as I know there is a large community of people, and great resources to go to to help me accomplish this. Another great thing about this is I will le

OSD600 Lab 8 & 9

Image
Lab 8 involved writing tests for our link checker programs! Unlike other labs, this ran for two weeks and consisted of two parts! For the first part, we had to write some tests for our program, and for the second part, we needed to write some tests for another person's program. The testing framework I chose was jest . The two main reasons I chose this was because it's the most popular testing framework for Javascript, and I already had some experience working with it during release 0.3. Another tool I used was the npm module nock . This was so I can make mock requests to websites. Setting up both was pretty simple once I read the documentation. After installing jest make a test file. For example, if you wish to test functions in index.js make a file called index.test.js . To run the test run the command npm run test. Also, make sure in package.json   you add "test": "jest" in the "scripts" section. Nock doesn't require much setup besides requi

Release 0.3 PR2

Image
  For release 3 we have to make 2 PR's. The first one must be for the  Telesope project  and the second one must be for an external project. These PR's must "build up" from the PR's we did for release 0.2. This blog post will highlight working on the PR for Telescope. When I started this the first place I went was to the issues page on the Telescope repository. I saw there were some tests that needed to be written and were interested in taking on one of these issues. These were more complex than the test I wrote for the first part of 0.3 so  I saw it as a good opportunity to improve my skill. I asked in Slack for some advice on what to do and was given this idea from David: This seemed like a good test to write (challenging but something I can figure out) so I made an issue for it and started working! When I first wrote the test everything looked fine but it kept on failing. At first, I thought that's good, if we pass an invalid date shouldn't the test fa

OSD600 Lab 7

Image
 For this week's lab in my Open Source Development class, we looked at static Analysis tooling. The tools we needed to add to our link checkers were a source code formatter and linter . I decided to use Prettier  for my source code formatter and ESLint for my linter. Prettier is a formatter that helps make code more readable. One really useful feature it has is it allows you to "customize" how you want it to format your code by making a .prettier.rc file. For example in mine , I make sure every line ends with a semicolon, the padding width is 70 and I allow trailing commas. Prettier logo ESLint is is another static Analysis code tool for catching "silly" mistakes in JavaScript. It will raise an error and let you immediately if you did something wrong. This can also be helpful to enforce coding styles. Similar to Prettier it allows you to "customize" how you want it to check your code by making a .eslintrc.json file. For my code, I made sure every lin

Release 0.3 PR1

Image
 For release 3 we have to make 2 PR's. The first one must be for the Telesope project  and the second one must be for an external project. These PR's must "build up" from the PR's we did for release 0.2. This blog post will highlight working on the PR for an external project. David suggests to "consider working on a repository/project you've already worked on in the past and have set up on your local machine". I took that advice when I started searching. Back in October, I worked on this repository , a collection of different kinds of algorithms written in different programming languages. In October I made a PR to add the Cocktail sort algorithm in C++. At the time this was good since I did not do much work with algorithms before. However, there was a new issue for the project that was perfect for release 0.3. This issue wanted people to add unit tests for an algorithm currently present in the repository. I have never written a unit test before and

OSD600 Lab 6

Image
This week we started to get familiar with Telescope  a tool made by students of OSD 600 to track blogs written for Senecas Open Source class. The first task of this week's lab was to set up telescope and get it to run on our local machine. I first read the envirenmet-setup.md file and decided I will use the docker and docker-compose method. After I forked and cloned the repository I downloaded docker decktop (this comes with docker and docker-compose) then followed the steps to run it. I did run into some minor issues when trying to run it, but was able to figure it out!  After I got that working I started the second part of lab 6. For this part, we had to modify our link checker to search for links in the last 10 telescope posts. To be honest, at first, I had no idea how to do this. But then I took a minute to think about it and start writing some code (It's easier for me to visualize). Eventually, I figured it out! I used fetch() to grab the JSON data from http://localhost: