Click here to Skip to main content
15,868,014 members
Articles / DevOps / TFS
Tip/Trick

Code Review for Visual Studio 2012 Professional with TFS 2012

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
24 Sep 2013CPOL4 min read 86.6K   425   13   22
VS 2012 Professional or lower versions do not have the Code Review module. To achieve this, I came up with a solution which will add a new work item type in TFS 2012. We will also learn how to create a new work item type in TFS.

Code Review for VS 2012 professional

Introduction

VS 2012 Professional or lower version does not have a Code Review module. To achieve this, I came up with a solution which will add a new work item type in TFS 2012, i.e., Code Review, and help us to add a code review work item in TFS as given in the above image. We can also learn how to create a new work item type in TFS.

Background

In VS 2012 Premium and Ultimate, we have a module for Code Review in which the developer will request another user to review code and in the response, the other user will give us suggestions. For more details, please visit Jeff Fattic blogs.

Also in VS 2010 with TFS 2010 there was no concept of code review. But CodePlex members came up with a solution called TeamReview - TFS Code Review. But there is nothing for VS 2012 with TFS 2012. Even in the discussion thread, there is no solution for VS 2012. For more details, please visit TeamReview - TFS Code Review and you can download the setup from TeamReview Download.

Steps

In Team Explorer (VS 2012 Professional), My Work pane is not available for requesting a code review.

compare professional and premium

Even in the default setup of TFS 2012 web portal and VS 2012 Professional Team Explorer, there is no work item for code review.

no work item for code review

Steps to create a Code Review work item type for VS 2012 Professional and TFS 2012

Open VS 2012 Professional, go to Tools -> Process Editor -> Work Item Types -> Export WIT.

Image 4

If you are not connected to the TFS server, it will pop up a window to select the project collection.

Image 5

After selecting the project collection name, it will display the list of projects.

Image 6

Select the Bug work item, click OK, and it will pop up the Save As dialog box. Save the WIT XML file as Code Review.xml in any folder.

Image 7

This will display a popup to export Global List Definition, click No. Then it will display a successfully exported message box.

Open the Code Review.xml file in the Visual Studio 2012. It will display the screen given below:

Image 8

Click New and add two new fields.

To add new fields, please check the screen given below:

Image 9

The field details are given below:

    1. Code Review Suggestion
    • Name: Code Review Suggestion
    • Type: HTML
    • Reference Name: CodeReview.Suggestion
    2. Code Review Reviewed By
    • Name: Code Review Reviewed By
    • Type: string
    • Reference Name: CodeReview.ReviewedBy
    • Reportable: Dimension
    • Go to Rules tab -> click New -> Select following rule types
      • ALLOWEXISTINGVALUE
      • VALIDUSER
      • REQUIRED

Go to the Layout tab, rename label "Steps to Reproduce" to "Description", and delete the System Info and Test Cases tab pages.

Image 10

Go to Control under Description tab page -> select the Control node, change the Field Name property to System.Description. Right click on the tab group of the Description tab page and click New Tab Page, set the Label property to Suggestion. Right click on the Suggestion tab page and click New Control, set the Field Name property to CodeReview.Suggestion.

Click on the Preview Form button to see the Preview layout.

Image 11

Repeat the same step for adding the Reviewed By field under the Status tab.

Go to the Workflow tab -> right click on Transition Item -> click on Open Details -> popup will open -> go to Reason tab -> add or delete additional Reasons -> OK. Check the complete workflow and save the file.

Image 12

Once the changes in the template are complete, then we have to import the template in TFS. Go to Tools -> Process Editor -> Work Item Types -> Import WIT. In the popup, select the TFS project name to import the Work Item Type and in the browse field, select the template file, i.e., CodeReview.xml.

Image 13

Once the import is complete, the pop will be closed. Go to Team Explorer -> click Work Item -> click New Work Item. There you will see the Code Revieww menu. Even in the Web Portal you can see the Code Review menu.

Image 14

After performing the above step, we have to perform one more step. I.e., we have to create a work item query to view the code review. Go to TFS Web portal -> Work -> Work Item -> right click Shared Queries -> New Query -> set the name as My Code Review. Go to Editor, set the values as in the image given below:

Image 15

The layout in the web portal TFS 2012:

Image 16

Points of Interest

If the Process Editor menu is not available then you have to install Microsoft Visual Studio Team Foundation Server 2012 Update 1 Power Tools.

While importing the work item type, if you get an error message similar to the one given in the below image then you have to delete that Field from the Fields tab and then Import it. Do the needful changes and upload it again.

Image 17

If you are using Team Foundation Service then while doing the above step you will receive the below error message

TF237113:  You don't have enough permissions to complete the import operation.

For current release of Team Foundation Service (http://tfs.visualstudio.com/en-us/), edit process template is not supported. 

History  

  • 27 Feb 2013: Initial post.  
  • 26 Sep 2013: Updated Points of Interest (Edit process template is not supported in Team Foundation Service)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions

 
AnswerNew Code Review tool Pin
Devart Software22-Oct-15 2:45
Devart Software22-Oct-15 2:45 
QuestionPlease vote to make feature for Pro Pin
Dzmitry Lahoda10-Dec-14 0:09
Dzmitry Lahoda10-Dec-14 0:09 
Questionwhy I cant see "process editor" in VS 2012 Professional Pin
henry hanqing26-Oct-14 16:59
henry hanqing26-Oct-14 16:59 
AnswerRe: why I cant see "process editor" in VS 2012 Professional Pin
2irfanshaikh26-Oct-14 18:22
professional2irfanshaikh26-Oct-14 18:22 
GeneralRe: why I cant see "process editor" in VS 2012 Professional Pin
henry hanqing26-Oct-14 19:18
henry hanqing26-Oct-14 19:18 
GeneralRe: why I cant see "process editor" in VS 2012 Professional Pin
2irfanshaikh27-Oct-14 23:22
professional2irfanshaikh27-Oct-14 23:22 
NewsWPF version being worked on Pin
HM India22-Jun-14 3:27
professionalHM India22-Jun-14 3:27 
GeneralRe: WPF version being worked on Pin
2irfanshaikh28-Jun-14 5:08
professional2irfanshaikh28-Jun-14 5:08 
QuestionRemove work item type Pin
Sadie Cook9-Dec-13 8:01
Sadie Cook9-Dec-13 8:01 
AnswerRe: Remove work item type Pin
2irfanshaikh9-Dec-13 18:49
professional2irfanshaikh9-Dec-13 18:49 
GeneralRe: Remove work item type Pin
Sadie Cook10-Dec-13 9:17
Sadie Cook10-Dec-13 9:17 
QuestionThis does not seem to work Pin
FMC_RicardoFarinha16-Sep-13 0:52
FMC_RicardoFarinha16-Sep-13 0:52 
AnswerRe: This does not seem to work Pin
2irfanshaikh16-Sep-13 8:47
professional2irfanshaikh16-Sep-13 8:47 
GeneralRe: This does not seem to work Pin
FMC_RicardoFarinha16-Sep-13 8:49
FMC_RicardoFarinha16-Sep-13 8:49 
GeneralRe: This does not seem to work Pin
2irfanshaikh16-Sep-13 8:59
professional2irfanshaikh16-Sep-13 8:59 
GeneralRe: This does not seem to work Pin
Member 138203339-May-18 23:35
Member 138203339-May-18 23:35 
QuestionNice article Pin
vinod deo from navi mumbai18-Mar-13 2:26
vinod deo from navi mumbai18-Mar-13 2:26 
AnswerRe: Nice article Pin
2irfanshaikh27-Oct-14 23:23
professional2irfanshaikh27-Oct-14 23:23 
GeneralNice Article! Pin
avdhoota1231-Mar-13 2:11
avdhoota1231-Mar-13 2:11 
GeneralRe: Nice Article! Pin
2irfanshaikh27-Oct-14 23:23
professional2irfanshaikh27-Oct-14 23:23 
QuestionNice and Descriptive. Pin
Anil Pandey28-Feb-13 1:02
Anil Pandey28-Feb-13 1:02 
AnswerRe: Nice and Descriptive. Pin
2irfanshaikh28-Feb-13 23:24
professional2irfanshaikh28-Feb-13 23:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.