Skip to content

Commit

Permalink
chore(events): Move PLACEHOLDER_EVENT_TITLES to a neutral location (#…
Browse files Browse the repository at this point in the history
…70470)

I tried to use `PLACEHOLDER_EVENT_TITLES` in an upcoming PR, and landed in a circular dependency with `event_manager.py`, where it currently lives. This moves it to `constants.py`, which solves the problem.
  • Loading branch information
lobsterkatie committed May 7, 2024
1 parent a97dccf commit 7ea571e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/sentry/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ def get_all_languages() -> list[str]:
DEFAULT_LOGGER_NAME = ""
LOG_LEVELS_MAP = {v: k for k, v in LOG_LEVELS.items()}

PLACEHOLDER_EVENT_TITLES = frozenset(["<untitled>", "<unknown>", "<unlabeled event>", "Error"])

# Default alerting threshold values
DEFAULT_ALERT_PROJECT_THRESHOLD = (500, 25) # 500%, 25 events
DEFAULT_ALERT_GROUP_THRESHOLD = (1000, 25) # 1000%, 25 events
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
DEFAULT_STORE_NORMALIZER_ARGS,
LOG_LEVELS_MAP,
MAX_TAG_VALUE_LENGTH,
PLACEHOLDER_EVENT_TITLES,
DataCategory,
)
from sentry.culprit import generate_culprit
Expand Down Expand Up @@ -146,7 +147,6 @@
# Timeout for cached group crash report counts
CRASH_REPORT_TIMEOUT = 24 * 3600 # one day

PLACEHOLDER_EVENT_TITLES = frozenset(["<untitled>", "<unknown>", "<unlabeled event>", "Error"])

HIGH_SEVERITY_THRESHOLD = 0.1

Expand Down
2 changes: 1 addition & 1 deletion tests/sentry/event_manager/test_severity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from urllib3.exceptions import MaxRetryError

from sentry import options
from sentry.constants import PLACEHOLDER_EVENT_TITLES
from sentry.event_manager import (
PLACEHOLDER_EVENT_TITLES,
SEER_ERROR_COUNT_KEY,
EventManager,
_get_severity_score,
Expand Down

0 comments on commit 7ea571e

Please sign in to comment.