Setting up ContinuousBuilder with SVN

Posted by admin, Mon Mar 13 10:39:04 UTC 2006

Ok, that was really annoying. Setting up a new build server just should not take as long as this did.

What is ContinuousBuilder you ask? Good question. If I had not bought the beta-book Rails Recipes, I would never have heard of it. A Google search on the topic brings up… yup, you guessed it, the source code for ContinuousBuilder, and nothing else. ContinuousBuilder is a plugin for Rails, that is a very (very) simple continuous integration implementation. You can install it in your Rails app by using:
ruby script/plugin install continuous_builder
If you read the accompanying README.txt, you’ll know about as much as I did when I started. On to the meaty stuff. Couple of things about ContinuousBuilder and Subversion you should know before you start…
  • ContinuousBuilder will not send email to you on success. So when everything is working, you get no feedback. And when it is really, really broken, you get… no feedback. This is not good, especially when you are setting up ContinuousBuilder for the first time. And, with a small team, I prefer to get emails for every commit, just so I know the build really is working. The answer was simple. First, in test_build.rake, I added a deliver_success call: [code lang=”ruby”] case build.run when :failed ContinuousBuilder::Notifier.deliver_failure(build, notice_options) when :revived ContinuousBuilder::Notifier.deliver_revival(build, notice_options) when :broken ContinuousBuilder::Notifier.deliver_broken(build, notice_options) when :unchanged, :succesful # Smile, be happy, it’s all good ContinuousBuilder::Notifier.deliver_success(build, notice_options) end [/code] Then, in the continuous_builder.rb file, under Notifier, I added a success method [code lang=”ruby”] def success(build, options, sent_at = Time.now) @subject = “[#{options[:application_name]}] Build working (##{build.checkout.current_revision})” @body = [ build.checkout.last_commit_message, build.output ].join(“nn”) @recipients, @from, @sent_on = options[:recipients], options[:sender], sent_at end [/code]

    Now I get messages for every commit, good or bad.

  • In Subversion, when your post-commit hook is not working, you get ZERO feedback for what is wrong. This is can be quite a time waster. But I finally found this nugget in the Subversion FAQ, that helps solve that problem:
    subversion: Subversion FAQ
    Why aren’t my repository hooks working?They’re supposed to invoke external programs, but the invocations never seem to happen.

    Before Subversion calls a hook script, it removes all variables - including $PATH on Unix, and PATH on Windows - from the environment. Therefore, your script can only run another program if you spell out that program’s absolute name.

    Debugging tips:

    If you’re using Linux or Unix, try running the script “by hand”, by following these steps:

    1. Use “su”, “sudo”, or something similar, to become the user who normally would run the script. This might be httpd or www-data, for example, if you’re using Apache; it might be a user like svn if you’re running svnserve and a special Subversion user exists. This will make clear any permissions problems that the script might have. 2. Invoke the script with an empty environment by using the the “env” program. Here’s an example for the post-commit hook:

    $ env – ./post-commit /var/lib/svn-repos 1234

    Note the first argument to “env” is a dash; that’s what ensures the environment is empty. 3. Check your console for errors.
In my case, step #2 was very informative, and I discovered that I needed some Oracle environment to be set up (ORACLE_HOME, LD_LIBRARY_PATH) because our build server is mimicking our test and production servers which use Oracle.

I hope that more people discover and use this very simple continuous integration plugin. It looks promising, but it needs a little more polish.

1 comment | Filed Under: | Tags:

Mac OS X - front and center on Microsoft Download Center

Posted by admin, Thu Mar 09 02:30:21 UTC 2006

I was just a little surprised when I hit this page on the Microsoft Download Center. Check out the order in which the “Supported Operating Systems” are listed.


Somehow, I doubt that Microsoft intended to give Mac OS X top billing, but they did :-)

Download details: Get a look at Origami

Supported Operating Systems: Apple Mac OS X; Longhorn (Windows Code Name) ; Macintosh; TabletPC; Windows 2000; Windows 2000 Advanced Server; Windows 2000 Professional Edition ; Windows 2000 Server; Windows 2000 Service Pack 2; Windows 2000 Service Pack 3; Windows 2000 Service Pack 4; Windows 98; Windows 98 Second Edition; Windows CE .NET; Windows ME; Windows Mobile 2003 software for Pocket PCs; Windows Mobile 2003 software for Smartphone ; Windows NT; Windows Server 2003; Windows Server 2003 Service Pack 1; Windows Server 2003×64 editions; Windows Server 2003, Standard Edition (32-bit x86); Windows Server 2003, Standard x64 Edition; Windows Server 2003, Web Edition; Windows Small Business Server 2003 ; Windows Vista; Windows XP; Windows XP 64-bit; Windows XP for Itanium-based Systems Version 2003; Windows XP Home Edition ; Windows XP Media Center Edition; Windows XP Professional 64-Bit Edition (Itanium) ; Windows XP Professional 64-Bit Edition (Itanium) 2003; Windows XP Professional Edition ; Windows XP Professional x64 Edition ; Windows XP Service Pack 1; Windows XP Service Pack 2; Windows XP Starter Edition; Windows XP Tablet PC Edition


Given the number of times I’ve hit the download center to see stuff, only to be turned back by the fact that MOV files, WMA files and simple Powerpoint files are packaged up as Windows executables for download… I have to say I like this page. Now, just keep up this trend Microsoft!

0 comments | Filed Under: | Tags:

TextMate has built in Subversion? Really?

Posted by admin, Thu Mar 02 08:56:01 UTC 2006

Sometimes, it’s the little things that trip you up. I’m using my new CoreDuo iMac, and some of the tools I use on my Powerbook are not available on the Intel machine. No problem, I’m flexible.

So… SCPlugin for Finder – not working. Look for alternate Subversion GUI… eventually concedeĀ  that TextMate is cheap and has support built in, so I break down and buy it (finally) and … hmmm.

Why are all the Subversion menu items disabled. Puzzle. Puzzle. (think Grinch here, people). Read the manual. Nothing. Read the FAQ. Nothing. Google search the mailing lists. Nothing. Puzzle. Puzzle.

Ok. Bright idea time. Maybe TextMate HAS Subversion support, but it isn’t installed by default. Read up on bundles in the manual. Figure out how to download the Subversion bundle. Do it. Restart TextMate. Works!

Why was this so hard? Because everything I read stated that TextMate had “built-in” Subversion support. It just did not occur to me that meant – “built-in-but-you-have-to-download-and-install-it-separately”. Maybe stuff like this should be up front in the manual?!

0 comments | Filed Under: | Tags:

ar_fixtures - great stuff, when it works

Posted by admin, Thu Mar 02 07:20:39 UTC 2006



Dump or Slurp YAML Reference Data (and Fixtures) | Ruby on Rails for Newbies

Dump or Slurp YAML Reference Data (and Fixtures)


And one more problem with ar_fixtures. We were using it to dump data out of an Oracle test database, to transfer to MySQL. Two of the columns failed to “dump” properly. A column defined in Oracle as “NUMBER” failed to export. As did another column defined as “NUMBER”. Instead of the numeric data expected, we got a bunch of : !ruby/object{}

1 comment | Filed Under: | Tags:

Importing Legacy Data ... Just for the fun of it

Posted by admin, Thu Mar 02 02:18:18 UTC 2006

java.net: Agile Legacies: Using Iterative Methods to Import Legacy Data

Indeed, importing legacy data is a crucial part of most software projects. It is also a task that rarely evokes a great deal of enthusiasm among developers. And yet it is of vital importance for the end user. These old databases often contain years of valuable business records that the user needs to access from the new application.
This is an interesting article. Since I’ve been working with Ruby for the past few months, I was reading this through my Ruby glasses ;-) and decided it was interesting to note that although Ruby on Rails developers tend to be focused on new development with new databases, there are built-in features of Rails that are particularly well suited to solving the problem of importing legacy data. ActiveRecord makes referencing existing data seem like a walk in the park. And the Migrations stuff is really tailor-made for the task of massaging databases and their contents into new forms.

The great part about this is that you can use Ruby to do it, because it’s usually a “one-shot” sort of task, and the code will not be an integral part of the production system, so who cares what language you use to accomplish this goal? So, if you are a Java programmer, and you’d like to take Ruby out for a spin in a “real world” kind of way, think of using it for your next legacy data migration task. Who knows? You might even have fun doing it…

0 comments | Filed Under: | Tags:

Using the Virtual Earth v2 control in Firefox

Posted by admin, Fri Feb 24 10:27:13 UTC 2006

So, you’ve started using the Virtual Earth v2 control, and discovered… it doesn’t quite work right in Firefox, does it? Of course, this blog from last week notes that you need a “wedge” in order to make it work right… but it’s not official.

Virtual Earth

As many of you have pointed out to me, the v2 control does not support firefox as well as the Windows Live Local site does. There is actually a wedge you can put in place to fix most of these issues, but it is not officially part of the SDK today.


I find it vaguely amusing that I did a “view page source” on local.live.com the same week it was released (back in DECEMBER), and found the “wedge”, and have been using it ever since… I guess three months isn’t too far behind… (sigh).

But you know what? Firefox still didn’t work right for my map. I was following this example:

Via Virtual Earth
Creating Your First Virtual Earth v2 Page (Part 1)


And I discovered that it worked ok in IE, but in Firefox the map spread out all over the page, instead of staying inside its nicely size-limited div. This was a big problem for me. All of my page header graphics disappear under the map, and all my navigation links were practically invisible (on an aerial map).

But yesterday, I discovered this example.

Virtual Earth: Tutorial Part 1 – AJAX and Virtual Earth
Tutorial Part 1 – AJAX and Virtual Earth


And wouldn’t you know…? It looked just fine in Firefox. Grrr.

So I pulled out “view page source” again, and eventually discovered the difference. I say eventually because I couldn’t believe it the first couple of tries (that can’t be it!). Anyway, if you have the uncontained Virtual Earth map problem in Firefox, all you need to do is add “position:relative” to the style attribute of the containing div, and you are good to go.

Too bad it still doesn’t work in Safari, though :-(

5 comments | Filed Under: | Tags:

Ogg vorbis for iTunes

Posted by admin, Fri Feb 17 02:59:32 UTC 2006

Well… YAY! When I first made the move to Mac, it was pre-Tiger, and I found an Ogg Vorbis plugin that let me play my Ogg files in iTunes. Then there was the move to Tiger and an upgrade (to QuickTime, I think) rendered the plugin unusable/unstable. I watched for months for an update, and then I gave up. My husband even started the loooong, boring chore of re-ripping our CD’s using iTunes.

Today, someone on a mailing list was talking about Ogg files and iTunes, and I thought… that can’t be right. But I did a quick Google, and discovered this:

Xiph.Org: QuickTime Components

Xiph QuickTime Components (XiphQT) is, in short, the solution for Mac and Windows users who want to use Xiph formats in any QuickTime-based application, e.g. playing Ogg Vorbis in iTunes.
Works like I charm. I just did a “File | Add to Library” in iTunes, and pointed at one of my Ogg albums, and it copied the files, and imported most of the metadata, too. No album art, and no track numbers, but I’m not going to complain.

1 comment | Filed Under: | Tags:

Zillow - Canadians need not apply

Posted by admin, Tue Feb 14 02:04:23 UTC 2006

I was reading a lot about Zillow this week, so I figured I should check it out. And when I entered “Calgary, AB” into the front page form…

Zillow.com – Your Edge in Real Estate

We could not find this area. Please check your spelling or enter a valid ZIP code.

I guess it’s just too hard for them to include Canada…

0 comments | Filed Under: | Tags:

don't use :conditions with auto_complete_for

Posted by admin, Mon Feb 13 08:14:15 UTC 2006

Despite what the documentation might lead you to believe…


By default, auto_complete_for limits the results to 10 entries, and sorts by the given field.

auto_complete_for takes a third parameter, an options hash to the find method used to search for the records:


do not attempt to look up the “options” hash from the find method and expect all the options to work as advertised.  Especially do not use the :conditions option.  If you do, your auto-complete will be silently but completely broken.

We discovered this in a pair-programming session this morning.  Over the past week, my partner and I had individually attempted to customize a particular auto-complete_for in order to limit the returned values to a specific subset. To give you a simple “fer-instance”, lets talk about 2 tables, people and houses.  Houses belong to people.  But not all people have houses.  We needed an auto-complete on people that would limit the values returned to people who own houses.

Once again, the ability to look at the source (thanks RDoc) came to the rescue.  We eventually figured out that using :conditions would override the auto_complete_for :conditions.  So we just created our own customized auto_complete_for method for this case.

If anyone has a better solution, I’d be happy to learn about it.

0 comments | Filed Under: | Tags: