Manage and perform code reviews

Completed

Code reviews, or having one or more other developers approve your changes before you check them in, are a helpful practice in keeping your repository stable.

To submit code for review from Visual Studio, follow these steps:

  1. Go to My Work in the Team Explorer window.
  2. Make sure that all the changes you want to have reviewed are visible in the In Progress Work section.
  3. In the In Progress Work section, select Request Review.
  4. Enter any users that you would like to review your changes.
  5. Enter a name and description for your changes.
  6. Select Submit Request.
  7. Optionally, you can name your shelveset and select Suspend so that you can work on other changes while you wait for review.

The code review appears in the Code Reviews section of My Work, for you and for each of your reviewers.

To perform a code review, follow these steps:

  1. Right-click code review request.
  2. Select Open.
  3. Select Accept to let the requestor know that you have agreed to review their work.
  4. Open each file in the shelveset and use the Difference window to see the changes side by side with the original file contents.
  5. In the Team Explorer window, add any comments that you have to the relevant files. Comments link to a text selection, like in a Microsoft 365 document, so be aware of that when you add each new comment.
  6. When you have reviewed each file, select Send Comments to let the reviewer know what changes you have recommended.
  7. If you have no comments, select Close Review and indicate that the changes passed your review so that the reviewer knows to check them in.

If you happen to make a mistake, perhaps your code reviewer will catch that mistake and send you one or more comments. To view and address these comments, follow these steps:

  1. Go to the My Work page in Team Explorer.
  2. If you suspended your work after submitting it for review, select it in the Suspended Work section.
  3. Select Resume.
  4. Right-click Code review request.
  5. Select Open.
  6. Select each comment to view the relevant code and incorporate the review feedback.
  7. After you have addressed the feedback in a comment, select the box for that comment to indicate that you have done so.
  8. Depending upon your team's practices and the scope of the changes that you make in response to feedback, you might want to submit a new code review after you have addressed all of the comments.