Monday, 7 April 2008

2.0 update or not 2.0 update: Is Rails 2.0 ready yet?

I had a play with converting one of my smaller playthings... er projects over to Rails 2.0 the other day. So far I see no convincing reason to convert yet. There were some small improvements, but I came across a couple of glaring bugs that make rake test incredibly painful to use.

When I find the specific ticket-numbers again I'll include them here, but to briefly describe the issue: The bug caused the setup method not to be called (ever) in unit tests. This meant that tests didn't get their fixtures fresh after every test. The several attempts to fix this issue somehow interfered with another bug that caused the controller not to be loaded in the functional tests.

Both of these situations are so impossible to work with that I'd recommend steering clear of Rails 2.0 for a short while.

I can see it being worthwhile using Rails 2.0 for new/greenfields projects - and putting up with the bugs until the Rails Core Team figure out how to fix them. But I would seriously recommend against it for any pre-existing project - especially one that is currently in a commercial/production environment. The pain of having to convert a complete test-suite over to work around the bugs (or to convert it all over to RSpec) isn't worth the effort just yet.

Conclusion: Yes, but not yet.

2 comments:

DHH said...

Talk about throwing the baby out with the bath water. Rails 2 fixes dozens, if not hundreds, of bugs from 1.2.x and includes a huge array of performance improvements and major new features.

Finally, the bug you mention has long been fixed in 2.0.2, I believe.

Taryn said...

Woah - dhh commenting on my blog? :)

ok sad fan-girl flutter over ;)

To be clear - I'm certainly not throwing Rails 2.0 out. In fact I've been pushing to get it done ASAP in our project because right now the number of customers using the site is comparatively small - and RSN we'll be pushing it out to general customer usage... But I did test it to see if it was ready (and I did use 2.0.2), and I just can't truthfully say that it was ready for our main project. :(

From my reading of the bugs in question: as you say, they did indeed fix that bug stopping setup from working... but the fix broke the other bug that I mentioned. The patch was rolled back pending some solution that fixed both of them.

I should take this moment to say I have nothing but respect for the hard work of the RCT. They do a lot of work to fix this kind of stuff and I have absolute confidence that this particular issue will be fixed in no time flat!

In fact, for my pet project - I've stayed with Rails 2.0 and will continue to develop - even though developing without being able to run "rake test" leaves my heart beating a little faster than normal... and not in the good way ;)

But for our current production site - which has a a few hundred unit tests (that rely on the setup working). I'd love us to move over to Rails 2.0 straight away!
But we can't do it today because of those bugs. But maybe (hopefully) tomorrow? ;)

So to be clear: Rails 2.0: yay
Rearing to go. Only two bugs standing in the way... and I'm sure they'll be cleared up soon.