Using Visual Studio Code Review
I have recently started using the Code Review functionality provided by Visual Studio.
The code review function is built into the TFVC (Team Foundation Version Control) source control plugin, so it will not be available when working with git source control. When using git, it is better to use a pull request.
To request a code review, you must first have pending changes in your work space. Navigate to the pending changes dialog. The “Request Review” option can be found in the actions drop down menu next to the shelve and check in buttons. See image below.
This is great for when you simply want to have a reviewer the current set of pending changes, but what do you do if you want to review multiple changesets at the same time?
How to handle review of multiple changesets at once
I frequently work on feature branches that may have many changesets. I only want these changes to be reviewed when the feature is nearing completion. Usually the code is ready to be reviewed, but the feature branch is not ready to be merged back into the source branch.
One solution to this issue is to stage a merge back to the source branch in the local environment. This will make available all the difference between the 2 branches available for a single code review. The disadvantage of this however, is the need to undo the pending changes if you are not ready to actually do the merge, you were only doing the merge to see the changes and initiate the code review.
When a code review is requested, Visual Studio saves the changeset as a shelveset. This is useful because it allows developers to continue working on the code without interfering with the code under review.