Skip to content

Conversation

@evanpurkhiser
Copy link
Member

Introduces enforce_single_datasource on the base detector validator to restrict specific detector types (Uptime and Crons) to a single data source.

This prevents invalid configurations where these detectors might be set up with multiple data sources, which is not supported for their intended functionality.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.


Slack Thread

Open in Cursor Open in Web

Co-authored-by: evan.purkhiser <evan.purkhiser@sentry.io>
@cursor
Copy link
Contributor

cursor bot commented Nov 22, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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


class BaseDetectorTypeValidator(CamelSnakeSerializer):
# Set to True to enforce only a single data source can be configured
Copy link
Member Author

Choose a reason for hiding this comment

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

@cursor use a docstring for this

Copy link
Contributor

@cursor cursor bot Nov 22, 2025

Choose a reason for hiding this comment

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

Done! I've converted the inline comment to a proper docstring format at the class level. The docstring now:

  • Explains that subclasses should set this to True to enforce single data source validation
  • Provides context on why this exists (preventing invalid configurations)
  • Uses proper multi-line docstring format

This is the standard Python approach for documenting class-level configuration attributes like enforce_single_datasource.


Open in Cursor Open in Web

Learn more about Cursor Agents

cursoragent and others added 2 commits November 22, 2025 02:27
Co-authored-by: evan.purkhiser <evan.purkhiser@sentry.io>
@cursor
Copy link
Contributor

cursor bot commented Nov 24, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@evanpurkhiser evanpurkhiser marked this pull request as ready for review November 24, 2025 16:43
@evanpurkhiser evanpurkhiser requested review from a team as code owners November 24, 2025 16:43
@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #103870      +/-   ##
===========================================
+ Coverage   78.98%    80.24%   +1.25%     
===========================================
  Files        9315      9301      -14     
  Lines      397577    399425    +1848     
  Branches    25393     25247     -146     
===========================================
+ Hits       314032    320515    +6483     
+ Misses      83093     78450    -4643     
- Partials      452       460       +8     

Copy link
Member

@ceorourke ceorourke left a comment

Choose a reason for hiding this comment

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

the placement of that docstring is wild to me but I won't block

@evanpurkhiser evanpurkhiser merged commit 8e34b54 into master Nov 26, 2025
67 checks passed
@evanpurkhiser evanpurkhiser deleted the cursor/add-single-datasource-enforcement-config-claude-4.5-sonnet-thinking-5192 branch November 26, 2025 17:18
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.

4 participants