§ November 27, 2008 18:01 by
beefarino |
We've been using CruiseControl.NET at my shop for a few years. One of the things I've never really enjoyed about the CC.NET dashboard is the lack of a recent build history for the entire build farm. When someone reports an issue with a build, I have use the CC.NET dashboard to drill through every VM in the farm until I figure out which server built the revision I'm looking for. It's a waste of time. Moreover, the default farm view is really really boring - don't get me wrong, it's vital to communicate the current state of the builds, but I want more. I want to be able to show my boss how much work is being done, how much coordination is taking place on the team, and how badly we need another VM host in the farm.
So I spent a little spare time on a pet project: a CC.NET dashboard plugin that visualizes the build farm activity using the SIMILE Timeline project. Before I dig into the grit, take a quick look at this sample timeline; it's a snapshot of about 4 hours of activity from one of our build VMs:
The plugin only took an hour or so to pull together; of course, that was after an evening of digging through the CC.NET source code to figure out NVelocity and the Objection IoC container voodoo. The project is still very raw - there is a lot of missing error checking and no unit tests. I'm offering up the source code for download anyway in order to get some feedback: ccnet.timeline.plugin.zip (6.69 kb)
Of course, it comes as-is with no commitment of support or fitness of purpose, etc. There are no special build requirements, outside of VS 2005 or later and the CC.NET source code.
Installation
To install the plugin:
- copy ccnet.timeline.plugin.dll from the project output folder into the CC.NET dashboard bin directory;
- copy the timeline.vm template from the project template directory into the CC.NET dashboard template directory;
Configure the Dashboard
To configure the dashboard:
- modify the list of of HttpHandlers in the CC.NET dashboard web.config to include the timeline.aspx handler shown below; make sure it appears first in the list:
<httpHandlers> <add verb="*" path="timeline.aspx" type="ccnet.timeline.plugin.TimelineHttpHandler,ccnet.timeline.plugin"/> <add verb="*" path="*.aspx" type="ThoughtWorks.CruiseControl.WebDashboard.MVC.ASPNET.HttpHandler,ThoughtWorks.CruiseControl.WebDashboard"/> <add verb="*" path="*.xml" type="ThoughtWorks.CruiseControl.WebDashboard.MVC.ASPNET.HttpHandler,ThoughtWorks.CruiseControl.WebDashboard"/> </httpHandlers>
- add the farmTimelinePlugin element to the list of farm plugins in the dashboard.config file:
<farmPlugins> <farmReportFarmPlugin /> <farmTimelinePlugin /> <cctrayDownloadPlugin /> </farmPlugins>
This will result in a "Timeline" link in the farm view of the CC.NET dashboard that will present the farm timeline.
Configure the Projects
The timeline is driven by data from the statistics publisher, so any project you want to include on the timeline will need to publish statistics. To enable this, just add a <statistics/> element to the project's list of publisher tasks, taking care that it follows all file merge tasks:
<publishers>
<merge>
<files>
<file>c:\program files\cruisecontrol.net\server\build-server.xml</file>
<file>tests\nunit-*-results.xml</file>
<file>tests\coverage-*-results.xml</file>
</files>
</merge>
<xmllogger />
<statistics />
...
More Features
This initial spike is very promising. Here are a couple of ideas I have to make the timeline better:
- the timeline uses color to indicate build success or failure, but it would be nice to propogate any build errors into the event on the timeline, so you could see the error by clicking on the event.
- operationalizing the event generation configuration - as it works now, there is no customization points, so what you see it what you get.
- create timeline server and project plugins.
- create a timeline view of a build report: e.g., display individual build tasks, tests, etc.
- the ability to mark public releases ( or any non-CC.NET event ) on the timeline. This would help demonstrate the "mad dash" effect an approaching release date has on our team.
- display source control activity.
- parameterizing the timeline view - maybe controlling the projects displayed, hilighing certain projects, or adjusting the units in the timeline band to compact or expand the display.
As the project matures and stabilizes, I'll post updates. If there is enough interest, I'll start looking into making a full contribution to the CC.NET project. Let me know if you find this useful, and if you have any ideas for improvements.