Today I was logged in remotely to my office workstation, integrating MSBuild, AspNetCompiler and nAnt. We have to transition from 1.1 to 2.0 and integrate with our current build system - a nAnt-centric, custom vss integrated copilation framework. I was pleased that nAnt was so well written as to be able to seamlessly orchestrate the 2.0 MSBuild details.
After authoring a few nAnt scripts and getting a few succesful builds, I was completing the details of copying the results from the source directory /bin/Release to the deploymnet directory so the existing build framework would find and check them in. I'm using .84 of nAnt so the functions and conditionals I needed weren't yet supported. Rather then upgrade, I tried to use a property to delete the bin directory. When the property was an empty string, I expected no deletion to occur and a message to write stating directory not specified. Rather then that, it took a little longer then expected to return, then finished without error.
Five minutes later a folder I'd been working in disappeared. I thought, "hmm, that's strange." Then a dialog popped from visual studio stating that something couldn't be loaded. Then, Windows file protection warned that files had been changed. Everything went to crap. I quickly killed every process I could and then rebooted. The machine did not return.
I arrived at work to find "NTLDR is missing"... ARGH!
Further inpection revealed that most of my c: drive was GONE!
I have been a huge fan of nAnt since I first started using it several years ago. This is the first time anything really bad happened as a result of any software I was using (unless you count that day I tried to download the hi res smut player... ). There is no one to sue, no one to blame, no one to hold accountable. That is why open source software carries a high risk and some companies restrict its use. It is a good lesson to me. I need to be more diligent about using backed up directories on the network share. Fortunately, all my work is in source control. I can recreate the myriad of diagrams and presentations that were lost. It also taught me how tranient the output of developers really is. I lost a lot of bits off that computer today. Yet, I only really lost a little valuable, but recoverable, time. The rest is in my head. So, every time some talented developer walks out the door, we lose most of what they contributed to the company. I wish there were a way to express that and convince management of that fact. I don't care how much documentation we do, if the developer who came up with it was talented, capable and productive, we watched our most valuable company assets stroll on down the road.
...I am not sure what was expected to be in place to prevent this from happening but there is a property (nant.project.basedir) that should have been set. It apparently weren't... ;>(
public string GetFullPath(string path) {
if (StringUtils.IsNullOrEmpty(path)) {
return BaseDirectory;
}
...
RecursiveDeleteDirectory(dirPath);
I would have words with that developer if I knew their name...