TFS 2012 – How to tell if a changeset was code-reviewed

tfsvisual studio 2012

We recently started using Team Foundation Server 2012 and are using the code-review feature to have other developers review code changes. It seems to work great; however, as a project lead I would like to be able to see that a given changeset has been reviewed by someone else.

For example, say Developer Bob makes changes and requests a review on those changes. This generates a shelveset for the changes and creates a code-review work item for the requested review. Developer Alice reviews the changes, makes some comments, and finishes the review. Bob incorporates Alice's suggestions and checks in the changeset.

As a project lead, I search for changesets and see that Bob checked in changeset 123. If I look at this changeset, there is an associated work item for the task Bob was working on, but no indication that the changeset was reviewed by anyone else.

If I look at code-review work items, I can find the things that have been reviewed and see the comments. This is cumbersome as I have to sift through work items and find the one that happens to be related.

How can I tell from a given changeset that it was reviewed, as well as see the review comments?

Best Answer

Changesets can be linked to any kind of Work Item, including Code Reviews. When you request a review on a set of pending changes, they are automatically associated to the new review Work Item. When you double click on the changeset you should be able to see under Related Work Items something like this:

Code review linked to changeset (sorry for the ugly screenshot)

In this case there were 2 reviews for this changeset, the second one was automatically there when it was requested. The first one had to be manually linked, just like the Task.

If you double click on the review item, you can see all the comments.

Tip: If you want to do a review post-checkin: go to the History view --> double click on the changeset --> Actions --> Request Review.

Tip2: It is a bit annoying that you have to manually check that each changeset has a review. If lack of review is really a problem for your team, I would suggest setting up a check-in policy.

Related Topic