-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Truncate project_root prefix from filename #278
Conversation
792fa1e
to
dba3211
Compare
Hmm, my Rails application uses Capistrano and doesn't have an issue with Sentry failing to group events. |
Hmm... my Rails application always says the filename is Even if the filename was |
What version of Rails and Capistrano are you using? |
|
I'm using Rails 4.1 with Capistrano 2.15.5 |
Again, even if the filename was Model's or controller's filename is |
Sorry, but I think we have to keep abs_path as the actual absolute path to stay on spec. If you think there's an issue with how Sentry groups events together, please open that issue on the main Sentry server repository. |
Hmm not sure I quite understood this PR, you weren't actually changing abs_path, you were changing filename! |
👍 @eagletmt, this is precisely what I was getting at in the issue |
@@ -36,6 +36,12 @@ def filename | |||
return nil if self.abs_path.nil? | |||
|
|||
prefix = $LOAD_PATH.select { |s| self.abs_path.start_with?(s.to_s) }.sort_by { |s| s.to_s.length }.last | |||
if prefix.nil? && Raven.configuration.project_root | |||
project_root = Raven.configuration.project_root.to_s | |||
if self.abs_path.start_with?(project_root) |
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.
This self
is unnecessary.
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.
Confusing I know since we use it everywhere else in this method.
@eagletmt If you could please rebase against master, I can merge. |
dba3211
to
40402af
Compare
@nateberkopec rebased. |
Truncate project_root prefix from filename
Especially in Rails project, when an exception is raised in view template, the filename is always full path.
With capistrano (de-facto standard for Ruby application deployment), the full path differs on each release.
It causes Sentry to recognize the same error differently.