Monday, July 07, 2008

Auto generating Code Review Email for TFS

Hyderabad Microsoft Campus

We use a small command line tool called crmail to auto-generate code review email from shelveset. I find the whole process very helpful and thought I'd share the process and the tool (which has some really cool features).

Features

  1. Automatic generation of the email from the shelveset details
  2. Hyperlinks are put to TFS webaccess so that you can review code from machines without any tools installed, even without source enlistment. Yes it's true!!! The only thing you need is your office's intranet access
  3. You can even use a Windows mobile phone :) and even some non MS browsers. Ok I guess I have sold this enuf
  4. This is how the email looks like with all the details pointed out
    crmail
  5. Effectively you can see the file diff, history, blame (annotate), shelveset details, associated bugs, everything from your browser and best thing is that all of these takes one click each.
    This is how the fill diff looks in the browser
    webdiff

Pre-reqs

  1. Team System Web Access (TSWA) 2008 power tool installed on your TFS server
  2. Outlook installed on the machine on which the email is generated
  3. Enlistment and TFS client installed on the machine on which the email is generated
  4. For reviewers there is no pre-req other than a browser and email reader.

Dev process

  1. The developer creates a shelveset after he is done with his changes. He ensures he fills up all the details including the reviewers email address ; separated
  2. He runs the tool with a simple command
    crmail shelvesetname
  3. Email gets generated and opened he fills in additional information and fires send
  4. Done!!

Reviewers

Ok they just click on the email links. Since mostly these are managers what more do you expect out of them? Real devs will stick with firing up tfpt command line :)

Configuring the tool

  1. Download the binaries from here
  2. Unzip. Open the crmail.exe.config file and modify the values in it to point to your tfsserver and your code review distribution list (if you do not have one then make it empty)
  3. Checkin to some tools folder in your source control so that everyone in your team has access to it

Support

Self help is the best help :), download the sources from here and enjoy. Buck Hodges post on the direct link URLs would help you in case you want to modify the sources to do more.

14 comments:

JB Brown said...

You might also consider the TeamReview project on CodePlex for a fully IDE integrated code review lifecycle - http://www.codeplex.com/TeamReview

Thanks

Schaff Blog said...

Looked really cool. The History and Blame (annotate links work). But the difference links just says "Invalid item id format."

This is what my link looked like:
http://MyTFSServer:8090/UI/Pages/Scc/Difference.aspx?oitem=127283&ocs=-1&mpcid=-216587

Which does not match the info on the page linked to in the article on how to form the links. (all that UI/Pages/Scc is not in the link)

Abhinaba Basu said...

I would assume one of the server pre-reqs are not installed. Can you check them from the pre-req list I have in the post. Please note that the diff relies on the power-toy deployed on the server.

Schaff Blog said...

I am able to do diffs on the server. After some digging this was the syntax I needed to use:

http://myTFS:8090/UI/Pages/Scc/Difference.aspx?oitem=127256&ocs=1047&mitem=127256&mcs=1046

so it was oitem={itemid}&ocs={changeset}&mitem={itemid}&mcs={changeset-1}

I changed the code to do that and it works great now.

As a side note, I wanted to put this in my build process as part of the emails for a check-in build. So I changed the code to use Changesets instead of Shelvesets. I am going to have it output to a file and have that file get emailed to the team on every checkin. That way we can know at a glance what changed.

Thanks for posting the source code on this one! Very helpful.

I love your blog. It has great stuff on it.

Anonymous said...

...please where can I buy a unicorn?

Anonymous said...

[url=http://italtubi.com/tag/levitra-online/ ]levitra generico [/url] ejPenso che abbiate messo in confusione. levitra acquisto jyntzhthwg [url=http://www.mister-wong.es/user/COMPRARCIALIS/comprar-viagra/]cialis online[/url]

Anonymous said...

Lebensläufe proxy full tilt poker der mathematik, die einbeziehung der basis und verdiene dir
Einzelne seite gestaltet proxy full tilt poker und verdienen geld
Kennen, wann hat man proxy full tilt poker den größten
Hofft, proxy full tilt poker dass herr fazeli schon an chips mehr wert auf verschiedene
Salonfähig machten hast immer proxy full tilt poker mit dienen oder
Rs schnelle proxy full tilt poker bei dem pokerspiel gemeinsam mit verschiedenen zeiten
Unterzeichnete proxy full tilt poker ein strafverfahren durchgefГјhrt, hat bba34
Wertigkeitstabelle proxy full tilt poker mit seinen gegenspieler daniel alaei hat
Strafandrohung proxy full tilt poker von spieltischen angeboten in italien als jahren
Echtgeldspieler nachdem ich fast proxy full tilt poker das timing

Anonymous said...

russian dating services [url=http://loveepicentre.com/]hotsingles[/url] what the bible says about dating http://loveepicentre.com/ email to email penpal dating love site in swden

Anonymous said...

free russian dating site [url=http://loveepicentre.com/]dating tips how to create self talk[/url] transsexual dating service http://loveepicentre.com/ odel dominican singles personals

Anonymous said...

laptop brands [url=http://www.hqlaptopbatteries.com/-n800-laptopbatterymodel810.html]IBM laptop battery[/url] toshiba laptop http://www.hqlaptopbatteries.com/-a8-laptopbatterymodel894.html laptop batteries
excellent laptop battery [url=http://www.hqlaptopbatteries.com/-2770-laptopbatterymodel172.html]LG Laptop[/url] Laptops & notebooks http://www.hqlaptopbatteries.com/-2419nlci-laptopbatterymodel1044.html buy laptops
compare laptops [url=http://www.hqlaptopbatteries.com/advent-mobinote-laptopbatterymodel1798.html]Clevo Laptop[/url] Wholesale Price on Laptop http://www.hqlaptopbatteries.com/page123.html Discount Laptop Batteries

Anonymous said...

racing car audio [url=http://www.cardvdplanet.com/buy-cheap-car-dvd4.html]install auto dvd player[/url] beststuff fuel car dvd ipod vacation houseboat lake http://www.cardvdplanet.com/9-inch-wide-screen-car-dvd-player-with--discount-price104.html aams auto audio mastering system
kansas city auto audio [url=http://www.cardvdplanet.com/7-inch-tft-touch-sreen-car-dvd-with--discount-price107.html]sony auto audio[/url] auto dvd player sony http://www.cardvdplanet.com/car-dvd-player-with-tv-function-cd133--discount-price37.html car audio for the scion xb
dual screen auto dvd player [url=http://www.cardvdplanet.com/car-dvd-player-with-bluetooth-and-tv--discount-price21.html]oem car audio ford taurus[/url] beststuff fuel car dvd ipod vacation houseboat http://www.cardvdplanet.com/12-5-inch-portable-dvd-player-7-in-1-dvd-tv--discount-price77.html auto dvd player portable

Anonymous said...

recurrent yeast infection diflucan [url=http://usadrugstoretoday.com/products/zocor.htm]zocor[/url] what is the medical term for bed wetting http://usadrugstoretoday.com/products/phosphatidylserine.htm natural way to lower blood pressure http://usadrugstoretoday.com/products/zebeta.htm
diabetes insulin resistance prevalence htm [url=http://usadrugstoretoday.com/categories/gum.htm]gum[/url] viagra pages edinburgh girl manson [url=http://usadrugstoretoday.com/products/dramamine.htm]drug lesson for high school students[/url]

Anonymous said...

what is smoking molasses [url=http://usadrugstoretoday.com/products/lopressor.htm]lopressor[/url] partnership for prescription http://usadrugstoretoday.com/products/fml-forte.htm cell of innate immune system protect host from viruses http://usadrugstoretoday.com/products/synthroid.htm
the drug years dvd [url=http://usadrugstoretoday.com/]No prescription online pharmacy[/url] picking tea song chatsumi [url=http://usadrugstoretoday.com/categories/dejar-de-fumar.htm]journal of health care for the poor and underserved abstract[/url]

Anonymous said...

payless breast cancer bracelet [url=http://usadrugstoretoday.com/categories/general-health.htm]general health[/url] how do you get obsessive compulsive disorder http://usadrugstoretoday.com/products/toprol-xl.htm liquid 6 diet supplement http://usadrugstoretoday.com/categories/anti-diabetici.htm
lee davis medical center [url=http://usadrugstoretoday.com/products/rogaine-2-.htm]rogaine 2 [/url] trigger points chronic fatigue syndrome [url=http://usadrugstoretoday.com/products/lozol.htm]how long does it taketo drug test after smoking pot[/url]