Quick Open Source Lab 2 Update
Tags: opensource, java, python
Published: 2020-09-29 22:17:45

Chris here again back for a quick blog post update for lab 2. 

As a reminder (or an FYI for readers who may not be going to Seneca College and taking OSD600) for our last lab (lab 1) we had to fork, review, and test the code from our partner’s release 0.1. I got a lot of great feedback from Plamen (besides him telling me that he hated me). Although all we had to do was test and file issues, both of us decided to file some minor pull requests to help improve our readmes, remove comments, or change variable names, in an attempt to learn more about Git and GitHub.

For this lab (lab 2) we had to implement an [optional feature](https://github.com/Seneca-CDOT/topics-in-open-source-2020/wiki/release-0.1#optional-features-pick-2) on our partner’s release 0.1 project. How exciting:  an opportunity to disappoint someone further. Contrary to my charming negative demeanor, I had a lot of fun implementing [not one](https://github.com/pyvelkov/DeadLinkage/pull/10), but [two](https://github.com/pyvelkov/DeadLinkage/pull/11) optional features to Plamen’s project. I chose to do two ~~because Plamen was doing two~~ because I felt that simply adding linux-style CLI arguments wasn’t exactly enough as it was just a simple change. I wouldn’t say I bit off more than I could chew, but I also wouldn’t say it was as easy as I thought it would be.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qpijlrp1d9q6ikobed2x.png)

I tried opening another page using web driver, but I ended up spending more time begging the web driver to cooperate rather than implementing the feature. This was by far the biggest headache, as the selenium web driver automatically took me to the final destination of the URL, which makes sense given that Selenium is generally used for testing purposes, and if we’re testing a page for links who cares how you got there, as long as you did.

The big breakthrough for this was to set `httpURLConnect.setInstanceFollowRedirects(true);` to true. This allowed me to follow the redirect to the final destination instead of simply spitting out `ERROR 30x`.

I have to say that getting a PR on my own repo is extremely thrilling. Someone actually gives enough of a damn (or uh... is being coerced to) to contribute something to your project. I actually just merged [two](https://github.com/pyvelkov/DeadLinkage/pull/11) [PRs](https://github.com/chrispinkney/He-s-Dead-Jim/pull/15) that Plamen sent me back today. One even featured a timer (which he used to determine that head was causing the program to process faster), and the other creatively displays how many hoops the redirect had to hop through to get to its destination. Awesome! Really well done.

Some other thoughts are that in hindsight I think we spent too much time not communicating via GitHub, it might have been a better idea to as this would have given us some more experience “blindly“ communicating with random programmers over the internet.

Well that was fun. Now if you don’t mind me, I’m gonna go spend my night [watching a comedy](https://en.wikipedia.org/wiki/2020_United_States_presidential_debates#Debate_list) and enjoying a bottle glass of wine.

C