Skip to content

Commit 319461a

Browse files
feat(triage signals): Seer orgs on new pring need to have Github integration to use autofix
1 parent 895ad88 commit 319461a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/sentry/seer/endpoints/group_autofix_setup_check.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from django.conf import settings
88
from rest_framework.response import Response
99

10-
from sentry import quotas
10+
from sentry import features, quotas
1111
from sentry.api.api_owners import ApiOwner
1212
from sentry.api.api_publish_status import ApiPublishStatus
1313
from sentry.api.base import region_silo_endpoint
@@ -135,6 +135,15 @@ def get(self, request: Request, group: Group) -> Response:
135135
organization=org, project=group.project
136136
)
137137

138+
# Customers on new pricing need to have github configured to use Autofix.
139+
# Check if project has code mappings configured (feature flagged)
140+
if integration_check is None and features.has(
141+
"organizations:triage-signals-v0-org", org
142+
):
143+
repos_from_mappings = get_autofix_repos_from_project_code_mappings(group.project)
144+
if not repos_from_mappings:
145+
integration_check = "code_mappings_missing"
146+
138147
write_integration_check = None
139148
if request.query_params.get("check_write_access", False):
140149
repos = get_repos_and_access(group.project, group.id)

src/sentry/tasks/post_process.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,7 @@ def kick_off_seer_automation(job: PostProcessJob) -> None:
16061606
get_issue_summary_lock_key,
16071607
)
16081608
from sentry.seer.autofix.utils import (
1609+
get_autofix_repos_from_project_code_mappings,
16091610
is_issue_eligible_for_seer_automation,
16101611
is_seer_scanner_rate_limited,
16111612
)
@@ -1683,6 +1684,10 @@ def kick_off_seer_automation(job: PostProcessJob) -> None:
16831684
if not is_issue_eligible_for_seer_automation(group):
16841685
return
16851686

1687+
# Check if project has connected repositories - requirement for new pricing
1688+
if not get_autofix_repos_from_project_code_mappings(group.project):
1689+
return
1690+
16861691
# Atomically set cache to prevent duplicate dispatches (returns False if key exists)
16871692
automation_dispatch_cache_key = f"seer-automation-dispatched:{group.id}"
16881693
if not cache.add(automation_dispatch_cache_key, True, timeout=300):

0 commit comments

Comments
 (0)