How do I view comments from an earlier code review in Team Foundation Service?
Asked Answered
R

3

26

I'm using Microsoft's online Team Foundation Service with Visual Studio 2012 Premium.

I performed a code review for a colleague a couple of months ago, and now another code review has come through for the same project.

I want to be able to view the comments I made on the first code review to make sure everything has actioned. However, I can't find anywhere in Visual Studio or TFS that shows me the previous code review's comments.

Resilience answered 22/4, 2013 at 12:2 Comment(0)
R
28

OK, I've found my answer by trial and error:

  1. In Visual Studio 2012 open the Team Explorer
  2. Under Work Items, click "New Query"
  3. Run a query to find the relevant code review item
  4. In the query results, double click the code review work item
  5. Click "Open Code Review in Team Explorer (top left)
  6. The code review will open in the Team Explorer panel
Resilience answered 22/4, 2013 at 13:6 Comment(4)
Thank you! I was looking for this for quite a while. You would think that where it says, "... added a comment" in the history, it would perhaps make sense to provide a link to the comment.Whitewall
In VS 2017, I had to go into Tools -> Options -> Work Items and change "Open work items in" to Visual Studio instead of the default browser to see the link in Step 5. Otherwise, it opens the work item in my browser (where there is no such link to "Open Code Review in Team Explorer")Abundance
In VS2019 you need this already for step 2 to see New Query in Team Explorer > Work Items.Jimjams
@Whitewall I'm betting you already knew (and realize it's seven years later), but it appears there's an "Open Code Review in Team Explorer" link at the top of the display that will show the comments. Tedious and bad UI, yes, but at least they're still there, somewhere...Strephonn
R
7

If you do not perform many code reviews, this may also be easier: In Team Explorer, under My Work, there is a Code Reviews section near the bottom. A subtle drop down menu can let you pick other choices, such as:

  • My Code Reviews
  • Incoming Requests
  • Recently Finished
  • Recently Closed

If you select "Recently Finished", you should be able to view your completed code reviews and pick the one you want from there.

Roman answered 14/6, 2013 at 21:16 Comment(3)
However, the "Recently Closed" option will only show you code reviews up to a certain date in the past. I'm not sure how far exactly, for me it seems to be about a month. So if you are looking for anything from a year back or something you are likely not going to find it this way.Shenashenan
@Shenashenan - That's true. This is intended as a quick short cut. I had written "If you do not perform many code reviews", thinking back then it would only show up to a certain number of reviews at once and overwritte them with newer reviews eventually. Your suggestion that it is based on a timeline is probably more accurate.Roman
To add to @mattherman's comment, it also doesn't show me, at least, CRs abandoned by others. Maybe that's neither finished nor closed, but I do need to see them at times. Simon's answer includes these.Strephonn
I
3

In Visual Studio 2017 the link Open Code Review in Team Explorer might not appear. To display the link on code review work items go to the following starting from the main menu:

Tools -> Options -> Work Items

Change Open work items in: from Default browser to Visual Studio.

Now you can execute queries on work items of type Microsoft.CodeReviewResponseCategory or Microsoft.CodeReviewRequestCategory and the link should appear in the top left corner of the work item.


Thank you user735232 for your comment, I added this as answer to make the solution more visible.

Intransigeance answered 20/6, 2018 at 21:23 Comment(1)
FYI: There's a comment under this setting indicating --- Note: The work item form in Visual Studio (compatibility mode) will be deprecated in the next major version of Visual StudioDeluxe

© 2022 - 2024 — McMap. All rights reserved.