phallstrom / slackistrano

Slack integration for Capistrano deployments.
MIT License
374 stars 74 forks source link

::Capistrano::Configuration's dry_run? method validation #70

Closed mvoto closed 7 years ago

mvoto commented 7 years ago

After trying to update versions of slackistrano and capistrano on a project that I am working on, I got the following error when trying to run a deploy:

NoMethodError: undefined method `config' for #<Capistrano::Configuration:0x00561240c08520>
  /home/mvoto/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/slackistrano-3.1.1/lib/slackistrano/capistrano.rb:116:in `dry_run?'
  /home/mvoto/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/slackistrano-3.1.1/lib/slackistrano/capistrano.rb:69:in `post'
  /home/mvoto/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/slackistrano-3.1.1/lib/slackistrano/capistrano.rb:61:in `block in process'
  /home/mvoto/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/slackistrano-3.1.1/lib/slackistrano/capistrano.rb:60:in `each'
  /home/mvoto/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/slackistrano-3.1.1/lib/slackistrano/capistrano.rb:60:in `process'
  /home/mvoto/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/slackistrano-3.1.1/lib/slackistrano/capistrano.rb:40:in `block in run'
  /home/mvoto/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sshkit-1.13.1/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
  /home/mvoto/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sshkit-1.13.1/lib/sshkit/backends/abstract.rb:29:in `run'
...

I am using slackistrano on version 3.1.1 and capistrano on 3.8.1 and I know that this error that was already mentioned on this closed issue: #48

The code related to the error is this one: https://github.com/phallstrom/slackistrano/blob/v3.1.1/lib/slackistrano/capistrano.rb#L113

And when I checked on Capistrano's related code: https://github.com/capistrano/capistrano/blob/v3.8.1/lib/capistrano/configuration.rb#L150 I noticed that dry_run? is not a class method, but an instance one. I would like to know if I might be doing something wrong with slackistrano + capistrano, or if this is a real issue. If so, let me know if I can help with a Pull Request for that.

phallstrom commented 7 years ago

Sounds like it may be a bug if capistrano side has changed something recently. Unfortunately I'm going to be out of the country for awhile and won't be able to look into it. Totally open to PRs if you dig into it and figure it out.

mvoto commented 7 years ago

Okay, I will work on it, thanks !

mvoto commented 7 years ago

Hey @phallstrom can you please review the #71 Pull Request ? This change seems to fix this issue.

phallstrom commented 7 years ago

Closing this in preference for #71