Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2012 - How can I tell if a changeset was code-reviewed?

Tags:

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?

like image 599
Travis Avatar asked Dec 31 '12 16:12

Travis


People also ask

How do I view changeset details in TFS?

Find a changeset by IDIn Source Control Explorer, press Ctrl + G. The Go to Changeset dialog box appears. Type the number of the changeset and choose OK. If you don't know the number, choose Find.

How do I check my TFS history?

Right-Click If you have the Source Control Explorer or File List open, right-click the file you want to view and select Source Control > View History. Local Toolbar In the File List, select the file(s) you want to view. In the local toolbar of the File List, click , then select View History .


2 Answers

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.

like image 88
pmb Avatar answered Nov 22 '22 07:11

pmb


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.

like image 34
Naim Raja Díaz Avatar answered Nov 22 '22 07:11

Naim Raja Díaz