-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix(uptime): Enforce domain limits everywhere #86086
base: master
Are you sure you want to change the base?
Conversation
Note that I'll merge this after my other stack that contains migrations merges |
This PR has a migration; here is the generated SQL for --
-- Create index uptime_upti_url_dom_ead522_idx on field(s) url_domain_suffix, url_domain of model uptimesubscription
--
CREATE INDEX CONCURRENTLY "uptime_upti_url_dom_ead522_idx" ON "uptime_uptimesubscription" ("url_domain_suffix", "url_domain"); |
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.
Schema change looks good.
self.max_urls = max_urls | ||
|
||
|
||
def check_url_limits(url): |
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.
def check_url_limits(url): | |
def check_url_limits(url): | |
""" | |
Determines if a URL's domain has reached the global maximum (MAX_MONITORS_PER_DOMAIN). | |
In the case that it has a `MaxUrlsForDomainReachedException` will be raised. | |
""" |
1ea9731
to
53f5065
Compare
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #86086 +/- ##
=======================================
Coverage 87.88% 87.88%
=======================================
Files 9713 9714 +1
Lines 550582 550619 +37
Branches 21441 21441
=======================================
+ Hits 483875 483920 +45
+ Misses 66327 66319 -8
Partials 380 380 |
Currently we're only enforcing these at the api level. Move them to autodetection as well, and add an index to make sure we can still query them cheaply.
53f5065
to
cbe7b42
Compare
b63a201
to
af3f9e1
Compare
This PR has a migration; here is the generated SQL for --
-- Create index uptime_upti_url_dom_ead522_idx on field(s) url_domain_suffix, url_domain of model uptimesubscription
--
CREATE INDEX CONCURRENTLY "uptime_upti_url_dom_ead522_idx" ON "uptime_uptimesubscription" ("url_domain_suffix", "url_domain"); |
Currently we're only enforcing these at the api level. Move them to autodetection as well, and add an index to make sure we can still query them cheaply.