feat(alerts): Add pure Detector/Workflow version of OrganizationCombinedRuleIndexEndpoint#110700
feat(alerts): Add pure Detector/Workflow version of OrganizationCombinedRuleIndexEndpoint#110700
Conversation
…nedRuleIndexEndpoint
| uptime_rules = uptime_rules.filter(name__icontains=name) | ||
| crons_rules = crons_rules.filter(name__icontains=name) | ||
|
|
||
| if not features.has("organizations:performance-view", organization): |
There was a problem hiding this comment.
Invalid dataset parameter causes uncaught ValueError
The code at line 424 converts user-provided dataset query parameters directly to Dataset enum objects with Dataset(d) without validation. If a user provides an invalid dataset value (e.g., ?dataset=invalid), Python's Enum constructor raises a ValueError which is uncaught, resulting in a 500 error instead of a proper 400 Bad Request response.
Verification
Verified by reading the Dataset enum definition in src/sentry/snuba/dataset.py which shows it's a standard Python Enum. Enum(value) raises ValueError for invalid values. Compared to legacy path at line 655 which uses raw strings without enum conversion. The datasets variable comes directly from request.GET.getlist('dataset', []) at line 587 with no validation.
Also found at 1 additional location
src/sentry/incidents/endpoints/organization_alert_rule_index.py:600-600
Identified by Warden sentry-backend-bugs · UJP-SDW
Backend Test FailuresFailures on
|
Not quite happy with the import cycle issues, and concerned about performance especially in sorting and filtering cases.
Fixes ISWF-2189.