Skip to content

Commit 289ebe7

Browse files
roggenkemperclaude
andcommitted
fix(issue-detection): Handle parent-only settings in audit log rendering
ai_issue_detection_enabled has no entry in project_settings_to_group_map since it doesn't map to a single group type. Add a separate description mapping for parent-only settings so the audit log renders a meaningful message when the global AI detection toggle is changed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9af4d00 commit 289ebe7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/sentry/audit_log/events.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,19 @@ def render(self, audit_log_entry: AuditLogEntry) -> str:
183183
project_settings_to_group_map as map,
184184
)
185185

186+
PARENT_SETTING_DESCRIPTIONS: dict[str, str] = {
187+
"ai_issue_detection_enabled": "AI issue detection",
188+
}
189+
186190
data = audit_log_entry.data
187-
items_string = ", ".join(
188-
f"to {'enable' if value else 'disable'} detection of {map[key].description} issue"
189-
for (key, value) in data.items()
190-
if key in map.keys()
191-
)
191+
items = []
192+
for key, value in data.items():
193+
action = "enable" if value else "disable"
194+
if key in map:
195+
items.append(f"to {action} detection of {map[key].description} issue")
196+
elif key in PARENT_SETTING_DESCRIPTIONS:
197+
items.append(f"to {action} {PARENT_SETTING_DESCRIPTIONS[key]}")
198+
items_string = ", ".join(items)
192199
return "edited project performance issue detector settings " + items_string
193200

194201

0 commit comments

Comments
 (0)