In my role as an AccuRev Systems Engineer, I have the welcome opportunity to visit many companies looking to find a better software configuration management (SCM) tool, as well as many companies who have already achieved that goal by choosing AccuRev. I run into various degrees of sophistication, from those that were previously versioning their source by creating .bak directories to those that have embraced modern capabilities and are truly stretching their SCM environment beyond anything previously achievable.
One of the coolest examples I’ve ever seen of the latter is at Orbitz. I’m sure you’re familiar with the travel giant, and they use AccuRev to manage the source code behind their heavily visited website. Their team is full of highly skilled and intelligent people and they are definitely one of the most advanced AccuRev shops I’ve had the pleasure of working with.
While visiting them recently, I was very impressed with a component of an intranet wiki they showed me. They were actually running RSS feeds from AccuRev streams! There are a number of practical applications for this kind of functionality, but first and foremost it allows you to keep teams up to date on changes being made in the codebase. So you can subscribe to various collaboration streams in your project, as well as perhaps “watching” other streams that you might have interest in. This can also provide support for a continuous code review process. Leads on a project can easily review the code that is created during the project by watching the stream that the team is working in. By doing this review over the lifetime of the project, they can more easily give feedback earlier in the process. And since the feeds are simply aggregated as they arrive, they can decide when the best time to check out the changes are.
How is this done? Well, with AccuRev’s command-line it’s actually a lot easier than you might think. Their RSS feeds are generated from a Rails app they have written for internal use. Getting the initial feed is quite easy. The user’s feed reader hits a URL that includes the stream they are watching. This URL is parsed by Rails and sent to a Rails controller that queries for the last 20 transactions in that stream:
[snip]
Parameters: {”format”=>”atom”, “action”=>”hist”, “id”=>”orbitz-api-foo-ci”, “controller”=>”accurev”}
Accurev command (1.226238): accurev ’show’ ’streams’ ‘-fix’ ‘-s’ ‘orbitz-api-foo-ci’ ‘-fx’
Accurev command (0.592468): accurev ‘hist’ ‘-s’ ‘orbitz-api-foo-ci’ ‘-t’ ‘now.20′ ‘-fx’
Accurev command (1.195955): accurev ’show’ ’streams’ ‘-fix’ ‘-s’ ‘orbitz-api-foo-ci’ ‘-fx’
[snip]
Once that information is loaded, they render an Atom feed to summarize the transaction information. Items like transaction type, user, comments, and number of files are displayed. Additionally, building a page that summarizes the transaction lets them show file status like modified, added, or removed. A tiny bit more complicated, but again can be easily accomplished with AccuRev CLI. Here’s a snippet of that processing:
[snip]
Parameters: {”stream”=>”orbitz-api-foo-ci”, “action”=>”transaction”, “id”=>”4587″, “controller”=>”accurev”}
Accurev command (0.937849): accurev ’show’ ’streams’ ‘-fix’ ‘-s’ ‘orbitz-api-foo-ci’ ‘-fx’
Accurev command (0.356075): accurev ‘hist’ ‘-s’ ‘orbitz-api-foo-ci’ ‘-t’ ‘4587.1′ ‘-fx’
Accurev command (0.603777): accurev ‘hist’ ‘-fx’ ‘-p’ ‘orbitz-api-foo’ ‘-k’ ‘defunct’ ‘/./build.xml’ ‘/./foo.txt’ ‘-fx’
Accurev command (0.333936): accurev ‘anc’ ‘-p’ ‘orbitz-api-foo’ ‘-v’ ‘orbitz-api-foo-ci/3′ ‘-1′ ‘/./foo.txt’ ‘-fx’
Accurev command (0.357128): accurev ‘anc’ ‘-p’ ‘orbitz-api-foo’ ‘-v’ ‘orbitz-api-foo-ci/44′ ‘-1′ ‘/./build.xml’ ‘-fx’
[snip]
Finally, that summary page provides the ability to view the file contents and run diffs. Here’s a sampling of how the unified diff gets generated:
[snip]
Parameters: {”eid”=>”56″, “action”=>”view_diff”, “previous_version”=>”721/45″, “controller”=>”accurev”, “virtual_version”=>”106/44″, “path”=>”/./build.xml”, “depot”=>”orbitz-api-foo”}
Accurev command (0.309664): accurev ‘cat’ ‘-p’ ‘orbitz-api-foo’ ‘-e’ ‘56′ ‘-v’ ‘106/44′
Accurev command (0.637650): accurev ‘cat’ ‘-p’ ‘orbitz-api-foo’ ‘-e’ ‘56′ ‘-v’ ‘721/45′
[snip]
Orbitz has built in a number of other optimizations and naturally this post only reveals a glance into what they’ve accomplished. But to give you an idea of the kind of volume this can support, there are anywhere from 9,000 – 10,000 requests a day for the RSS URL during the work week! Their users have given very positive feedback regarding the usefulness of this page and more enhancements are in the works, like links in from issue tracking systems.
So the next morning you come in to work, get your coffee, and fire up your Google Reader to see what’s new in the world you care about, and think about how cool it would be to automatically be able to check on all the latest code changes from your outsourced team overseas…
I think many of the ideas posted here are great, but I can’t agree with the idea of RSS feeds “stretching their SCM environment beyond anything previously achievable”.
WebSVN (which is of course *not* to say SVN itself) has offered RSS feeds out of the box on an SVN respository, or any subtree in the repository, for a while now.
Hi Troy,
Your point about RSS feeds and WebSVN is correct and well taken. The comment about “stretching their SCM environment” wasn’t meant to be specific about the RSS example, but more a reflection of organizations that are innovative with regard to the tools they utilize. However, in conjunction with that, the inherent built-in advantages that AccuRev’s stream-based architecture provides when compared to branch-and-label systems means that this type of solution is actually *not* available with any other SCM tool…
Cheers,
~James
SVN with RSS – that’s rich! Now you can keep track in your newsreader of how many hours it took to create a branch!
John, be fair. Branching in SVN takes mere seconds! It’s not until you have to merge back that it starts taking days…
James, noted the difference between streams and branches.
What would be interesting is the possibility of AccuRev offering (customisable/configurable?) feeds like this out of the box, or through some supported add-on. That would help bring techniques like this into the mainstream, and make the overall AccuRev package more attractive.
I’m not so sure about that Troy. It depends on your organisation. While the command to create a branch may take mere seconds, I know at the company I used to work for creating a branch was a painful process that would take days because of all the red tape and process…