I might have mentioned, or I might have not, that we have recently started to use BuildMaster as a continuous integration tool. Before continuing, let me make myself clear and say that besides being a satisfied customer of BuildMaster, I have nothing to do with the product itself. Now, with that out of the way, if you do not automate your builds yet, I deeply recommend using BuildMaster, which is also free to use (albeit with some limitations).

Anyway, back to my story. As mentioned, we are using BuildMaster for currently eight .NET applications that need to be deployed each in its own special way. And with BuildMaster it works like a charm. However, integrated Subversion Create Tag action was too general for our needs and purposes. Hence, it was time to create our own BuildMaster Extension.

First implementation

There are two tutorials at inedo.com web site (look in BuildMaster SDK section) that got me well on the way. Seeing as I was planning to extend subversion behavior, I decided to first create a simple Action with desired functionality as a CommandLineAction and then complicate form there. And the simple sample looked exactly as something I would need. So I did that and it did not work. Obviously. I decided it would not hurt to log something, but for the life of me could not figure out how. Thankfully, support chat pointed me to a solution and made debugging easy. So in about 10th attempt, I finally made it work as planned.

There were couple of things that bothered me with my implementation.

  1. I wanted a user to pick a Subversion Provider from a list.
  2. When using my custom action, you had to enter subversion username and password. Not only did that mean that password will be visible in plain text, but also it bugged me as I already had Subversion Provider defined and it would be swell to use that data instead of entering authorization in each and every action I used.
  3. My custom action demanded a source and target paths which now had to be entered by hand (and not picked out of repository as it is with Subversion extension).
  4. My custom action fields were non-mandatory, which could lead to confusion, if someone who didn’t know how things work, would use it.

And thanks to Inedo support, again, I managed to wheel in…

Second implementation

What good people at Inedo support did was send me source of their own Subversion and Source control extensions, so that I could see how they implemented similar features. Kudos to them, as it helped me a great deal. So this is what I had to do:

  1. To enable selection of version control provider, my action had to inherit from ProviderBasedAction<SourceControlProviderBase> class. Doing that automatically presented user with provider choice when creating a step with my custom action.
  2. To disable username and password inputs and make path inputs a source control folder picker, I had to create a new Editor class which inherits from ActionEditorBase. In this new class I defined field groups and set which fields are visible, their type and marked them as mandatory. Then all I had to do is tell my Action class to use this Editor class as an editor by applying CustomEditor attribute to it.

I tested it, fixed several bugs and implemented it into BuildMaster.

I own ;). But more importantly, I have logged this down for the next time I will have to implement an extension.