DEV Community

Rachit Chawla
Rachit Chawla

Posted on

My Experience: Working with Draft Pull Requests

First Step: Finding a Problem

I began by raising an issue on the project mentioning that I'm planning to add a new feature to the project. The project was an application to convert txt/md to html. I planned to add a parser argument --config and a logic to parse config files to get the values of flag supported by the program.

Draft Pull Request: A Game-Changer

Working on this project also introduced me to the concept of a Draft Pull Request (PR). This feature allowed me to work openly and transparently, signaling that my PR was a work-in-progress. The draft PR served as a visual representation of my progress, a testament to the work accomplished, and the work that lay ahead. I had an option to mark my PR ready for review whenever I was done with the changes.

Collaboration and Patience

The collaboration didn’t end with my changes; it extended to reviewing the work of others. I found myself collaborating with my peers, navigating their code, and providing feedback.
I myself, reviewed someone's PR on my project and commented some changes required. I forgot to implement an output flag handling in the PR I created. I received a change request and then worked on it. This part gave me an experience of proper reviewing , collaboration and adding more commits to a previous PR.

Things I newly learned by working on this lab

Reviewing and testing via remotes:

In this lab, I mastered the art of reviewing and testing code changes via Git remotes. Adding a remote repository from a fellow student allowed me to fetch their work locally. I then set up a tracking branch, creating a direct link to their progress. I used the command below to create a remote locally:

git remote add <name-of-student> <https://git-url-of-other-studnet-fork.git>
Enter fullscreen mode Exit fullscreen mode

I used git fetch <name-of-student> to retrieve all the code changes so that I can test them locally without merging.

To facilitate effective collaboration, I created a tracking branch. This branch served as a direct link to the other student's progress. Using the command:

git checkout -b <branch-name> <name-of-student>/<branch-name>

Enter fullscreen mode Exit fullscreen mode

Merging a PR locally

After I reviewed the changes above using the steps above. I merged it locally using the commands below:

$ git fetch <name-of-student>
$ git checkout main
$ git merge <student-name>/issue-6
$ git push origin main
Enter fullscreen mode Exit fullscreen mode

References

Link to the PR I created : My PR
Link to the PR that was created on my project : PR12

Top comments (0)