As
Tony Bunce can vouch, source control is something that is a bit of a nemisis for me. When I first started working in .Net (and programming in general) a few years ago, the whole concept of source control was completely new to me. Having a background in systems administration, the concepts behind centralized storage wasn't new - but check-in/check-out was among many other features the different providers off. At the office we recently migrated (for better/worse) to
Microsoft's Team Foundation Server. Prior to that, I had been using (despite what Tony might say..)
SourceGear's
Vault product. While it didn't integrate with Visual Studio (I think it did but at the time Visual Studio 2003 was *terrible* with source control so we managed things ourselves), it was very robust and feature-friendly. Team System seems to want to be that way, but isn't quite there yet. But that particular discussion is for another blog entry - this one is meant for the reasons behind source control in hopes of saving someone from pulling the same stunt I did.
Our largest client (multi-billion dollar international company) has a very interesting network. For security reasons I can't go into specifics here, but basically when we VPN in (they won't let us do
IPSec) we lose
all access to our local network. Despite the fact that my connection is routed through our local router, I can't even ping it's local IP address. An interesting side note is they've also managed to block us from our web-based email as well, despite numerous attempts on my part to subvert this little inconvenience, but that's neither here or there. Since I can't even ping my default gateway, talking to our source control system is impossible. So what we end up having to do is connect to the VPN, open Visual Studio and tell it to work temporarily unbound. Then, assuming we don't need to debug anything we'll make our changes, upload the new content, and disconnect from the VPN. At that point we can then close down Visual Studio (checking source control seems to be an instance thing by the way, not a "you opened a new project, can I talk to it's source control provider" thing), then re-open it, check all the files out and then check them back in thus saving our new changes. Now, if we had to debug that's a whole different story. For whatever reason debugging isn't possible locally - it flat doesn't work. So we have to upload the
entire solution to one of their servers running Visual Studio, debug everything via RDP and when completed grab a copy of everything (thus overwriting the local copy onto our system) and do the whole disconnect/check-out/check-in dance again. That's just frustrating when you're working on a cable connection that has 512kb max upload speeds and the solution is 50MB in size. Not only all of that, but this particular client has a number of "network issues." Their network constantly goes down or has stability issues and more than once I've been routed through a connection to Brazil just to get in. So now I'm not only hampered by 512kb up, but I have to send the friggin thing to Brazil before it comes back up to Canda and their main offices. Either I've lost it, or that's just dumb. If you're a multi-billion dollar company, get a solid Internet connection. Seriously. That, or get people who know what they are doing (we are in a bid for this contract..).
Anyways, that was slightly off topic, but not too much. This past weekend we were scheduled to launch a major revision to one of their internal websites which we developed from scratch. The new version had an all new CSS design (this was a lesson in pain - I hate IE6 a lot), and an overall streamlined look/feel to it. And of course the new
Microsoft AJAX libraries. The launch was scheduled for 1PM Sunday afternoon (they don't process this system over the weekend so a night deployment wasn't required). Early Friday morning my boss comes in to ask me how everything was progressing with testing for the launch. This is where things went down-hill. Fast. A couple of weeks back he had asked me to do some minor updates to this version (just little visual tweaks - hardly any code involved). Since it had been 2+ months since we had even talked about the project (the client was having internal conflicts with the deployment), I did the obvious thing and inside Visual Studio selected the option to Get Latest Version from source control. I knew he had been doing some changes to the underlying layers (part of the reason I had to do changes now) so it was just easier to get everything. Oops. Apparently, the last time I did the little source control dance described above, I hadn't checked in my latest revisions. There were a lot of those. And selecing Get Latest Version did exactly what it was supposed to do - it got the latest version from source control. Since I hadn't checked everything in the last time, it
overwrote almost everything. When I did this about 2 1/2 weeks ago, I realized the error and cancelled the process. I used Vista's new
Shadow Copies option and restored a couple of files not realizing the true impact I had had on the system. So Friday morning I go to run some tests and I get the wonderful
Yellow Screen of Death that any ASP.NET developer is probably overly familiar with. Unless of course you're a programming god like
Hanselman,
Guthrie,
Haack, or
Mitchell. Since I'm not, I am used to seeing them. While going through the site though, I noticed a lot of the pages had a number of old items tied to them whether it be the extremely old MasterPage we used, or the regular tabstrip control (I replaced this with a JavaScript one), etc. After about an hour of trying to figure out what could've happened it suddenly hit me.
Not-so-long story short,
always check your files in when using source control. And if you're not using source control right now, change that. There is a great free version out called
Subversion. While it's not nearly as powerful as the aforementioned SourceGear Vault product, it's got a number of good features and a lot of community support. The stuff I did caused the delaying of this deployment for a week, an overnight stay at the office (finally left at 4:45AM when I hit an Oracle error), and (in my opinion) made me look bad in front of my employers since I've only been there for six months. Luckily I was told that something like this just makes me part of the group as everyone has had something like this happen before. That made me feel a little better, but still..
If you get tied up with a company that makes you VPN, won't let you talk to your home network, and makes you debug on a server, fight the policy as much as possible. It's the most annoying thing to deal with. Period.