In our peer code review tool, Code Collaborator, our support for the native version control system (VCS) in IBM’s Rational Team Concert was initially pretty minimal: using our Eclipse plug-in you can right-click a change set, choose the Add to Review context menu entry, and then Code Collaborator would add the content of that change set to a code review.
That’s useful in some contexts, but we can do better. Rational Team Concert provides much more than version control; of particular interest is its configurable work flow feature. As the status of a work item changes, the Rational Team Concert server can provide notifications to third-party code.
Ah… now that sounds interesting.
Will has created a plug-in for Code Collaborator that runs on a Rational Team Concert server. You can configure your work flow so that when the state of a work item changes, the plug-in gets invoked. The plug-in will create a review over in Code Collaborator, using the information from the work item.
What Does the Plug-in Do?
The plug-in creates a code review in Code Collaborator that corresponds to a work item in Rational Team Concert. It uses the work item number and summary as the title of the code review. At present, it also inserts the URL of the work item in the code review title, but we’ll probably change that. If the userid for the owner of the work item is found in Code Collaborator, then that user will be set as the review author.
Likewise, the Rational Team Concert users who are listed as “approvers” in the work item are automatically added as reviewers in the code review. Finally, any change sets from Rational Team Concert’s VCS that are associated with the work item are added to the code review.
The end result is an entry in the “Links” tab of the work item:
The really slick part, though, is that if you are using our new Eclipse plug-in, you can double-click that entry in the work item’s Links display and the code review opens up right there in Eclipse.
One final note: you can configure the plug-in so that subsequent changes to the work item cause updates to the code review over in Code Collaborator. For example, if additional change sets are added to the work item, then those change sets will be added to the existing code review for that work item.
How Do I Install It?
The first step is to download the plug-in’s .zip file from our web site. Then unzip as described in the documentation, being certain to use the directory name ccollab-update-site. Note also that the documentation requires you to copy the file com.smartbear.ccollab-profile.ini into your RTC server installation.
Finally, from within the Rational Team Concert server administration user interface, request a Server Reset. This is necessary because otherwise the server will not “recognize” that a new plug-in has been added. And remember, all you did was request a Server Reset – it won’t actually happen until the next time you start the Rational Team Concert server.
How Do I Configure It?
This is a two step process. From the perspective of the Code Collaborator server,
the Rational Team Concert server plug-in is just another client application. So you’ll need to specify which Code Collaborator server it should attach to along with user name, password, etc. Instructions are here.
After you get that setup, the bigger question is: when in the work flow do you want the plug-in to get invoked? There is an example in the documentation, but the exact requirements for your environment may vary.
In my own demo installation, I have added an action to Rational Team Concert’s Task work flow: Code Review. I also added a state called Ready for Review (Click for full-size image) :
Over in the process customization for my team, I added follow-up actions to invoke the plug-in (lines 8 and 15):
1 <?xml version="1.0" encoding="UTF-8"?>
2 <team-customization xmlns="http://com.ibm.team.process">
6 <role id="default">
7 <operation id="com.ibm.team.workitem.operation.workItemSave">
9 <followup-action description="Upload Change Sets on Work Item Save" id="com.smartbear.collaborator.rtc.process.UploadToCollab" name="Upload Changes from Work Item">
10 <StateChangedTo value="Ready for Review"/>
14 <operation id="com.ibm.team.scm.server.modifyChangeset">
16 <followup-action description="Update Reviews for each linked Work Item" id="com.smartbear.collaborator.rtc.process.ChangeSetModified" name="Update Reviews for each linked Work Item"/>
Selecting the Code Review action for a work item sets the state of that work item to Ready for Review. The plug-in will only create a review if any specified filters evaluate to true – the filter I specified (line 10) is looking for a work item state of “Ready for Review.” The other type of filtering currently supported is on the type of the work item, so you could for example limit the creation of code reviews to just work items that are defects. We’ll probably add more filters in the future.
Create some code reviews… Please! :-) This functionality is very new – we need feedback to help us learn which specific use cases Rational Team Concert users want supported. Please leave a comment on this blog entry, put in an entry on our feedback forum, or send us an email: support at smartbear dot com.