Skip to content
Open
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
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ module = [
"sentry.snuba.metrics.query_builder",
"sentry.testutils.cases",
"tests.sentry.api.helpers.test_group_index",
"tests.sentry.issues.test_utils",
]
disable_error_code = [
"arg-type",
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/issues/ingest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import logging
from collections.abc import Mapping
from collections.abc import Mapping, Sequence
from datetime import datetime
from hashlib import md5
from typing import Any, TypedDict
Expand Down Expand Up @@ -104,7 +104,7 @@ def process_occurrence_data(data: dict[str, Any]) -> None:
data["fingerprint"] = hash_fingerprint(data["fingerprint"])


def hash_fingerprint(fingerprint: list[str]) -> list[str]:
def hash_fingerprint(fingerprint: Sequence[str]) -> list[str]:
return [md5(part.encode("utf-8")).hexdigest() for part in fingerprint]


Expand Down
9 changes: 6 additions & 3 deletions tests/sentry/issues/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from sentry.event_manager import GroupInfo
from sentry.issues.escalating.escalating import GroupsCountResponse
from sentry.issues.grouptype import ProfileFileIOGroupType
from sentry.issues.ingest import process_occurrence_data, save_issue_occurrence
from sentry.issues.ingest import hash_fingerprint, save_issue_occurrence
from sentry.issues.issue_occurrence import IssueEvidence, IssueOccurrence, IssueOccurrenceData
from sentry.issues.occurrence_consumer import process_event_and_issue_occurrence
from sentry.issues.status_change_message import StatusChangeMessage, StatusChangeMessageData
Expand Down Expand Up @@ -58,7 +58,7 @@ def build_occurrence_data(self, **overrides: Any) -> IssueOccurrenceData:
}
kwargs.update(overrides) # type: ignore[typeddict-item]

process_occurrence_data(kwargs)
kwargs["fingerprint"] = hash_fingerprint(kwargs["fingerprint"])
return kwargs

def build_occurrence(self, **overrides: Any) -> IssueOccurrence:
Expand Down Expand Up @@ -99,14 +99,17 @@ def build_statuschange_data(self, **overrides: Any) -> StatusChangeMessageData:
}
kwargs.update(overrides) # type: ignore[typeddict-item]

process_occurrence_data(kwargs)
kwargs["fingerprint"] = hash_fingerprint(kwargs["fingerprint"])
return kwargs

def build_statuschange(self, **overrides: Any) -> StatusChangeMessage:
return StatusChangeMessage(**self.build_statuschange_data(**overrides))


class SearchIssueTestMixin(OccurrenceTestMixin):
def store_event(self, data: dict[str, Any], project_id: int, **kwargs: Any) -> Event:
raise NotImplementedError

def store_search_issue(
self,
project_id: int,
Expand Down
Loading