Skip to content
Draft
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
10 changes: 4 additions & 6 deletions src/sentry/statistical_detectors/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from sentry import options
from sentry.api.serializers.snuba import SnubaTSResultSerializer
from sentry.issues.ingest import process_occurrence_data
from sentry.issues.ingest import hash_fingerprint
from sentry.issues.producer import PayloadType, produce_occurrence_to_kafka
from sentry.issues.status_change_consumer import bulk_get_groups_from_fingerprints
from sentry.issues.status_change_message import StatusChangeMessage
Expand Down Expand Up @@ -636,8 +636,6 @@ def generate_fingerprint(regression_type: RegressionType, name: str | int) -> st


def generate_issue_group_key(project_id: int, fingerprint: str) -> tuple[int, tuple[str, ...]]:
data = {
"fingerprint": [fingerprint],
}
process_occurrence_data(data)
return project_id, tuple(data["fingerprint"])
# Hash the fingerprint to match what's stored in GroupHash during issue creation
hashed_fingerprints = hash_fingerprint([fingerprint])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually equivalent to what process_occurence_data does:

def process_occurrence_data(data: dict[str, Any]) -> None:
    if "fingerprint" not in data:
        return

    # Hash fingerprints to make sure they're a consistent length
    data["fingerprint"] = hash_fingerprint(data["fingerprint"])

So this fix would change nothing

return project_id, tuple(hashed_fingerprints)
Loading