Thank you and yes that's a great question, I'll try to write the steps here:
In Pull Request, you would see a File Changes tab where you can see diff of the changes made by the PR.
Then in the top right corner, you would see Review Changes button, which has three options. Comment (for casual comments), Approve (to approve the PR), Request Changes (to request any changes from the author of the PR).
The comment, and approve would be straightforward, you can just type a message and approve a PR or write comment.
But in case of requesting changes, you may sometimes have to point out where you want the changes to be.
Process of Requesting Changes:
You would see a + sign left to every line of code in the changes
You can click that plus button to comment on one line or drag it to select multiple lines
Then you will get a box of comment, where you can mention what change you think the author can do,
If you casually want to add a comment without submitting a proper review, you can click "Add Comment" but most probably you would want to "Start Review"
Similarly, you can add multiple comments to code and click Start Review
When you're done mentioning changes, In "Review Changes" button in the top right corner, select Request changes and put a general comment mentioning that you've requested changes below
And Submit Review.
Finally, your requested changes will be rendered as
Thank you and let me know if you have any other questions
Got it finally, what are code reviews and how to do it, 😃 😃 . Thanks for writing a long comment. I have a question that Is code review only done by repository owner/contributor? or like someone else can do code review in someone's repository. Like If I want to do code review in someone's repo and I have not made any pull request or i am not a contributor to that repo. Then can I do code review?
Yes you can do that as well. In the PR conversation it will be marked with a grey check mark and the owner's review will be marked with a green check mark.
This really is an essential part of oss contribution! I was always afraid of this part in the beginning and probably a lot more I have to know too! This could be a part of the original post as well.
Thanks, Saurabh for the valuable knowledge. I want to know about code reviews. I don't know how to do code reviews in Github?
Thank you and yes that's a great question, I'll try to write the steps here:
File Changes
tab where you can see diff of the changes made by the PR.Review Changes
button, which has three options. Comment (for casual comments), Approve (to approve the PR), Request Changes (to request any changes from the author of the PR).Process of Requesting Changes:
+
sign left to every line of code in the changes You can click that plus button to comment on one line or drag it to select multiple linesFinally, your requested changes will be rendered as
Thank you and let me know if you have any other questions
Got it finally, what are code reviews and how to do it, 😃 😃 . Thanks for writing a long comment. I have a question that Is code review only done by repository owner/contributor? or like someone else can do code review in someone's repository. Like If I want to do code review in someone's repo and I have not made any pull request or i am not a contributor to that repo. Then can I do code review?
Yes you can do that as well. In the PR conversation it will be marked with a grey check mark and the owner's review will be marked with a green check mark.
That's great. Thank you
This really is an essential part of oss contribution! I was always afraid of this part in the beginning and probably a lot more I have to know too! This could be a part of the original post as well.
These comments could very well become a standalone article :)