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
39 changes: 10 additions & 29 deletions src/sentry/seer/autofix/issue_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,36 +322,17 @@ def run_automation(
return

# Check event count for ALERT source with triage-signals-v0-org
if source == SeerAutomationSource.ALERT and features.has(
"organizations:triage-signals-v0-org", group.organization
):
# Use times_seen_with_pending if available (set by post_process), otherwise fall back
times_seen = (
group.times_seen_with_pending
if hasattr(group, "_times_seen_pending")
else group.times_seen
)
if times_seen < 10:
logger.info(
"Triage signals V0: skipping alert automation, event count < 10",
extra={
"group_id": group.id,
"project_slug": group.project.slug,
"event_count": times_seen,
},
if is_seer_seat_based_tier_enabled(group.organization):
if source == SeerAutomationSource.ALERT:
# Use times_seen_with_pending if available (set by post_process), otherwise fall back
times_seen = (
group.times_seen_with_pending
if hasattr(group, "_times_seen_pending")
else group.times_seen
)
return

# Only log for orgs with seat-based Seer tier
try:
should_log = is_seer_seat_based_tier_enabled(group.organization)
except Exception:
logger.exception(
"Error checking if seat-based Seer tier is enabled", extra={"group_id": group.id}
)
should_log = False
if times_seen < 10:
return

if should_log:
try:
times_seen = group.times_seen_with_pending
except (AssertionError, AttributeError):
Expand Down Expand Up @@ -403,7 +384,7 @@ def run_automation(
return

stopping_point = None
if features.has("organizations:triage-signals-v0-org", group.organization):
if is_seer_seat_based_tier_enabled(group.organization):
fixability_stopping_point = _get_stopping_point_from_fixability(fixability_score)

# Fetch user preference and apply as upper bound
Expand Down
7 changes: 4 additions & 3 deletions src/sentry/seer/similarity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sentry_sdk
from tokenizers import Tokenizer

from sentry import features, options
from sentry import options
from sentry.constants import DATA_ROOT
from sentry.grouping.api import get_contributing_variant_and_component
from sentry.grouping.grouping_info import get_grouping_info_from_variants_legacy
Expand All @@ -17,6 +17,7 @@
from sentry.models.organization import Organization
from sentry.models.project import Project
from sentry.seer.autofix.constants import AutofixAutomationTuningSettings
from sentry.seer.autofix.utils import is_seer_seat_based_tier_enabled
from sentry.services.eventstore.models import Event, GroupEvent
from sentry.utils import metrics
from sentry.utils.safe import get_path
Expand Down Expand Up @@ -509,7 +510,7 @@ def set_default_project_autofix_automation_tuning(
if org_default == "off":
# Explicit "off" is always respected, regardless of feature flag
project.update_option("sentry:autofix_automation_tuning", "off")
elif features.has("organizations:triage-signals-v0-org", organization):
elif is_seer_seat_based_tier_enabled(organization):
# Feature flag ON overrides everything except explicit "off"
project.update_option(
"sentry:autofix_automation_tuning",
Expand All @@ -524,7 +525,7 @@ def set_default_project_seer_scanner_automation(
organization: Organization, project: Project
) -> None:
"""Called once at project creation time to set the initial seer scanner automation."""
if features.has("organizations:triage-signals-v0-org", organization):
if is_seer_seat_based_tier_enabled(organization):
# Feature flag ON always sets scanner to True
project.update_option("sentry:seer_scanner_automation", True)
else:
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/tasks/post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,7 @@ def kick_off_seer_automation(job: PostProcessJob) -> None:
from sentry.seer.autofix.utils import (
is_issue_eligible_for_seer_automation,
is_seer_scanner_rate_limited,
is_seer_seat_based_tier_enabled,
)
from sentry.tasks.autofix import (
generate_issue_summary_only,
Expand All @@ -1619,7 +1620,7 @@ def kick_off_seer_automation(job: PostProcessJob) -> None:
group = event.group

# Default behaviour
if not features.has("organizations:triage-signals-v0-org", group.organization):
if not is_seer_seat_based_tier_enabled(group.organization):
# Only run on issues with no existing scan
if group.seer_fixability_score is not None:
return
Expand Down
Loading