Skip to content

ref(night_shift): Move FeatureRunStatus to shared types module

1ef7231
Select commit
Loading
Failed to load commit list.
Merged

feat(seer): Add deliver_feature_result RPC for Seer agent features #116734

ref(night_shift): Move FeatureRunStatus to shared types module
1ef7231
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: sentry-backend-bugs completed Jun 2, 2026 in 5m 27s

1 issue

sentry-backend-bugs: Found 1 issue (1 medium)

Medium

AutofixStoppingPoint enum conversion without ValueError guard can crash night-shift delivery - `src/sentry/seer/endpoints/seer_rpc.py:1038`

In _trigger_autofix_for_fixable (src/sentry/seer/night_shift/delivery.py ~line 171), the dict comprehension calls AutofixStoppingPoint(value) directly on read_preference_from_sentry_db(project).automated_run_stopping_point, which is read from the project option sentry:seer_automated_run_stopping_point. The or SEER_AUTOMATED_RUN_STOPPING_POINT_DEFAULT fallback only handles None/empty string, not a stored string that is no longer a valid enum member. The same concern is already handled explicitly at the org level in src/sentry/seer/autofix/utils.py:374-376 ("Guard against stored stopping points that are no longer valid"), but no analogous guard exists here. If any single project in the batch has a stale value, the comprehension raises ValueError, aborting deliver_night_shift_result entirely — no autofix is triggered for any verdict and no SeerNightShiftRunResult rows are written. This matches Check 4 (enum conversion without ValueError handling on values sourced from storage).


⏱ 4m 40s · 586.0k in / 25.1k out · $1.00

Annotations

Check warning on line 1038 in src/sentry/seer/endpoints/seer_rpc.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: sentry-backend-bugs

AutofixStoppingPoint enum conversion without ValueError guard can crash night-shift delivery

In `_trigger_autofix_for_fixable` (src/sentry/seer/night_shift/delivery.py ~line 171), the dict comprehension calls `AutofixStoppingPoint(value)` directly on `read_preference_from_sentry_db(project).automated_run_stopping_point`, which is read from the project option `sentry:seer_automated_run_stopping_point`. The `or SEER_AUTOMATED_RUN_STOPPING_POINT_DEFAULT` fallback only handles None/empty string, not a stored string that is no longer a valid enum member. The same concern is already handled explicitly at the org level in `src/sentry/seer/autofix/utils.py:374-376` ("Guard against stored stopping points that are no longer valid"), but no analogous guard exists here. If any single project in the batch has a stale value, the comprehension raises `ValueError`, aborting `deliver_night_shift_result` entirely — no autofix is triggered for any verdict and no `SeerNightShiftRunResult` rows are written. This matches Check 4 (enum conversion without ValueError handling on values sourced from storage).