notify_hoptoad and Capistrano dry-run

Alessandro Morandi's Avatar

Alessandro Morandi

03 Nov, 2010 11:42 AM

The hoptoad_notifier gem ( ) adds a useful deploy:notify_hoptoad recipe to Capistrano.
However, I think it's a little awkward that Hoptoad is notified of the deploy even when Capistrano is run with the --dry-run option.

The --dry-run option forces Capistrano into printing all remote commands without actually executing them. The catch here is that the command to notify Hoptoad is a local one, and is thus executed regardless of the --dry-run option.
While this if formally correct, it means Hoptoad will track deploy operations that never actually happened.

My suggestion would be to find a way to avoid running the notification command when --dry-run is specified. Does that sound reasonable to you?

  1. 2 Posted by Emma Lindsay on 03 Nov, 2010 05:20 PM

    Emma Lindsay's Avatar


    I can see how logging deploys during a dry run could be annoying - and your suggestion into looking at if it's possible to change the recipe seems reasonable.

    I don't offhand know the work it would take to fix, but we'll consider it for future releases.

    Thanks for your suggestion,

    • Emma
  2. 3 Posted by Emma Lindsay on 03 Nov, 2010 05:29 PM

    Emma Lindsay's Avatar

    Oh, I forgot to mention - the notifier is open source source so if you wanted to make the addition yourself and send a pull request, we'd consider it for inclusion (of course, you'd also want to include tests.)

    Just another option, if you were interested (we only have limited time to work on the notifier ourselves, so we're sometimes slower to implement things than the people who need them.)

  3. 4 Posted by Alessandro Morandi on 05 Jan, 2011 04:29 PM

    Alessandro Morandi's Avatar

    I've been working on this, but I'm having some problems testing it. I tried to package it as a gem, using gem build hoptoad_notifier.gemspec.
    When I try to use it in an existing Rails app, however, I get an error:

    $ cap staging deploy:notify_hoptoad
    rake aborted!
    no such file to load -- shared_tasks

    It's working fine with an old version of the gem (2.2.2). Also, the issue is not tied to my fork (happens even with commit c5d690df4158a6bc013ad9aa2eef4a0cb9187314 from the main repo). So I guess either the gem building process is broken or I'm doing it wrong. Could someone give me some insight on this?


  4. 5 Posted by Jason Morrison on 05 Jan, 2011 07:08 PM

    Jason Morrison's Avatar

    Hi Alessandro,

    Thanks - we hadn't released this version of the gem to Rubygems (2.3.13), but you're right, there was an issue with HEAD and that tag. I've pushed a fix to HEAD and tagged as 2.3.14. Can you try now?


  5. 6 Posted by Alessandro Morandi on 05 Jan, 2011 09:44 PM

    Alessandro Morandi's Avatar

    Yes, the error is gone now, thanks.

    What are the tests that I should run before sending you a pull request with my code? I managed to run all the unit tests with rake tests , but I'm a bit baffled by the Cucumber tests. Also, will the integration test push something to the staging server I'll be using to test it with?

  6. 7 Posted by Nick Quaranto on 06 Jan, 2011 06:13 PM

    Nick Quaranto's Avatar

    If the rake test suite passes, that should be good enough, we'll evaluate and double check once we see the patch as well. Pull request away when you can!

  7. 8 Posted by Alessandro Morandi on 06 Jan, 2011 06:23 PM

    Alessandro Morandi's Avatar
  8. 9 Posted by Nick Quaranto on 06 Jan, 2011 06:25 PM

    Nick Quaranto's Avatar

    Thanks! Putting this on our internal tracker, will let you know once it's merged in.

  9. 10 Posted by Jon Yurek on 30 Mar, 2011 06:57 PM

    Jon Yurek's Avatar

    I've pulled in that pull request, and this will get pushed out in the next release. Thanks!

  10. Jon Yurek closed this discussion on 30 Mar, 2011 06:57 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac