The Johnson Blog

Ramblings of a geek with a few hobbies…

Author: eajhnsn1

  • Automated Builds

    Several hours today were spent advancing my automated build process for Chef. I’ve had CruiseControl.NET building the software for months now but I’ve had a gaping hole in the processes that has been staring at me since I started it.
    What is this hole you ask? Version numbering.

    Why is versioning so hard in this day and age? Seriously. With .NET there are all these really nice and easy attributes that all you have to do is type in the version string you want your assembly/binaries to have. That works really well, until you want those numbers to be dynamic – then it requires modifying a sourcecode file with a new hard coded string. But what about 1.0.*? you ask, referring to the ability to have the compiler generate parts of it for you. Well, what real good is it to have version numbers that you don’t control? If they get generated by the compiler it just makes everything difficult – like translating between a version label from CruiseControl to the state of source control at the time of the build. Maybe I’m missing something here, but I don’t think I am.

    Another versioning issue is setup projects. The setup projects created in Visual Studio have a version number, product code, and upgrade code. Counter to intuition, the upgrade code is the same across versions for a given product and it’s the product code that changes between versions. Sooo, if you bump the version number you also need to create a new Product Code guid. Again, there’s no way (that I know of) to do this via command-line. Microsoft thinks you should open the setup project and bump the version number manually. They even go as far as prompting you to create the new Product Code guid when you do this. Microsoft, the creator of the great tool that is Visual Studio, make it very hard to do the Right Thing and have automated builds. Tisk, tisk.
    And finally, the version string has implications on product keys – both generation and verification. For instance, if Suzie buys Chef 1.2, I need to have a way to have that license key work for 1.2.5, 1.4, and 1.9; but not 2.1. And I need to be able to forget about the details rather than think about it every single time I create a release. (Chef Beta 2 is days away, by the way).

    My solution to these problems required a little planning, a little coding, and a lot of time waiting for test builds to be created. My process is as follows.

    • I go to the CruiseControl.NET Dashboard website and click Force to initiate the build.
    • The last successful build label is incremented (from 0.9.2.2 to 0.9.2.3, for instance).
    • The latest sourcecode is retrieved from the Perforce depot
    • The code I wrote tonight gets executed on the sourcecode tree, passing in the newly incremented build number
    • A new product code guid is generated
    • Every AssemblyInfo.cs file is edited and all AssemblyVersion attributes are changed to use the new version number
    • The specified .vdproj files (Visual Studio setup projects) are edited to modify the ProductVersion with a trimmed version of the current build version/label. The new ProductCode is also inserted
    • Visual Studio is called upon to perform the compile.
    • CruiseControl puts the generated installation packages out on the network
    • A sourcecontrol Label is created in the Perforce depot, denoting the state of the sourcecode at the time of the build.

    And that’s it. With a single click I have installation packages created with no further involvement. The files included in the package all have a version number that I can trace back to a CruiseControl label (to view build logs and in the future unit test results) and then back to a Perforce label with the same name to view the sourcecode files at were a part of the build. I’ll then also be able to compare those file versions with the recorded version numbers of bug fixes in FogBugz – something that will surely save time once Chef is in the wild.

    Microsoft, please please please make this better in the future.

  • Bug Tracking

    The development of Chef has been pretty interesting thus far. I had almost forgotten how much work is involved in getting an application shippable like this. My previous experience was with the release WakeUp! Alarm Clock, but that was as off-the-cuff as you can get: simple version control (umm, none at first then graduated to CVS); no bug tracking; no build process – builds were simply done on my development box; no unit test for regression testing (unit tests, what are those?!); and really no plan whatsoever. But I was in college and had no real experience in software, it was my first.
    In these regards, Chef is completely different. I mean completely. My development environment is quite extensive in comparison to the days of old: Perforce for source control; FogBugz for bug tracking, support, forums and a bunch of other things; an automated build system driven by CruiseControl that give me a build and install at the click of a button; full NUnit test cases for the entire Chef API; and multiple VMWare environments for testing. Future posts may include some information on some of these topics, but for now a little information about FogBugz.

    (more…)

  • Recipe Sharing and Beta 2

    Chef Beta 2 isn’t quite as far along as I’d like it to be thanks to the Holidays and work.  I’m targeting the middle of January for its release and that’s coming up fast.  A couple dozen bug fixes and features/enhancements since Beta 1 have been done though, with the major ones out of the way.

    One of these big features is Recipe Sharing, which I think will be a compelling reason to actually put recipes into the application.  It’ll be very handy to just click the mouse  a few times and be able to give recipes to fellow Chef users. And for sharing with non-Chef users, there’s always copy to clipboard.

    So those of you interested should keep an eye out in the next few weeks for the final Beta release, with 1.0 hopefully coming in another month+ after that.

  • DVD Changer

    A week ago, Jay brought up the topic of movies on demand in his house. He was starting to look hard at going the DVD-to-hard drive route, when he ran across this awesome Media Center setup from Sony. That’d be a fantastic solution if I were willing to pay that much for it. Unfortunately I’m not.

    Int he past I’ve made several attempts at having a computer in our living room hooked up to our tv. At one point we had been using MythTV for a year or more. It was a bit clunky but worked. But then we got an HD tv and started renting a dual tuner HD DVR from our cable company and disbanded the Myth box. Several months after that, my parents gave me their unused Tivo so I setup Galleon to allow us to play our MP3 collection with it. I think we’ve used it once. And now that my PC is in the next room with a decent set of speakers, I see us using it even less than once in the future. Shrug, I’ve tried.

    But now the thought of on-demand movies… We have a lot of DVDs but hardly ever watch them because we’re…ahem.. too lazy to get them off the shelf I suppose. Instead, we often find ourselves watching the same movies we own on TV – with the commercials and crappy picture. On-demand would be very helpful. However, I don’t like the idea of (these overlap, don’t complain) 1) building a computer to drive it, 2) paying for the computer to drive it, 3) have the annoyance of MythTV or the cost of Media Center. In short, I don’t want a computer in my living room running it all. I’ve tried it and I find it just too annoying.
    So today I think we solved it by purchasing Sony’s 400 Disc DVD Changer. It took a while to get configured with all of our movies, but it’s now up and running. All 200+ of our DVDs are now just moments away for a lot less money, time, and annoyance than a PC.

  • Back to work

    Tomorrow I head back to work after the nice little Holiday break.  On short notice I decided to take today off and play with my new toys rather than try to concentrate at work.  For the remainder of the week I’m planning on leaving work an hour or two early each day instead of just taking the entire day off.  Ana, on the other hand, has to burn some vacation time so she’s home all week.

    I received some great gifts this year.  Among them are: a dvd burner; a gamepad for my pc; a couple of software-related books; and a pair of Garrison Keillor CD Sets.  I hope everyone we gave gifts to enjoy theirs as much as we’ve enjoyed ours!

  • Visual Studio 2005 sp1

    I just kicked off the installer and was notified that the process could take several minutes to several hours!   Greeaaat, nothing like having a potentially unusable machine for a couple of hours.

  • Home Office

    Over Thanksgiving weekend we rearranged things at home a little bit.  We have a formal dining room that has been sitting without furniture since we moved in, with no plans of filling it any time soon.  So we decided to start getting use out of the area for something other than junk.

    We moved Ana’s Piano from the living room (the front living area in the house) into the dining room and then moved the office from upstairs down to the living room. I always disliked having to go all the way upstairs to sit at my desktop and work – it just felt so isolated.

    So now I am sitting in our front room while Ana is in the family room watching tv, and I can watch it too.  And we can still hold a conversation, unlike when I was secluded upstairs.  All-in-all I really like it, I’ve gotten lots more done since I’ve been down here.  The only downside so far is that I’m sitting right next to a window, one that’s a little chilly when it’s less than 10 degrees outside 🙂

  • Common Thread Among Geeks

    I love office supplies.  There, I said it out in the open.  I don’t know what it is about them, but I could spend hours (and have come close before) in office supply stores.  There’s something good about knowing that I’ll have paper, pens, binders, notebooks, etc. on hand at home whenever the need arises – which is just never anywhere near enough to use the surplus I have amassed.  It’s hard to walk around stores and not spend a disproportionate amount of time in the office isles.  I just plain enjoy it. Is that weird?

    I don’t think so.  I have noticed over the past several years that there’s a very close relationship between one’s geek self and the love of office supplies.  I can’t think of any of my friends who don’t have this affinity.  Maybe it’s just coincidence; maybe it’s some other personality trait linked with office supplies. I’m pretty sure it’s geekiness.

    I’ll ponder that as I continue to print and hole-punch and bind my way to organization…

  • The Leg Move

    Ladies and gentlemen… Justin Long’s patented Leg Move.

    Edit: Don’t know what happened to the link, but here’s the real link.

  • Perforce

    A while back I discussed needing to look into a new source control solution for Chef.  To recap, CVS had just gotten on my nerves for a few things: file deletion and moving; pretty crappy windows client support (gui); clunky (to me) branch management; and poor infrastructure on my network.  I just don’t feel comfortable using it on Chef going forward.

    Some of my requirements for the replacement system:  stable; reliable; simple backup/restores; good Windows GUI tools for management; inexpensive (read Free); intuitive; good documentation; preferrably a Windows server (to simplify my backups).   The two forerunners were a coworker’s recommended, SourceGear Vault, and Perforce.  Vault was built as a Visual Source Safe replacement and is free for a single user.  Perforce, I learned, is a very popular and robust scm server that is free for 2 users or 5 workstations.  After comparing the two for a while I settled on Perforce mostly because it met all of my requirements, and did so in a very elegant and polished fashion.  Documentation has been spot-on and things work as advertised.  I was able to import Chef, get it backed up and configure Visual Studio’s Source Control integration all in a span of a couple hours.  Pretty impressive. Thank you Perforce for the free license.