Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Monthly Archives: August 2009

David Goudreau

REALLY setting environment variables in RubyMine on a Mac

David Goudreau
Friday, August 7, 2009

In my previous article I talked about using environment.plist to set environment variables in RubyMine. Well, it turns out that environment.plist doesn’t always work. Specifically, if you start RubyMine from Spotlight RubyMine has a different parent process that DOESN’T take into account the environment.plist file. It DOES work if you open RubyMine using the Dock or Quicksilver, though. Who would have guessed? This easily killed a day or so of troubleshooting on my current project.
So, to really solve this problem, it turns out you have to put your environment variables in /etc/launchd.conf like this:

setenv M2_HOME /opt/maven/2.0.9

For more details, check out this blog post and this blog post.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 08/07/2009: Rubygems 1.3.5 fail?

Pivotal Labs
Friday, August 7, 2009

Interesting Things

  • One project had trouble installing the Rails 2.3.3 with the most recent version of Rubygems (1.3.5) on a Gentoo box (EY Solo instance). Installing the gem on an OSX box worked fine with the same versions. No obvious solution presented itself, other than to roll back to Rubygems version 1.3.1.

  • If you do update your Rubygems version to 1.3.5 and you use Geminstaller you must update your Geminstaller gem to 0.5.2; Rubygems made some changes that break Geminstaller’s implementation. If you use an older version of Rubygems then keep using Geminstaller 0.5.1.

  • One project wanted to find all places where they needed to escape user input on their site, so they injected <script>alert('foo');</script> into every text field in the database, ran through their site, and looked for every place that a pop up box appeared.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Will Read

How To Not Test RabbitMQ Part 1

Will Read
Thursday, August 6, 2009

Q: How do you catch a unique rabbit?
A: Unique (you-neek) up on it!
Q: How do you catch a tame rabbit?
A: Tame way!!!!!

We’ve been using RabbitMQ as a queue server, alongside the clients, Bunny, and AMQP. In this series I’m hoping (hopping?) to show you some of the pitfalls we’ve learned to avoid and talk about how to write tests that test your code without getting stuck running a queue server in your test environment.

In Part 1 I’ll focus on our situation and creating some context around our choices so that you can decide what makes sense for your project. In Part 2, I’ll get into the nitty gritty of how to write some tests/specs around your queues.

First off, why queues? We’re making a shift from processing a million documents at a time, to processing one document at a time. The problem before was that if one document failed, they all failed, and we had to start all over. We needed to move to a point where we could single out trouble makers, and keep things in the last successful state so we didn’t have to go back to step one every time.

Different steps take different amounts of time, so invariably we would have to find ourselves queuing up the work that had to be done. Hey… sounds like I need a queue. Right.

We came up with RabbitMQ as our queue server solution.

  • It is field tested, which inspires confidence
  • Seems to have a good user base/community to help us get over the learning curve
  • Provides durable queues, meaning that if the server goes down, the state of the queue is preserved
  • Has a transactional-type mechanism, where things do not come all the way off the queue until an acknowledgment is sent back to the queue saying that our process is done with this piece of work.
  • Can route work around based on rules set up in RabbitMQ which responds to the content of the piece of work.

We did not do a whole lot of looking into other queue servers, so I can tell you right now, when you ask “Did you look into using Queue Server X?” my answer will probably be “Nope.”

We got RabbitMQ Server building in Chef and monitored by Monit (via Chef again) and we had a server running easily without any hurdles.

So next we need some clients. We started where everyone else seemed to start with the AMQP gem. It’s a robust little gem that seems to implement all the parts of the AMQ protocol we were interested in. It also does publish and subscribe actions asynchronously! The only problem is that it does publishes and subscribes asynchronously! o_O

AMQP Client works great on the subscribe side because you get real events, meaning you don’t have to poll the queue all the time to see if there’s work to be done. Of course, you never know when or for how long those pieces of work will take to be processed, so you’ll see how this affects one’s tests later on.

The AMQP Client gem makes use of Event Machine, which Joseph talked about in his blog about how the Event Machine loops in a somewhat unexpected way. It also has the problem that it’ll publish your data, and then forget about it, which is not so good if your server isn’t running because you never get an ack back that your work is on the queue.

Enter the Bunny Client gem (there’s also a Carrot client out there, these queue people apparently love their cotton-tailed references). Much like the AMQP Client gem, Bunny appears to be a full implementation of the AMQ Protocol, only this time things happen synchronously. This worked great for throwing things onto our queue because we didn’t need one job to be forking all over the place, and we now got feedback if Bunny couldn’t connect to the server. But as you’ll see in Part 2, testing still wasn’t without challenges.

So we arrived at RabbitMQ as our queue server, Bunny gem as our client of choice for publishes, and AMQP gem as our subscriber client. The solution seemed to be working well, but test driving it was a learning experience, trying to find out what needed mocking, what needed a stub, and understanding what we didn’t want to test at all. Next time in Part 2 I’ll show you the patterns we derived, and we’ll hop right along some example Ruby code and RSpec specs.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Dan Podsedly

Story tasks in Pivotal Tracker

Dan Podsedly
Thursday, August 6, 2009

At Pivotal Labs, we like to keep our Tracker stories as small as possible, so that each story describes a single, concrete feature that delivers incremental value to our project’s customer. With small stories, there is rarely a need to break things down further, but sometimes it’s still useful to keep a to-do list while working on a story. This helps keep track of all the little things you have to do, and lets everyone else on the project know exactly what’s left.

tracker dashboard

To enable story tasks for your project, go to project settings, and check the ‘enable tasks’ option under Experimental. You should then be able to add tasks to stories, under the description field. Hover over a task to edit it, delete it, or move it up and down. You can also check off a task when it’s complete, but task status does not affect overall story status.

Story tasks can be viewed and updated via the API.

As always, we look forward to your feedback. If story tasks are popular, we’ll enable them for all projects, by default.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

RightScale: Cloud Computing Management

Wednesday, August 5, 2009 | Run time: 1:01:27

Ed Goldberg of Rightscale discusses and demonstrates their AWS cloud management offering, with tuneable dynamic instance scaling both up and down, GUI administration, and a library of custom config scripts.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Full Text Search with Rails

Wednesday, August 5, 2009 | Run time: 39:50

Wolfram Arnold shares his experiences implementing full-text search in a Rails-based translation application. The searching had to support multiple languages and matching on common word roots.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 08/05/2009: BugMash this weekend

Pivotal Labs
Wednesday, August 5, 2009

Interesting Things

  • RailsBridge is organizing a global BugMash to help knock down some of
    the bugs on the Rails lighthouse this weekend. If your interested in helping out there is more information on their wiki

  • We started using JRuby for a project and wanted to use JRuby to run our specs. If you install RSpec 1.2.7 or higher you can specify the ruby command used to run your SpecTask in rspec.rake like this:

  desc "Run all specs in spec directory (excluding plugin specs)"
  Spec::Rake::SpecTask.new(:spec) do |t|
    t.spec_opts = ['--options', ""#{File.dirname(__FILE__)}/../../spec/spec.opts""]
    t.spec_files = FileList['spec/**/*/*_spec.rb']
    t.ruby_cmd = 'jruby'
  end
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Davis W. Frank

"Evening with webOS" Posted, PreDevCamp

Davis W. Frank
Wednesday, August 5, 2009

Our “Palm webOS Night @ Pivotal Labs” was well attended two weeks ago. Mitch Allen, of Palm introduced talks by Palm’s Jesse Donaldson & yours truly. Jesse walked through an overview of how to write a Mojo (the name for Palm’s framework) application and I shared our experiences, including how test-driven development can work on the platform. After working with Palm’s new operating system for several months it was great finally to be able to share our experiences, talk up agile practices, and answer questions.

But don’t take my word for it – go see and/or listen for yourself, or just go read Jesse’s slides or my slides.

The following week the San Francisco webOS Meetup was at Palm headquarters on July 28th. The organizers asked we give the same talks. We had a larger crowd but had similar questions about platform direction and experiences. While this event at Palm wasn’t recorded, the content was largely the same and it was just as great to hear enthusiasm in the community.

This excitement carries over to this Saturday. August 8th is PreDevCamp, a worldwide, self-organizing event where developers will be hacking together to teach & learn how to write applications for webOS.

I’ll be at the San Francisco event, which is going to be at Palm in Sunnyvale (not exactly SF), talkin’ agile, helping out and of course, hacking a bit. If you’re in the Bay Area, come say, “Hi.” If you’re not, then register for your local PreDevCamp and go code up some apps.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

An Introduction to Palm’s webOS

Tuesday, August 4, 2009 | Run time: 1:34:22

Palm’s Jesse Donaldson intros Palm’s webOS™ showing the architecture and lifecycle for a simple app. Pivot Davis W. Frank shares Pivotal’s experience writing webOS apps using agile practices. Slides: http://bit.ly/EMj6a and http://bit.ly/axfsd

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 08/04/2009: ActionController CGI extension load order

Pivotal Labs
Tuesday, August 4, 2009

Interesting Things

  • We discovered a bug in the load order of CGI extensions in ActionController in Rails 2.3.3. The body of the first request to a Mongrel server after loading the Rails environment will appear empty, even if it’s not. The problem is the default CGI::QueryExtension#initialize_query in the Ruby standard library will read the stdinput stream and not rewind it. As a result, future reads of stdinput look empty. In Rails, this behavior is overridden in action_controller/cgi_ext/query_extension.rb. Unfortunately this file isn’t loaded until after the first request to a new server, at which point subsequent requests work normally. The Rails ticket is here.

  • The easiest fix is to require “action_controller/cgi_ext” in your environment file or an initializer file.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (783)
  • rails (117)
  • testing (90)
  • ruby (86)
  • ruby on rails (71)
  • jobs (62)
  • javascript (59)
  • techtalk (44)
  • ironblogger (42)
  • rspec (39)
  • bloggerdome (34)
  • productivity (34)
  • activerecord (30)
  • rubymine (30)
  • git (29)
  • gogaruco (29)
  • nyc (27)
  • design (24)
  • mobile (23)
  • pivotal tracker (22)
  • process (21)
  • cucumber (21)
  • jasmine (19)
  • ios (18)
  • tracker ecosystem (17)
  • webos (17)
  • objective-c (17)
  • fun (16)
  • android (16)
  • palm (16)
  • ci (16)
  • "soft" ware (16)
  • bdd (15)
  • tdd (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • css (14)
  • gem (13)
  • mouse-free development (12)
  • selenium (12)
  • goruco (12)
  • bundler (12)
  • api (12)
  • keyboard (11)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
Subscribe to Community Feed
  1. ←
  2. 1
  3. 2
  4. 3
  5. 4
  6. 5
  7. →
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >