Recently, a respected member of the .NET community asked for some “gotchas” when using SourceSafe with CruiseControl.NET. At first, I was thinking, “There really aren’t any. It is working fine for us” however when thinking back on the setup of the current infrastructure I recall there was some tweaking necessary to get things rolling.
DISCLAIMER: I would like to preface any content of this article by saying that I am by no means a VSS fan. It is free, it is just good enough, and it is already in place. I already know what tool I want to switch to when the time is right, but for today I work in a VSS shop.
So, if you are going to setup CCNet with SourceSafe, here are some things to keep in mind. With respect to things to stay away from, I experienced some issues when I tried to monitor a large number of projects. You also may experience VSS timeouts if the project folder you point to has too many subfolders/files. In some cases, the VSS history command to see if anything had changed since the last build took longer than the preset timeout (I believe it is 30 seconds)!!! So it would help to be selective in the points you monitor within VSS. If you keep your solutions/projects to smaller, more manageable sets of code you’ll probably be more successful.
One thing you could try is to time the history commands from a command line. When using VSS, CCNet essentially issues a command like the following:
SS.EXE history $/Devl/Products/XYZ/Common/2.0/Batch -R -Vd12/5/2007;5:01a~12/4/2007;1:11p -YBuildUser, -I-Y
By executing this manually you can get a feel for how long it will take to execute the command. The CCNet logs will show if you experienced a timeout:
2007-12-05 05:04:20,165 [Accounting Batch 2.0:WARN] Process timed out: C:\Program Files\Microsoft Visual SourceSafe\SS.EXE history $/Devl/Products/XYZ/Common/2.0/Batch -R -Vd12/5/2007;5:01a~12/4/2007;1:11p -YBuildUser, -I-Y. Process id: 3928. This process will now be killed. 2007-12-05 05:04:22,994 [Accounting Batch 2.0:WARN] The process has been killed: 3928 2007-12-05 05:04:23,040 [Accounting Batch 2.0:ERROR] Exception: Source control operation has timed out.
Despite some pain getting the right level of monitoring, it is now a useful tool. I would definitely encourage use of the CCTray app for all developers. This seems to be the easiest way to communicate a breakage. You can also use the web dashboard to show the history of what has happened: