DEV Community

Marco Pasqua
Marco Pasqua

Posted on

Last PR of Hacktoberfest

Hey, everyone today I made my last PR for Hacktoberfest! First off I want to thank everyone for following my journey through Hacktoberfest. It means a lot to me that you have been reading these blog posts. Without further ado, let's talk about my final contribution.

What's the Issue I Worked on?

The issue I worked on for this final PR was an issue I made on the calculator for everything repo. In this final issue, I asked the repo owner if I can add an new calculator in the Physics section. This calculator being one for momentum. In the description of the issue, I explained how the calculator would be created. It would follow the formula p = m/v. With p being momentum, m being mass and v being velocity. Mass will have a value in kilograms (kg), velocity will have a value in meters per second (m/s). Together they will return a value of kg m/s for momentum. After I made this explanation, I waited for the repo owner to approve it. Thankfully, it was so I got to work.

Working on the Issue

As you may know, I worked on this repo in the past with my second PR of Hacktoberfest. So working on this calculator was very simple, as much of it was the same as the issue I worked on in that blog post. However, I'll still describe what I did while working on this issue.

When the repo owner approved my calculator request they told me where I can can contribute my work, which was in a folder and file specifically made for my issue. Since, I worked on this issue in the past, I did not have to make a fork of the repo. However, I did have to sync it with my fork on GitHub and then pull the changes to my cloned version on my computer. After I did this I got to work. I first had to define the variables to store the momentum, mass and velocity and then create text fields that can accept the input and set the value in the variables. Then I had to create a button and set the onclick attribute to a function I created that would check if input for the value were incorrect. For example, if the mass was a negative number or had just text in it, then the function would display an error telling the user to enter a positive number. If these checks passed then the function would multiply the mass and velocity to find the momentum. I ran the function through a few tests and saw that everything was working.

The next step, was to create an info file explaining what the calculator solves for and what the variables p, m and v are. This was also very simple, I was able to reuse the info file from my previous contribution and just had to make some minor changes to the text in the file to match my current calculator. I then had to add the info file to the main file containing the logic for my calculator, which was also really simple. I just followed the same thing that I did with my previous contribution. I did a test on it to make sure that the pop up containing the explanation would show, which it did.

I now had one final change to make. I had to add the calculator name to the README file. This was as simple as it sounds. However, I did notice one thing. There was a duplication of the physics section in the README. I knew this wasn't good to have in the file, so I decided to remove it. Once I did that I committed all my changes and made a PR.

While the repo owner was happy with my contribution. They thought that I removed the entire physics section from the README. However, I told them that I only removed the duplicate that had less calculators in it and provided screenshots as proof. The repo owner realized the misinterpretation and accepted my PR. Giving me my final PR for Hacktoberfest.

Overall

Overall, I learned quite a bit from Hacktoberfest it gave me a really good idea of what contributing to open source projects can be like. As well as how I can search for some projects to contribute to. However, I do wish that I could've attempted to make contributions to some larger repos, or at least work on repos that aren't all based on JavaScript/React JS as web development is not my most favourite thing to work on. However, it was still a lot of fun to work on these projects. As I got to learn quite a bit on the way, such as Docker and contributing to open source projects. Having the chance to contribute to open source projects made me feel like I was working for a client out in the real world as for some of my changes, they had to meet requirements set out by the repo owner. It's given me the confidence to look at some repos other repos and maybe try helping out the project by fixing a bug or adding an additional feature. Anyways, that concludes this blog post. Once again, thank you all for reading this far and following my journey through Hacktoberfest. It really means a lot to me. Catch you all in the next post!

Top comments (0)