Rajan AgaskarRajan Agaskar
Standup 12/7/2009
edit Posted by Rajan Agaskar on Monday December 07, 2009 at 09:13AM

Interesting Things

  • Pivotal Core Bundle - Deprecations deprecated!

Two Pivots heroically removed some deprecated extensions and rake tasks from the Pivotal Core Bundle. Do not be surprised if your favorite code jams (like cancel_default_validates_associated class method) disappear next time you pull.

  • Move files fast! Some lucky pivot discovered that mv file.tgz * will move all files in the current path into the last file or directory it can find.

If for some reason you do not want this to happen, it is recommended that you always specify a destination when moving files.

To help you remember this protip, here's a totally worthless analogy that involves automobiles: would you get into a cab without telling the driver where you wanted to go?

No, you would not, because he would take you to IHOP, and you hate pancakes. You wanted to go to Waffle House, which is unfortunate, because the nearest Waffle House is in Nevada.

Adam MilliganAdam Milligan
Programmers Anonymous
edit Posted by Adam Milligan on Sunday December 06, 2009 at 09:18PM

I recently had an opportunity to work on a relatively high-profile project with a crazy timeline. A coworker and I spoke with the client for the first time around lunchtime on a Friday, and the client needed a completed website, complete with a relatively sophisticated design (which had, at that moment, not yet been delivered by the designer) and a relatively sophisticated data model, by mid-day the coming Monday. That's 72 hours to build and skin a fully functioning website.

I realize that "fully functioning" doesn't tell you much about the scope of the project, but we live in a world of non-disclosure agreements. Suffice to say, it was a non-trivial amount of work.

Keeping in mind that the two of us had already worked 36 hours of our 40-hour work week on other projects, we agreed to take on the project. Between the two of us we worked about 60 hours that weekend, most of it solo, and had the site finished at start of business Monday morning. This might not seem particularly heroic (particular to anyone who writes software for the game industry), but keep in mind that at Pivotal we believe strongly in the concept of sustainable pace; we really do work eight hour days, five days a week. People working late at Pivotal is relatively unusual; people working weekends is almost unheard of.

David GoudreauDavid Goudreau
Standup 12/04/2009
edit Posted by David Goudreau on Friday December 04, 2009 at 09:33AM

Help!

John PignataJohn Pignata
NYC Standup Roundup - Week of 11/30
edit Posted by John Pignata on Friday December 04, 2009 at 09:06AM

Help

RubyMine and gem bundler don't seem to get along - RubyMine complains that bundled gems aren't attached but these gems aren't available when we try to attach them. Any ideas?

  1. RubyMine uses your gem path so you'll be able to attach to the gem if you add your gem bundler path to your ~/.gemrc file

  2. There's an option to disable this nagging alert in the preferences.

Is there a good Rails plugin skeleton/template out there?

Know of one? Let us know in the comments.

Interesting

  • Don't use sleep 1 or such in before blocks in rspec if you need to ensure a delay between two events. A before block is ran between all nested contexts so you're probably incurring a larger penalty. Instead, you should stub Time.now.

  • One team implemented git commit hooks to facilitate communication - on rebase or merge new messages from a text file in the project root are displayed to alert other pairs to changes such as gem upgrades, noteworthy database changes, etc.

Dan PodsedlyDan Podsedly
Pivotal Tracker API Update
edit Posted by Dan Podsedly on Thursday December 03, 2009 at 11:10AM

The Pivotal Tracker API has now been available for just over a year, and we're really pleased with the rich variety of tools and applications that our user community has built with it, to extend Tracker's functionality. There are now integration tools, wrappers for various programming languages, mobile apps, an IRC console, and many more on the way (see the 3rd party tools page for a comprehensive list).

We're continuing to improve the API based on your feedback. Recently, we've added the ability to create projects, manage project members, and search for stories based on created and last modified dates. For the next API release, we're adding ability to move a story relative to another story, add file attachments, and get current project velocity and all labels. We're also adding support for Github post-commit hooks, so you can do things like "finishes #123456" in your commit messages.

The most exciting new feature that we're working on, though, is a push webhook, which will allow your applications to listen to activity in your Tracker project(s). You'll be able to register a URL, per project, to which Tracker will post all story changes to (as XML). With this webhook, we're hoping to enable a whole new class of 3rd party tools and applications, for example to facilitate 2 way integration with bug tools.

Most of these enhancements will be part of a new version of the API (V3), which we hope to have ready at the end of the year. As part of this release, we will also be turning off the first version of the API (V1), so if you're still using that version, you'll need to update your client code to V2 prior to that. V2 is the current version, documented on the [API Help page]. For the exact date of this release, watch this blog, or follow @pivotaltracker.

As always, your feedback is welcome. If you have ideas for other things that would be useful to add to the API, or have built a tool you'd like to share, let us know!

dan

David GoudreauDavid Goudreau
Standup 12/03/2009
edit Posted by David Goudreau on Thursday December 03, 2009 at 09:31AM

Help!

  • Git branch best practices - we have a customer who doesn't do acceptance often enough so we'd like to keep production code in a different branch from demo code. Any suggestions?

    Our friend Josh Susser has a good blog post on git branching workflow. Some other suggestions are to have a separate 'deploy' branch which you cherrypick changes from your 'development' branch with and deploy to production with (this would, however, require a separate integration test process to integrate the cherrypicked changes). Or, of course, round up your customer and have them do acceptance more regularly.

  • RubyMine - some Pivots are having issues running RSpec in their Rails projects.

    The usual steps we take are to make sure you can Command-click the rspec and spec/rails references in your spec_helper.rb and get to the gems they correspond to and to make sure your spec directory is flagged as a test directory in Settings => Project Structure in RubyMine. That didn't seem to solve this particular issue, though. There was some talk about commenting out arbitrary 'require' statements in your files and that change somehow making RSpec run correctly. Strange.

  • Testing paperclip - tests don't behave correctly when running them in RubyMine. There are issues with the 'identify' command.

    A possible issue is that ghostscript is not installed. Paperclip uses ImageMagick which uses ghostscript to identify attachment file types. You can install ghostscript using MacPorts. This can be tough to track down because paperclip appears to just swallow the exception that occurs when using ghostscript. Some other projects are mocking out paperclip in their tests to avoid the issue completely.

  • validates_associated fun in 2.3.5 - it's changed from 2.3.4. Another change is depending on rack 1.0.1

  • You can now boot from ebs on Amazon

  • It appears that ActiveRecord now validates all associated objects by default, for any type of validation. Given this example:

    class User < AR::Base
      has_many :wibbles
    end
    
    
    class Wibble < AR::Base
      validates_presence_of :name
    end
    

    when you save a User, it will validate all associated wibbles and fail validation if any wibble fails validation. This always happens on create, and it appears happens on update if the association is an auto-save association, which it implicitly becomes if you allow nested attribute create/update for the association.

    Before Rails 2.3.4 a failed validation on an association would give you a moderately nonsensical validation error. In the case of the above example, if the name validation failed on an associated wibble then the user would have the error "Name can't be blank," which is, of course, misleading. The attribute name for the error would just be "name", so tests for the validation would be something like @user.should have(1).error_on(:name)

    As of Rails 2.3.4 (possibly 2.3.3) the error message for a validation failure on an associated object changed to include the object type, so if the name validation failed on an associated wibble then the user would have the error "Wibbles name can't be blank." They accomplished this by changing the attribute name for the error to "#{association_name}_#{attribute_name}", thus "wibbles_name". Tests for the validation would have to change to @user.should have(1).error_on(:wibbles_name)

    As of Rails 2.3.5, the error message for a validation failure on an associated object is back to what it was pre-2.3.4 ("Name can't be blank"). However, this is because the attribute name for the error is now "#{association_name}.#{attribute_name}. So, tests have to change again to @user.should have(1).error_on('wibbles.name')

    Not really a huge difference, just an annoyance that it keeps changing.

Interesting Things

  • SMSW - this is an annual supermarket street sweep that benefits the San Francisco Food Bank. Ride on bikes, pick up foodstuffs from supermarkets and win prizes while helping the Food Bank! This Saturday 12/5 at noon.

  • Check out the AAU Future Tense exhibit at 688 Sutter Street Gallery - a showing of art that you can actually pick up with your hands! Exhibit is open thru January.

Dan PodsedlyDan Podsedly
Track-r, Mobile Pivotal Tracker Application by Koombea
edit Posted by Dan Podsedly on Tuesday December 01, 2009 at 06:21PM

Koombea announced the release of the Track-r application for iPhone, a mobile client for Pivotal Tracker. Track-r is a free, open source application, and was developed using Rhomobile's RhoHub and the Rhodes "write once and run on many" framework. Trackr uses RhoSync to sync data to your device allowing you to manage your work whether or not you have an internet connection. All of your data is synced with Pivotal Tracker the next time you get a connection.

Track-R logo

Track-R uses the Pivotal Tracker API, which has allowed developers to create dozens of tools and applications to help extend the functionality of Tracker.

More information about Track-R is available in Koombea's press release:

http://www.prnewswire.com/news-releases/koombea-announces-availability-of-track-r-mobile-application-for-iphone-78226107.html

To get the app, and get updates on the latest version, see the Track-r page on Koombea's site.

John PignataJohn Pignata
Prevent Cross-site Scripting Attacks with Rails 2.3.5 and rails_xss
edit Posted by John Pignata on Tuesday December 01, 2009 at 06:12PM

Earlier this week, the Rails core team released Rails 2.3.5 which introduces a major new feature: support for automatic cross-site scripting protection via the rails_xss plugin. rails_xss switches the default behavior of Rails to automatically escape all unsafe strings emitted into the view.

Dan PodsedlyDan Podsedly
Pivotal Tracker nominated for Crunchie award
edit Posted by Dan Podsedly on Tuesday December 01, 2009 at 04:55PM

Pivotal Tracker has been nominated for Best Internet Application in this year's Crunchies Awards. If you're a fan of Tracker, please help us win the award by voting here!.

David GoudreauDavid Goudreau
Standup 12/01/2009
edit Posted by David Goudreau on Tuesday December 01, 2009 at 10:14AM

Help!

  • Heroku logs - how do you get more than 20 lines? Is there an option to get the entire log? Apparently there used to be an option to get the whole thing. Looks like we're not the only ones looking for this.
  • Webrat - is it really as incomplete as it appears? The answer is yes. We've had to create a bunch of the api ourselves to facilitate using it. If you know you're just going to use the Selenium portion of it without the Rails integration option then you might just call the Selenium API directly (which Webrat does make available to you) from your Selenium tests.

Interesting Things

  • Rails XML parameter rudeness - sometimes when only a single model is posted, it does not generate the second array, and instead gives you a hash (i.re. not wrapped in []). This is apparently a well-known bug. Workaround is pretty straightforward:

    widgets = params[:widgets][:widget]
    if widgets.is_a?(Hash)
      widgets = [widgets]
    end
    
  • Movember is over but you can revel in the 'stashes all year long at Pivotal Movember.

Other articles: