Best practices for managing external plugins/libraries which live in Git?
This question came up at standup. I've put some thought into it, so I thought I'd throw it out for discussion and see what other people think.
At Pivotal, we use svn:externals and the Third-Party Branch Pattern (from the SCM Patterns Book) to manage easy, reliable cross-project updates of common plugins which live elsewhere (rubyforge, etc), without having to manually update in every project or be at the mercy of the RubyForge svn repo going down or being slow. When everything was on SVN, this worked well; we had some rake tasks which made it easy to update the branch from the latest trunk version in the external vendor repository. However, with more stuff like Desert is moving to GitHub.
One option is to just check the entire Git repo into subversion. This is labor-intensive, though. It also loses some of the benefits of the Third-Party branch pattern, such being able to easily preserve local patches while still pulling in changes from a new vendor version. We could probably update our Rake tasks to handle Git as well as SVN.
Another option is to switch all our projects to Git, but we aren't quite ready for that across the board.
Plus, this is a problem even if you move your parent project to Git. For example, there is no easy Git equivalent to having a svn:external which automatically updates to the latest version of an external repository, which is a useful approach for Continuous Integration or automatically pulling the latest Edge Rails into your project on every update.
Here's some links from people working on related issues, but please comment if you have any ideas or something that works well for you:
Standup 7/29/2008
Interesting
- There are now fixes in the master branch of Desert on GitHub. This addresses some problems with views in Rails 2.1 and Edge Rails.
Ask for Help
What are the best practices for managing dependency plugins or libraries that now live on GitHub (such as Desert)?
- Chad put some info and thoughts into a separate blog post
Standup 7/28/2008
Interesting
- firebug lite 1.2 is out
Ask for Help
We upgraded to rails 2.1 and polonium and our rspecs are not running on CI, but run fine if you simply use rake on the command line.
Check to see if you are using the rake extensions in pivotal core bundle.
Using setTimeout() to wait for DOM to update in JsUnit does not work.
Using setTimeout in tests is not going to do what you want, unless you mock setTimeout. Basically, setTimeout kicks off another thread which is not likely to effect the current test.
Standup 7/25/2008
Interesting Things
- There was an edge version of Rails (this project has a frozen Rails at some point in the past) that had a bug where a namespaced route would send a POST that should go to
MyController#createwas instead going to a POST toMyController#index. The fix is to freeze to current Edge, or usealias_method.
Ask for Help
"Any way to turn off a validation in a re-opened class?"
No way to do this. Best to refactor by pulling the validation out of the class and then mixing it in, or not, at a different level.
Standup 7/24/2008
Interesting

- There was war story told involving software that's not generally available. However, one tidbit that may be of general interest is a reminder that you don't necessarily get a perfect copy of your mysql database when restoring from a dump of that database. Mysqldump by default writes the data of each table preceded by a
DROP TABLE IF EXISTSand aCREATE TABLEstatement. This covers you in most situations, but misses when new tables have been created since the dump was made -- those new tables are not deleted. They may not cause problems, but some systems are sensitive to the existence of those tables, such as rails and theschema_infoandschema_migrationstables.
Ask for Help
- question: Is merb hosting different from rails hosting?
- answer: no
Standup 7/23/2008
Interesting Things
- Y!Slow + Firebug + submit a form will cause the result to be pulled from cache instead of hitting your server. The workaround is to disable Y!Slow.
- Some of our customers are requesting targeting Firefox 3, which has some rendering differences from FF2. So we're adding FF3 to the system image with a new icon and the correct trick to let it run side-by-side with FF2.
- How to Run FF2 & FF3 side-by-side on Mac OS X
- FF3 customer icon that is sufficiently different than Firefox's normal icon so you can tell the difference
- On a related note, rumor is that Facebook is dropping support for IE6. So is 37Signals.
- Interesting issues with the Globalize plugin & Rails 2.1:
- The currency formatting code does not work at all anymore - it always uses a '$'
- Their work for localizing templates, which involves injecting a fully-qualified path, breaks
#assert_template. The workaround is to comment out the path injection code, but this only works if you don't have localized templates.
- EngineYard's eycap gem version 0.3.6 now has better support for deploying from SVN tags
- Deploying from tag, since the URL was different used to do a
rm -rf, which takes a long time on EY's GFS disks for large file sizes. This was causing a customer's deploy taking ~20 minutes - The fix was to change eycap to use svn switch; the deploy now takes ~1 minute
- Deploying from tag, since the URL was different used to do a
Ask for Help
"Anyone seen/solved an issue with random font size increase using Firebug 1.1 or later?"
The issue is that at some point a page will render with much larger fonts and the CSS exploration won't tell you why. The work around is to launch a browser with Firebug disabled and run it side by side with the same page in a window with Firebug enabled (restarting the 2nd window whenever the problem occurs.)
Seeing this with Firefox 2 and 3 and any Firebug later than 1.05 (which doesn't run on FF3). This might be an issue with IFRAMEs, but we're not sure. No data found on this via Google searches or the Firebug group. We will post there.
Standup 07/22/2008
Interesting Things
- New Relic is presenting at our Tech Talk this week. Expect good information about using their real-time performance monitoring tool on your Rails projects.
- Pivotal Tracker, our home-grown Agile project management site, should get even more beta tonight. Users should be able to create their own projects! Check it out.
Standup 07/21/2008
Interesting Things
Model#update_allis your friend if you're not yet on Rails 2.1Like
Model#update_attributefor each attribute,#update_allwill save direct to the database, bypassing validation, updating only the columns you specify. In Rails 2.1, with partial model updates, you may not need this. But if you've not yet upgraded your application, then give#update_alla try.
Update: fixed per comment. Model#update_attribute does not validate. Thanks for the catch!
Standup 07/16/2008
Interesting Things
- It's always a good idea to test your backup and recovery strategy, but while doing so one team of Pivots found that restoring MySQL was more painful than they had expected. Restoring the backup to the master database and then replaying the binary logs to the right point but no further took a lot of manual attention and time. Is there a utility to ease the pain of restoring MySQL from backup?
Standup 07/15/2008
Interesting Things
- If using Desert and Rails 2.1, if the first view loaded is from a plugin things blow up.
Ask for Help
"How can I make follow_redirect go to a URL?"
When using a follow_redirect to a URL instead of a hash, the test fails with a string conversion exception. No solutions were forthcoming.







