Automated Coder

Exploring the Code of CruiseControl.Net

Posts Tagged ‘CC.Net Community’

CruiseControl.Net and .NET

Posted by Craig Sutherland on 6 March, 2009

As many people are aware, CruiseControl.Net is written in C# 2.0, and the primary development environment is Visual Studio 2005 (and those tools that can handle VS2005).

Last year, Microsoft finally released their next version of Visual Studio – Visual Studio 2008. This now allows targeting multiple different frameworks within one IDE. The targeted frameworks are: .NET 2.0, .NET 3.0 and .NET 3.5. And while they are on a roll, they are planning on releasing Visual Studio 2010 next year, along with .NET 4.0.

However, Microsoft have broken backwards compatability – you cannot open a VS2008 solution in VS2005 (you can do the opposite, but it converts it to VS2008 format!) Based on their track record I wouldn’t be surprised if they do the same with VS2010.

This raises the question of what IDE should be the primary development environment for CruiseControl.Net?

With VS2005, we stay as we are now – no changes, no problems.

With VS2008, we need to convert the solution, plus make sure the build process still works. However CruiseControl.Net will still target .NET 2.0 (until Mono handles .NET 3.0 and 3.5), although we could start adding optional assemblies that use .NET 3.0/3.5 functionality.

With VS2010, we’d have to wait and see what it is like, and then see the rate of adoption (especially among the developers). But we’d still continue to target .NET 2.0.

What do you think we should do?

I will leave this poll open for a couple of weeks, and then post the results. Please let us know what you think.

Posted in CruiseControl.Net | Tagged: | 5 Comments »

The New Improved Validator

Posted by Craig Sutherland on 3 February, 2009

Some History

A little while back I wrote a post on the problems I was having getting the XML formatted nicely (read it here). The main problem was the code formatter I was using was slow :(

Despite my attempts I was unable to get any decent speed improvements, so I ended up moving it to a background worker. Now it was still slow, but it didn’t impact the user.

Moving Forward

One of the readers of my blog saw my post and suggested Scintilla.Net as an alternate. So I downloaded it and tried to use it, but without any success :-( I hate to say it but the documentation on this control is very poor, so I ended up giving up.

Thankfully Patrick didn’t, and he was able to provide an example of how it should work. From here I was able to see my mistake (needed to turn the IsReadOnly off before setting the text) and now it works beautifully!

This is the new improved CCValidator:

CCValidator-1

CCValidator-2

Notice the loading time – only 2.28s (this previously was over a minute!) Also the display includes the expandable sections for the XML – making it much easier for browsing.

Many thanks to Patrick for not only suggesting this control, but helping me to get it working.

Posted in CruiseControl.Net, Tools | Tagged: | Leave a Comment »

Public Service Announcement

Posted by Craig Sutherland on 28 January, 2009

Do You Want to Modify CruiseControl.Net?

One of the things about CruiseControl.Net being open source is that things only change if people give of their time to make changes. Currently there’s about four or five of us who make changes to the code (at least based on the check-ins), so sometimes things just don’t happen (or things that people would like don’t happen).

Now there are a number of reasons why people don’t contribute code, but one of them is the complexity of the project (it has grown organically over the past few years). To try and overcome this issue Ruben has started posting a series of tutorials on coding for CruiseControl.Net. You can read these articles on his blog (http://rubenwillems.blogspot.com/).

Additionally if there are other things we could do to make it easier to contribute, please let me know :)

Posted in CruiseControl.Net | Tagged: , | Leave a Comment »

Big Visible Cruise II (BVC2)

Posted by Craig Sutherland on 21 January, 2009

Improving BVC

There is not one, but two versions of Big Visible Cruise! Originally I had posted on BVC, and after showing my manager at work, got approval to get a new monitor and box so we can run it.

Now I’ve learnt about a second initiative called Big Visible Cruise II (http://www.codeplex.com/BigVisibleCruise). This is a continuation/branch of the original, and has a few enhancements to make it nicer.

For those of you who haven’t seen BVC/BVC2, here is what is looks like:

BVC2

There is a full screen version, which works really well on a large monitor. If you don’t like the stacked approach, it’s also possible to have all the items laid out in a grid:

BVC2-Grid

Supposedly it also shows the build breaker – but as you see from the screenshots this doesn’t appear to be working. I’m not sure whether this has been turned off by default – and I can’t find anyway of turning it on.

Installing and configuring it is very easy. To install it you need to copy the binaries to a folder somewhere (there’s no installer, but one is not really necessary). To configure it just click on the settings link and the following dialog is displayed:

BVC-Settings

Here you just set the URL to watch (only HTTP is allowed) and then it’s ready to go. You can change a few other settings, but it’s still very simple and easy to use.

All in all, I like this project (both versions). It’s simple and easy to use, and it does it’s job very nicely. Good going guys!!!

Posted in CruiseControl.Net | Tagged: | 3 Comments »

Ruben Willems Blog

Posted by Craig Sutherland on 21 January, 2009

For those who don’t know him, Ruben is one of the developers on the CruiseControl.Net project. He’s also the guy who answers a lot of the support e-mails!

Ruben has recently started a blog on Continuous Integration, so if you are interested in finding out more about what is happening with CruiseControl.Net check it out – http://rubenwillems.blogspot.com/.

Posted in CruiseControl.Net | Tagged: | Leave a Comment »

Another CI-related Blog

Posted by Craig Sutherland on 10 January, 2009

Introducing Steve Trefethen

Steve is another blogger who sometimes writes on CI (and CC.Net). He’s written an excellent source of articles on extending CC.Net to do “Continuous Invoicing” – via using tasks and a custom source control provider. Nice work!

It’s a good example of working within the constraints of CC.Net – whereas most of my work involves modifying CC.Net itself.

His blog can be found at http://www.stevetrefethen.com/. He also writes about a lot of other stuff, but I’ve only browsed some it of so far.

Posted in CruiseControl.Net | Tagged: | Leave a Comment »

Big Visible Cruise (BVC)

Posted by Craig Sutherland on 9 January, 2009

Another CruiseControl Front-end

I was talking with one of the other devs on CruiseControl.Net and he pointed me in the direction of http://code.google.com/p/bigvisiblecruise/. This is a WPF front-end that displays the current build status of all projects on a server – and it does it using a really simple approach that makes it easy to see at a glance what is happening.

Now, I haven’t tried it yet (struggling with the installer at the moment), but I’ll give it a try at work sometime.

Stay tuned…

Posted in CruiseControl.Net | Tagged: , | 2 Comments »

Building a Better Validator

Posted by Craig Sutherland on 8 January, 2009

But My Configuration is Broken!

One of the common issues we see on the mailing lists is people having problems with their configuration. Normally it’s sometime along the lines of “Hi, I’m getting this error when the app starts, can you help?”. They also normally include the error message (when they are being helpful) and sometimes their config (when they are being extra helpful). But while we don’t mind being helpful, it can be frustrating to see similar errors occurring over and over.

Now, yes, I know the configuration for CruiseControl.Net can be very painful at times (I have spent many hours trying to work out why my config is breaking at times), but it is this way to allow maximum flexibility. There there is a configuration tool available (another source project – you can find it here), but sometimes this can be out-of-date (especially when we have just added new functionality).

So, I thought it would be nice to build a validator that goes through and validates the entire config file at once. There is a validate option on the console version, but this is text-based and stops at the first error found. In contrast I’m going to make this tool a bit friendly, plus hit the entire configuration.

And on a final intentions note, I’m going to use the current libraries as much as possible. This means when we change something in the configuration we don’t have to modify the validator as well (as much as possible).

The Design

First off, this will be a Windows application. While I could make it a web application, it would be harder, less user-friendly and need to be hosted somewhere (if the config is invalid, then the server won’t start and thus we can’t use the dashboard).

This will be a separate stand-alone application that will operate in the same directory as the server. Being in the same folder means it will pick up the same assemblies (including plug-ins) as the server – again with the idea of reducing the amount of work I have to do :)

This will be very simple – a single window application. When the user starts it will display a blank window with a menu bar and status bar. In the menus will be an “Open” option which will prompt the user for the file. When the user selects a file it will open, load and validate the file. The results will then be displayed in the window (using the WebBrowser control).

The actual validation will be done using the classes from the Core project. However, instead of throwing exceptions, it will display error details and move onto the next configuration item.

The Implementation

Starting the project was nice and easy, I just started a new C# Windows Application project and modified the main form to include my menu bar, status bar and web browser. I added a menu option for “Open” and added the code behind to display a dialog box prompting the user to select a file.

When the user selects a file, it first attempts to load it into an XmlDocument. If there are any errors it will display them in the browser. Otherwise it will check for the root element, and then validate each separate element under the root.

This is basically a duplication of the functionality in NetReflectorConfigurationReader (from Core). I couldn’t use NetReflectorConfigurationReader as it stops on the first error (by throwing an exception), so I did a cut and paste job instead. This means changes to NetReflectorConfigurationReader also need to be made in the validator, but this file doesn’t change too often.

To display the results I use a combination of an embedded HTML template in the project and manipulating the DOM. The HTML template provides the basic layout (including the styles), while the DOM manipulation gives me the dynamic results.

With this in place, I now have a very basic validator:

Validator1

I also added a bit of eye-candy around the loading process (i.e. status messages and a progress bar). And with that a simple validator is now ready.

But, I wanted to make it more user-friendly…

Adding Eye-Candy

The first thing to add was the ability to reload files. This will just reload the currently selected file.

Next I added the ability to print the results, so the user can get a hard-copy (if desired).

Finally I added a history of the files opened. This now gives me the following menu options:

image

Additionally, I didn’t like jumping back and forward between the configuration and the results, so I added a read-only display of the configuration (plus allowed the user to select their view):

Validator3

Finally I added some persistence to the application. It will persist the location of the application, plus which display settings were chosen.

Another Small Tool Completed

This completes another tool to help with using CruiseControl.Net. I know it’s not perfect, but it is better than the current version. At the moment, the main issue is sometimes messages from NetReflector are not very helpful – but there is not much I can do about this currently.

If I have more time I will look at adding some additional functionality in future (e.g. context-links, in-line editing for the config, etc.)

The binaries for this tool are at http://sites.google.com/site/automatedcoder/Home/CCValidator.zip. I can also apply to have this tool added to the trunk if it is liked (and so will be included in the main install for CruiseControl.Net.)

Posted in CruiseControl.Net, Tools | Tagged: , | 3 Comments »

CruiseControl.Net Blogs

Posted by Craig Sutherland on 31 October, 2008

Since I’ve been involved in development for CruiseControl.Net I’ve spent a lot of time writing in this blog about what I’m doing and why. For me I have two reasons for doing this:

  • As a journal on what I’m doing so I can go back and understand why I did something a certain way.
  • So other people can learn about what I’m doing and (hopefully) provide feedback.

At the same time I enjoy looking to see what else is happening, both in CruiseControl.Net and in development in general. As such I read a number of different blogs, mainly with the aim of learning how to be a better developer.

So, other than me, who else is writing about CruiseControl.Net. Here are the blogs that I know of that sometimes include blogs on CruiseControl.Net:

Some post more actively on CruiseControl.Net than others, and most are about using CruiseControl.Net (I haven’t been able to find anyone else who is writing about developing for CruiseControl.Net).

And of course, another great area for information on what’s happening with the project is the mailing lists.

PS. I’m still on holiday, I’m just on my way back. When I get back on Sunday I’ll start writing up some of what I’ve been doing in CruiseControl.Net while I’ve been on holiday.

Posted in CruiseControl.Net | Tagged: | Leave a Comment »

CruiseControl.Net Goodies

Posted by Craig Sutherland on 2 September, 2008

Who Likes Configuring CC.Net?

Most of us at one time or another have have problems with configuring CruiseControl.Net. The server configuration is based on an XML config file, and get get rather verbose at times! Now while ThoughtWorks does provide pretty good documentation on the process (read it here), I still have problems at times.

On a recent post to the CC.Net user mailing group somebody asked if there was an up-to-date XML schema that we could use with intellisense in Visual Studio. He even mentioned a location of a schema – the only problem was on investigation that was the schema for CruiseControl – not CruiseControl.Net. So I went looking. I did find a schema in the code – but it doesn’t look very complete. Then, I found a nice little tool – CCNetConfig.

CCNetConfig is a graphical editor for CruiseControl.Net config files. Now I’m not sure who the main developer for it is (his user name is camalot), but it is another open source project – this time hosted at CodePlex. The project itself is hosted at CodePlex – http://www.codeplex.com/ccnetconfig.From the looks of things it is still be worked on – another not much work appears to be happening at the moment.

I haven’t played with it yet, but from the screenshots it looks nice! I’m downloading the latest build now and I’ll try and put it through it’s paces.

Community Plugins

A related find is also CC.Net Community Plugins – another open source project hosted at CodePlex (http://www.codeplex.com/ccnetplugins). These are various plug-ins that different people have written to work with CruiseControl.Net. They list the following plug-ins:# Labellers

  • LastChangeVersionLabeller
  • TfsWorkItemPublisher
  • CodePlexReleasePublisher
  • RssBuildsPublisher
  • MetaWeblogPublisher
  • TwitterPublisher
  • PowncePublisher
  • FtpSourceControl
  • MbUnitTask
  • XUnitTask
  • NCoverTask
  • BuildPublisherCleanupTask
  • FxCopTask
  • MsTestTask

Plus this is an interesting component called The Macro Engine which looks like it can dynamically modify parts of the configuration on the fly.

Again, I haven’t played with any of these, but they might come in useful later on

Posted in CruiseControl.Net | Tagged: , | 1 Comment »