Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS Code Reviews - Show updated files in response to comments

We are beginning to use the code review functionality built-in to VS 2012 and VS 2013 preview. Requesting the review and adding comments seem pretty straightforward. If someone adds comments requesting the code to be changed, then how does the requester make these changes and show them?

So the process would flow like this:

  1. Person 1 requests a code review.
  2. Person 2 adds comments and selects "Needs Work."
  3. Person 1 makes the necessary changes.

How does Person 1 now show these changes to Person 2? You can add comments and send them, but the files don't change. I'm assuming the files are from the changeset created when the original review was requested. Should Person 1 close this review, and request a second review?

Creating a second review doesn't seem optimal, because you lose the history of your conversation of why you were making the changes.

There are ton of websites showing how to use the basic functionality of the code reviews, but are there any sites that show the best practices? For instance, who should be clicking the check boxes next to files?

like image 685
John Avatar asked Sep 26 '22 15:09

John


People also ask

How do I see review comments in TFS?

Click on the badge and the extension will open the Team Explorer "My Work" page. "My Work" page will have Code Review Comments section at the bottom. As you can see two code reviews have bold font, meaning those two reviews have new related comments (comments to your code review or replies on your comments).

How do you respond to code review comments?

If a reviewer says that they don't understand something in your code, your first response should be to clarify the code itself. If the code can't be clarified, add a code comment that explains why the code is there. If a comment seems pointless, only then should your response be an explanation in the code review tool.


2 Answers

So the process would flow like this:

  1. Person 1 requests a code review.
  2. Person 2 adds comments and selects "Needs Work."
  3. Person 1 makes the necessary changes.
  4. Person 1 Updates the shelveset associated with the code review
  5. Person 1 adds comments to continue the discussion
  6. Repeat steps 2 - 5 until accepted

Here are the steps necessary to update the shelveset associated with the review.

  1. From the "Code Review" pane select the "view shelveset" link
  2. From the "Shelveset Details" pane highlight and copy the shelveset name
  3. Navigate to the "Pending Changes" pane, click on "Shelve" and paste the shelveset name
  4. Press the Yes button on the shelveset replace verification dialog
  5. Now the reviewer can see the updated files and the review discussion can continue

I've included some screen shots as I find it helps to clarify things.


1) From the "Code Review" pane select the "view shelveset" link as shown here:

enter image description here


2) From the "Shelveset Details" pane highlight and copy the shelveset name as shown here:

enter image description here


3) Navigate to the "Pending Changes" pane, click on "Shelve" and paste the shelveset name for example:

enter image description here


4) Press the Yes button on the shelveset replace verification dialog:

enter image description here

like image 183
Chad Dienhart Avatar answered Oct 19 '22 08:10

Chad Dienhart


I believe the correct procedure is fore Person 1 to make the changes and request another review. When your code needs work that means you will be changing it so you will want to have the old version to look back to for comparison. You still have the old review in the history after it is closed if you wish to look over the comments. We are currently in the process of optimizing our code review process in my workplace.

like image 6
Paddy Avatar answered Oct 19 '22 07:10

Paddy