OSD 600 LAB4

About Lab4

In this lab, I am going to add ignore URL Patterns to one of my classmate's URL command-line tool project. For example,  if you write 'https://www.google.com" in the text file (ignore-urls.txt), then run the command "$ tool-name --ignore ignore-urls.txt index.html".  Your tool will check all URLs in index.html, but ignore the URLs in ignore-url.txt which is "https://www.google.com" in this case. I am also asked to practice using git remote and sharing commits with git pushgit pull,git fetch and git merge. 

Getting start

Since our professor prefers us to work on the repo we haven't worked on before, I picked Hyunji Lee's repo URL-FI which is also written in javascript from the 0.1 Submissions list

I filled up the Issue-12 for the new ignore feather. After I cloned the repo and tried to test some commands, I found that the tool isn't working properly. 



I console.log something out and find the program stops at fs.readFile. I tried to solve the program for a while but couldn't figure it out. Therefore, I asked Hyunji about the problem I found on the Issue-12, it turns out it's an exit code issue, and she fixed it really quickly. 

Implement the feather

The feather is not hard, I made the ignore flag first. If the argument is --i or --ignore, it will set the ignore flag to true. If the ignore flag is true, it will read the next file after the --ignore argument, and store all the URLs in that file into an array. After reading the second file, I used the filter function to compare and filter the duplicate URLs in both arrays. 


Problem I got

Hyunji checks my code carefully and points out some bugs I have in my PR

The first problem I got is the readFile is not work synchronously. Sometimes it runs the second readFile before the first readFile ends. I simply change the readFile to readFileSync to prevent the readFile read before read ignored file ends.

I also forget to code that treat '#' as a comment. I implemented this functionality Hyunji pointed out.

I was terrified When Hyunji told me third times that my code is not working properly again. However, it turns out that she was running her own code instead of mine.

Lab 4 remote command practice

After Wei-J-Huang adds the ignore feather to my repo, I use the command "remote add Wei-J-Huang https://github.com/Wei-J-Huang/urlStatusChecker.git" to add the remote to my local repo, then "git fetch Wei-J-Huang" to fetch the remote repo. Then I set up a tracking branch checkout -b Wei-J-Huang/issue-7 for testing his code.
 
I discuss some problems with Huang on slack. After he added the warning of Ignored file format, I fetch then pull the remote repo again, then merge it to my master branch.

Links for the Repo, issue, and PR




Comments

Popular posts from this blog

My PR for release 0.3 External Project

OSD600 Lab8

OSD600 -- Release 0.4.1 -- Choose Project and issues