Week 3: Lab 2 pull request

Introduction

This week, I worked on both finishing my release 0.1 and finishing lab 2, which involved partnering with another student and working on their code to add a new feature. In this blog, I will go over the process of expanding on an…

Introduction

This week, I worked on both finishing my release 0.1 and finishing lab 2, which involved partnering with another student and working on their code to add a new feature. In this blog, I will go over the process of expanding on another persons code, and how I took advantage of git to make this process safer and easier.

Creating an issue and a new branch

First, I needed to create a new issue on my partners repo, detailing the new feature that needed to be implemented, which can be found Here. This new feature is the –token (or -t) command, which will display some information about the token usage after a successful response from the AI. Next, I needed to fork their repo. Luckily, I already did this for last weeks lab so I could move on to cloning this project on my local machine. Now, I needed to create a new branch to work on, so any changes I make won’t effect the main branch until the pull request is later approved.

The code

Now I needed to implement the new feature. Since we worked with GROQ, I first needed to find some documentation online about how to get the token information. I found it Here, and I was able to learn the schema for gathering token information. Then, I looked over my partners code and copied parts of it for the new feature, modifying it to fit. This way I could add the new feature while keeping the style of code my partner wrote in tact. After testing a couple of times to make sure the new feature works, I updated the README document to include the new command in its list. Overall it was a nice and simple feature to implement, since both of our projects accomplished a similar task.

Pull request and merging

Finally, once I made the changes, I pushed them onto the new branch and created a pull request, which can be seen Here. My lab partner approved the changes and merged the branch with his own main branch, so now the feature is implemented. He also added the same feature to my own code, so now I am able to view the token information of my program. Overall this exercise was a fun, simple experience that helped the both of us get more experience with separate branches and pull requests.


Print Share Comment Cite Upload Translate Updates
APA

mpa-LHutchinson | Sciencx (2024-09-20T23:14:57+00:00) Week 3: Lab 2 pull request. Retrieved from https://www.scien.cx/2024/09/20/week-3-lab-2-pull-request/

MLA
" » Week 3: Lab 2 pull request." mpa-LHutchinson | Sciencx - Friday September 20, 2024, https://www.scien.cx/2024/09/20/week-3-lab-2-pull-request/
HARVARD
mpa-LHutchinson | Sciencx Friday September 20, 2024 » Week 3: Lab 2 pull request., viewed ,<https://www.scien.cx/2024/09/20/week-3-lab-2-pull-request/>
VANCOUVER
mpa-LHutchinson | Sciencx - » Week 3: Lab 2 pull request. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/20/week-3-lab-2-pull-request/
CHICAGO
" » Week 3: Lab 2 pull request." mpa-LHutchinson | Sciencx - Accessed . https://www.scien.cx/2024/09/20/week-3-lab-2-pull-request/
IEEE
" » Week 3: Lab 2 pull request." mpa-LHutchinson | Sciencx [Online]. Available: https://www.scien.cx/2024/09/20/week-3-lab-2-pull-request/. [Accessed: ]
rf:citation
» Week 3: Lab 2 pull request | mpa-LHutchinson | Sciencx | https://www.scien.cx/2024/09/20/week-3-lab-2-pull-request/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.