Skip to content

chore(seer): Consolidate automation feature flags #91856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def fetch_issue_summary(group: Group) -> dict[str, Any] | None:
return None
if not features.has("organizations:gen-ai-features", group.organization):
return None
if not features.has("projects:trigger-issue-summary-on-alerts", group.project):
if not features.has("organizations:trigger-autofix-on-issue-summary", group.organization):
return None
if not get_seer_org_acknowledgement(org_id=group.organization.id):
return None
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/tasks/post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ def kick_off_seer_automation(job: PostProcessJob) -> None:
group = event.group

if not features.has("organizations:gen-ai-features", group.organization) or not features.has(
"projects:trigger-issue-summary-on-alerts", group.project
"organizations:trigger-autofix-on-issue-summary", group.organization
):
return

Expand Down
12 changes: 9 additions & 3 deletions tests/sentry/integrations/slack/test_message_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,9 @@ def test_no_description_in_notification(self):
}

@override_options({"alerts.issue_summary_timeout": 5})
@with_feature({"organizations:gen-ai-features", "projects:trigger-issue-summary-on-alerts"})
@with_feature(
{"organizations:gen-ai-features", "organizations:trigger-autofix-on-issue-summary"}
)
@patch(
"sentry.integrations.utils.issue_summary_for_alerts.get_seer_org_acknowledgement",
return_value=True,
Expand Down Expand Up @@ -1045,7 +1047,9 @@ def test_build_group_block_with_ai_summary_without_feature_flag(
assert "IntegrationError" in blocks["blocks"][0]["text"]["text"]

@override_options({"alerts.issue_summary_timeout": 5})
@with_feature({"organizations:gen-ai-features", "projects:trigger-issue-summary-on-alerts"})
@with_feature(
{"organizations:gen-ai-features", "organizations:trigger-autofix-on-issue-summary"}
)
@patch(
"sentry.integrations.utils.issue_summary_for_alerts.get_seer_org_acknowledgement",
return_value=True,
Expand Down Expand Up @@ -1193,7 +1197,9 @@ def test_build_group_block_with_ai_summary_text_truncation(
"sentry.integrations.utils.issue_summary_for_alerts.get_issue_summary",
return_value=(None, 403),
)
@with_feature({"organizations:gen-ai-features", "projects:trigger-issue-summary-on-alerts"})
@with_feature(
{"organizations:gen-ai-features", "organizations:trigger-autofix-on-issue-summary"}
)
def test_build_group_block_with_ai_summary_without_org_acknowledgement(
self, mock_get_issue_summary, mock_get_seer_org_acknowledgement
):
Expand Down
6 changes: 3 additions & 3 deletions tests/sentry/tasks/test_post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -2482,7 +2482,7 @@ class KickOffSeerAutomationTestMixin(BasePostProgressGroupMixin):
)
@patch("sentry.tasks.autofix.start_seer_automation.delay")
@with_feature("organizations:gen-ai-features")
@with_feature("projects:trigger-issue-summary-on-alerts")
@with_feature("organizations:trigger-autofix-on-issue-summary")
def test_kick_off_seer_automation_with_features(
self, mock_start_seer_automation, mock_get_seer_org_acknowledgement
):
Expand All @@ -2505,7 +2505,7 @@ def test_kick_off_seer_automation_with_features(
return_value=True,
)
@patch("sentry.tasks.autofix.start_seer_automation.delay")
@with_feature("projects:trigger-issue-summary-on-alerts")
@with_feature("organizations:trigger-autofix-on-issue-summary")
def test_kick_off_seer_automation_without_org_feature(
self, mock_start_seer_automation, mock_get_seer_org_acknowledgement
):
Expand Down Expand Up @@ -2550,7 +2550,7 @@ def test_kick_off_seer_automation_without_proj_feature(
)
@patch("sentry.tasks.autofix.start_seer_automation.delay")
@with_feature("organizations:gen-ai-features")
@with_feature("projects:trigger-issue-summary-on-alerts")
@with_feature("organizations:trigger-autofix-on-issue-summary")
def test_kick_off_seer_automation_without_seer_enabled(
self, mock_start_seer_automation, mock_get_seer_org_acknowledgement
):
Expand Down
Loading