-
-
Notifications
You must be signed in to change notification settings - Fork 520
Attempt to pull release version from heroku, then from git repo #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to pull release version from heroku, then from git repo #377
Conversation
lib/raven/configuration.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ENV change is good, but otherwise this assumes too much (version could be mercurial or something unrelated to VCS). Mind just removing this bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the app isn't versioned with git, git rev-parse --short HEAD.strip` will gracefully fallback to an empty string. I can go ahead and remove this, but keeping it in place might be a great added feature for devs with no harmful failure case. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also the fact that git may not even be available on the system -- unless you're saying thats safe (not a rubyist myself)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on needing a git fallback, 99% of Ruby devs use it but perhaps not guaranteed in production environments.
ba1a262 to
3bff897
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call on git not existing on the system. I wrapped the sys call in a rescue: this will fail gracefully if the user doesn't have git installed, or if the current directory is not a git repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess in that case release will be nil. Anything else we can fall back to? I guess not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that's right: if the user isn't on heroku, and isn't using git, then release == nil. Although not idea, I think this solution will auto-tag errors with commit in the majority of cases.
|
It'd also be good to grab the release info from Capistrano deploys. This is how we're doing it: config.release = File.read('REVISION').strip if File.exists? 'REVISION' |
* heroku * git repo * capistrano version
3bff897 to
5bd30ff
Compare
Good idea. Added this to the PR. |
|
lgtm unless anyone has any objections |
Attempt to pull release version from heroku, then from git repo
|
Need to fix the dang build |
|
Gem::InstallError: rack-cache requires Ruby version >= 1.9.3. |
|
Yeah, PR's welcome to fix that part of the gem spec |
No description provided.