codeur / capistrano-sentry

Sentry release/deployment integration with Capistrano
MIT License
11 stars 13 forks source link

Failure at sentry:validate_config #6

Closed alienxp03 closed 5 years ago

alienxp03 commented 5 years ago

Command to reproduce the error.

be cap production deploy --dry-run

Errors that I'm getting.

00:00 sentry:validate_config
      [sentry:validate_config] Validating Sentry notification config
fatal: ambiguous argument '^': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
00:01 sentry:notice_deployment
      Notified Sentry of new release: 956e3ea6f4553437f9010bb1e81fdfb3425574ba
      Notified Sentry of new deployment: 956e3ea6f4553437f9010bb1e81fdfb3425574ba-20190813090706

After checking the source code, it's possible this is the line that's causing the error

https://github.com/codeur/capistrano-sentry/blob/4f4070256adb374e29e55e9bb07fd49310d0e72c/lib/capistrano/tasks/sentry.rake#L37

Testing the command locally, possibly this is the issue?

  1. git rev-parse feature/update_sentry_capistrano^ - Ok
  2. git rev-parse master^ - Failed.
burisu commented 5 years ago

Hello, I'm not sure, but I think that fetch(:current_revision) is blank in a dry run. So the command failed executing git rev-parse ^. We should skip the validation during a dry run.

alienxp03 commented 5 years ago

Forgot to mention. I was running the dry-run to see the full logs. But normal deployment failed too.

bundle exec cap production deploy
fatal: ambiguous argument '^': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'