Skip to content
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

Revert "If Stacktrace interface is used for hashing, also use the Mes… #5488

Merged
merged 1 commit into from
May 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/sentry/event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,6 @@ def get_hashes_for_event_with_reason(event):
result = interface.compute_hashes(event.platform)
if not result:
continue

# HACK: if the top scoring interface is stacktrace then we also use the
# message interface so that events with the same stacktrace but differing
# messages will not be grouped, which is common if a single method can
# cause multiple separate error messages (that don't have exceptions attached).
message_key = 'sentry.interfaces.Message'
if interface.get_slug() == 'stacktrace' and message_key in interfaces:
message_hash = interfaces.get(message_key).compute_hashes(event.platform)
if message_hash:
result[0] = message_hash[0] + result[0]

return (interface.get_path(), result)
return ('message', [event.message])

Expand Down
28 changes: 0 additions & 28 deletions tests/sentry/test_event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,34 +790,6 @@ def test_stacktrace_wins_over_http(self, http_comp_hash, stack_comp_hash):
assert not http_comp_hash.called
assert hash_one == ['foo', 'bar']

@patch('sentry.interfaces.stacktrace.Stacktrace.compute_hashes')
@patch('sentry.interfaces.message.Message.compute_hashes')
def test_stacktrace_hash_also_includes_message(self, message_comp_hash, stack_comp_hash):
# this tests the temporary hack in get_hashes_for_event_with_reason
message_comp_hash.return_value = [['baz']]
stack_comp_hash.return_value = [['foo', 'bar']]
event = Event(
data={
'sentry.interfaces.Stacktrace': {
'frames': [{
'lineno': 1,
'filename': 'foo.py',
}],
},
'sentry.interfaces.Message': {
'message': 'abc'
},
},
platform='python',
message='Foo bar',
)
hashes = get_hashes_for_event(event)
assert len(hashes) == 1
hash_one = hashes[0]
stack_comp_hash.assert_called_once_with('python')
message_comp_hash.assert_called_once_with('python')
assert hash_one == ['baz', 'foo', 'bar']


class GetHashesFromFingerprintTest(TestCase):
def test_default_value(self):
Expand Down