thoughtbot / parity

Shell commands for development, staging, and production parity for Heroku apps
https://thoughtbot.com
MIT License
895 stars 57 forks source link

Fix `deploy` problems in 0.9.0 #63

Closed geoffharcourt closed 9 years ago

geoffharcourt commented 9 years ago

v0.9.0 broke deploy in two ways. The first is that migrations were being checked after the deploy completed, which resulted in the check for diffs in db/migrate always finding no differences. This change reverts to the prior pattern of caching whether migrations are pending at the start of deploy before pushing to Heroku.

The second is that the check for rake would raise an exception if a user's local bundle wasn't installed, as the shell command would return a failing status. Kernel.system can return true, false, or nil, but Kernel.exit can't accept nil as an argument. Parity::Environment#run will now always return a boolean value so that Kernel.exit receives an appropriate argument.

Fix #61.

geoffharcourt commented 9 years ago

@bernerdschaefer added specs to test that Parity::Environment#run with deploy subcommand:

  1. failed deployment always returns false
  2. successful deploy with no necessary migrations returns true
geoffharcourt commented 9 years ago

@bernerdschaefer the resulting code looks better now. I'm a little worried that the intent is harder to discern from the way it's organized, but we do have specs checking that things happen in the correct order.

TL;DR: your suggestions have clearly improved this code.

bernerdschaefer commented 9 years ago

Awesome. This looks great, and I'm happy to see us getting exit codes right with parity!

:+1: