Skip to content

Conversation

@evanpurkhiser
Copy link
Member

Adds validation to prevent non-superusers from creating or modifying
uptime detectors with restricted mode values (AUTO_DETECTED_*). Only
superusers (internal systems) can now set modes other than MANUAL.

The validation smartly only triggers when mode is being changed, allowing
users to pass config with an unchanged mode value.

Fixes NEW-621: Ensure Uptime detector mode is not configurable via API endpoints

@evanpurkhiser evanpurkhiser requested a review from a team as a code owner November 11, 2025 19:59
@linear
Copy link

linear bot commented Nov 11, 2025

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 11, 2025
Copy link
Member

@wedamija wedamija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, when a user modifies a detector, it should automatically switch to manual mode, from what I remember

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/uptime/endpoints/validators.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #103178      +/-   ##
===========================================
- Coverage   80.67%    80.66%   -0.01%     
===========================================
  Files        9241      9241              
  Lines      393627    393640      +13     
  Branches    25053     25053              
===========================================
+ Hits       317542    317548       +6     
- Misses      75623     75630       +7     
  Partials      462       462              

@evanpurkhiser
Copy link
Member Author

Also, when a user modifies a detector, it should automatically switch to manual mode, from what I remember

Let me verify we have a test for this behavior

Adds validation to prevent non-superusers from creating or modifying
uptime detectors with restricted mode values (AUTO_DETECTED_*). Only
superusers (internal systems) can now set modes other than MANUAL.

The validation smartly only triggers when mode is being changed, allowing
users to pass config with an unchanged mode value.

Fixes [NEW-621: Ensure Uptime detector `mode` is not configurable via API endpoints](https://linear.app/getsentry/issue/NEW-621/ensure-uptime-detector-mode-is-not-configurable-via-api-endpoints)
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-uptime-restrict-detector-mode-changes-to-superusers-only branch from 30eb4f9 to fbd03bd Compare November 11, 2025 22:03
@evanpurkhiser evanpurkhiser enabled auto-merge (squash) November 11, 2025 22:18
@evanpurkhiser evanpurkhiser merged commit 799caef into master Nov 11, 2025
65 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-uptime-restrict-detector-mode-changes-to-superusers-only branch November 11, 2025 22:26
Jesse-Box pushed a commit that referenced this pull request Nov 12, 2025
Adds validation to prevent non-superusers from creating or modifying
uptime detectors with restricted mode values (AUTO_DETECTED_*). Only
superusers (internal systems) can now set modes other than MANUAL.

The validation smartly only triggers when mode is being changed,
allowing
users to pass config with an unchanged mode value.

Fixes [NEW-621: Ensure Uptime detector `mode` is not configurable via
API
endpoints](https://linear.app/getsentry/issue/NEW-621/ensure-uptime-detector-mode-is-not-configurable-via-api-endpoints)
andrewshie-sentry pushed a commit that referenced this pull request Nov 13, 2025
Adds validation to prevent non-superusers from creating or modifying
uptime detectors with restricted mode values (AUTO_DETECTED_*). Only
superusers (internal systems) can now set modes other than MANUAL.

The validation smartly only triggers when mode is being changed,
allowing
users to pass config with an unchanged mode value.

Fixes [NEW-621: Ensure Uptime detector `mode` is not configurable via
API
endpoints](https://linear.app/getsentry/issue/NEW-621/ensure-uptime-detector-mode-is-not-configurable-via-api-endpoints)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants