20
votes

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?

3

3 Answers

2
votes

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.

1
votes

You can make queries searching for code review work items and you will find associated changesets on the field Associated Context (Changeset id or Shelveset Name)

Inside the Code Review, you can check the changeset via the link at the top of the work item view.

Of course, there is another option that is querying directly to TFS Database (Warehouse) but it's tricky and requires access to that database and knowledge on the schema.

0
votes

from work item history u can check out all the change sets ....changeset was reviewed by anyone else this functionality TFS does Not provide! may be i have lost Something but i don't see any answer regarding to change set that is was reviewed. but you can check the change through (history , and sort the source control by date ). good luck!