Custom Code Review Checkin Policy

ALM
59431
ALM

Over the last couple of months, I’ve been doing a lot of VS / TFS 2012 demos, as well as installing / configuring / customizing TFS at customers. Everyone loves the Code Review Workflow, but inevitably the question gets asked, “Can I enforce code review on check-in”? Out of the box you can’t, but I created a custom policy for this.

You can get the policy from the VS Gallery.

Note: this policy only works with “out of the box” Code Review Request and Response work item types in TFS 2012 and for VS 2012.

You can also configure how “strict” the review policy should be:

  • The policy will fail if the Code Review Request is not Closed
  • The policy will fail if any response result is 'Needs Work'
  • The policy will pass if all response results are 'Looks Good' or
    • the policy will pass if all response results are 'Looks Good' or 'With Comments'

If the policy fails, you’ll get a friendly message reminding you to get a review!

image

Happy reviewing!