feat(uptime): backfill 2xx status code assertions on all uptime subscriptions#108678
Conversation
|
This PR has a migration; here is the generated SQL for for --
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL |
wedamija
left a comment
There was a problem hiding this comment.
Is adding this check to all uptime checks going to make these more expensive to run at all?
| if not assertion or not assertion.get("root"): | ||
| return {"root": {"op": "and", "children": copy.deepcopy(DEFAULT_STATUS_CODE_CHECKS)}}, True | ||
|
|
||
| root = assertion["root"] | ||
| if _has_any_status_code_check(root): | ||
| return assertion, False |
There was a problem hiding this comment.
Wondering if we should just check for no assertion here, rather than editing existing assertions? Are customers using these at all right now? It might be easier to just handle the simple case
There was a problem hiding this comment.
Let me double check.
There was a problem hiding this comment.
OK so
-- How many have custom assertions beyond just status_code_check
SELECT COUNT(*) AS has_custom_assertions
FROM uptime_uptimesubscription
WHERE assertion IS NOT NULL
AND EXISTS (
SELECT 1
FROM jsonb_array_elements(assertion->'root'->'children') AS child
WHERE child->>'op' != 'status_code_check'
);There's only 22 where the customer has changed the assertions from starting with the status code assertion.
If we don't make the edits we might end up losing the assertion checks and confusing customers when we allow 500s without assertions.
46d929f to
35ab3a3
Compare
Backend Test FailuresFailures on
|
…riptions Fixes NEW-761
35ab3a3 to
963458c
Compare
…riptions (#108678) Fixes NEW-761
Fixes NEW-761