-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add single datasource enforcement config #103870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add single datasource enforcement config #103870
Conversation
Co-authored-by: evan.purkhiser <evan.purkhiser@sentry.io>
|
Cursor Agent can help with this pull request. Just |
|
|
||
|
|
||
| class BaseDetectorTypeValidator(CamelSnakeSerializer): | ||
| # Set to True to enforce only a single data source can be configured |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Trueto 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.
Learn more about Cursor Agents
Co-authored-by: evan.purkhiser <evan.purkhiser@sentry.io>
Co-authored-by: evan.purkhiser <evan.purkhiser@sentry.io>
|
Cursor Agent can help with this pull request. Just |
Codecov Report✅ All modified and coverable lines are covered by tests. 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 |
ceorourke
left a comment
There was a problem hiding this 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
…onfig-claude-4.5-sonnet-thinking-5192
Introduces
enforce_single_datasourceon 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