Repository navigation
feat(alerts): let the cutover move real-time insight alerts - #127910
Conversation
The cutover no longer skips real-time alerts. An edit to a moved alert that resets its due time on the insight stack, such as a new cadence, threshold or quiet hours, now resets the platform copy's due time too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
😎 Merged successfully - details. |
🤖 CI report
|
| File | Comment lines | Added lines |
|---|---|---|
products/alerts/backend/platform_ownership.py |
3 | 30 |
products/alerts_platform/backend/logic/platform_lifecycle.py |
3 | 27 |
products/alerts/backend/platform_cutover.py |
1 | 5 |
This check does not block merging. It updates on every push and clears when the share drops.
⚠️ Backend coverage — 70.0% of changed backend lines covered — 14 uncovered
🧪 Backend test coverage
Patch coverage — changed backend lines (products + core): ██████████████░░░░░░ 70.0% (34 / 48)
| File | Patch | Uncovered changed lines |
|---|---|---|
products/alerts_platform/backend/logic/platform_writes.py |
0.0% | 307–308 |
products/alerts/backend/max_tools.py |
0.0% | 480 |
products/alerts_platform/backend/logic/platform_lifecycle.py |
9.1% | 973–975, 980–984, 988–989 |
products/alerts/backend/platform_ownership.py |
90.0% | 62 |
🤖 Agents: add a test only if an uncovered line exposes a realistic regression that existing tests miss. Otherwise explain why no new test is needed under "How did you test this code?". Gap list: the patch-coverage artifact on this run (gh run download 155059815298946 -n patch-coverage), or the coverage-data block at the end of this comment.
Per-product line coverage (touched products)
| Product | Coverage | Lines |
|---|---|---|
platform_features |
██░░░░░░░░░░░░░░░░░░ 12.1% |
7 / 58 |
data_tools |
████████████░░░░░░░░ 60.9% |
95 / 156 |
warehouse_sources_queue |
█████████████░░░░░░░ 65.3% |
2,163 / 3,314 |
demo |
█████████████░░░░░░░ 65.7% |
1,803 / 2,743 |
batch_exports |
████████████████░░░░ 82.3% |
23,568 / 28,654 |
engineering_analytics |
█████████████████░░░ 84.9% |
11,699 / 13,779 |
commands |
█████████████████░░░ 85.4% |
1,621 / 1,898 |
ml_inference |
█████████████████░░░ 86.3% |
524 / 607 |
mcp_analytics |
█████████████████░░░ 86.3% |
5,803 / 6,722 |
posthog_ai |
██████████████████░░ 87.9% |
4,303 / 4,895 |
apm |
██████████████████░░ 88.2% |
1,973 / 2,236 |
notebooks |
██████████████████░░ 88.5% |
15,356 / 17,347 |
mcp_registry |
██████████████████░░ 89.0% |
1,596 / 1,794 |
webmcp |
██████████████████░░ 89.3% |
292 / 327 |
dashboards |
██████████████████░░ 89.4% |
8,048 / 9,003 |
product_tours |
██████████████████░░ 89.7% |
1,355 / 1,510 |
warehouse_suggestions |
██████████████████░░ 89.9% |
3,707 / 4,124 |
cohorts |
██████████████████░░ 90.1% |
8,996 / 9,990 |
signals |
██████████████████░░ 90.5% |
99,647 / 110,116 |
today |
██████████████████░░ 90.6% |
3,494 / 3,858 |
visual_review |
██████████████████░░ 90.7% |
9,852 / 10,863 |
managed_warehouse |
██████████████████░░ 91.2% |
12,686 / 13,914 |
canvas |
██████████████████░░ 91.2% |
8,203 / 8,994 |
data_warehouse |
██████████████████░░ 91.3% |
15,661 / 17,162 |
tasks |
██████████████████░░ 91.3% |
82,102 / 89,969 |
autoresearch |
██████████████████░░ 91.5% |
11,717 / 12,805 |
cdp |
██████████████████░░ 91.5% |
10,432 / 11,396 |
data_modeling |
██████████████████░░ 91.6% |
11,193 / 12,216 |
metrics |
██████████████████░░ 91.7% |
11,234 / 12,253 |
slack_app |
██████████████████░░ 91.8% |
21,945 / 23,913 |
wizard |
██████████████████░░ 91.8% |
6,868 / 7,479 |
streamlit_apps |
██████████████████░░ 91.9% |
3,139 / 3,415 |
business_knowledge |
██████████████████░░ 92.0% |
10,505 / 11,423 |
review_hog |
██████████████████░░ 92.3% |
17,768 / 19,256 |
conversations |
██████████████████░░ 92.3% |
31,158 / 33,746 |
error_tracking |
███████████████████░ 92.5% |
20,487 / 22,146 |
authorization |
███████████████████░ 92.5% |
544 / 588 |
early_access_features |
███████████████████░ 92.6% |
1,339 / 1,446 |
stamphog |
███████████████████░ 92.6% |
8,875 / 9,584 |
alerts_platform |
███████████████████░ 92.6% |
8,448 / 9,122 |
notifications |
███████████████████░ 92.8% |
1,218 / 1,312 |
alerts |
███████████████████░ 93.0% |
10,878 / 11,701 |
aeo |
███████████████████░ 93.0% |
2,150 / 2,312 |
surveys |
███████████████████░ 93.3% |
7,248 / 7,772 |
ai_training |
███████████████████░ 93.3% |
598 / 641 |
web_analytics |
███████████████████░ 93.4% |
26,448 / 28,325 |
ai_gateway |
███████████████████░ 93.6% |
787 / 841 |
messaging |
███████████████████░ 93.7% |
6,756 / 7,214 |
approvals |
███████████████████░ 93.7% |
5,004 / 5,341 |
cross_project_dashboards |
███████████████████░ 93.7% |
862 / 920 |
marketing_analytics |
███████████████████░ 93.7% |
21,955 / 23,420 |
context_layer |
███████████████████░ 93.8% |
3,984 / 4,247 |
exports |
███████████████████░ 93.8% |
4,314 / 4,597 |
workflows |
███████████████████░ 93.8% |
27,397 / 29,194 |
mcp_store |
███████████████████░ 93.9% |
9,188 / 9,784 |
ai_observability |
███████████████████░ 93.9% |
32,676 / 34,793 |
billing_alerts |
███████████████████░ 94.0% |
2,322 / 2,470 |
customer_analytics |
███████████████████░ 94.0% |
29,901 / 31,794 |
managed_migrations |
███████████████████░ 94.1% |
1,877 / 1,994 |
replay_vision |
███████████████████░ 94.4% |
33,325 / 35,317 |
legal_documents |
███████████████████░ 94.4% |
2,313 / 2,451 |
logs |
███████████████████░ 94.5% |
19,432 / 20,567 |
experiments |
███████████████████░ 94.7% |
43,959 / 46,433 |
reminders |
███████████████████░ 94.8% |
782 / 825 |
actions |
███████████████████░ 94.9% |
997 / 1,051 |
endpoints |
███████████████████░ 94.9% |
9,566 / 10,077 |
growth |
███████████████████░ 95.0% |
11,563 / 12,176 |
annotations |
███████████████████░ 95.1% |
1,097 / 1,153 |
skills |
███████████████████░ 95.2% |
7,633 / 8,018 |
uptime_monitoring |
███████████████████░ 95.3% |
306 / 321 |
access_control |
███████████████████░ 95.5% |
8,358 / 8,753 |
subscriptions |
███████████████████░ 95.6% |
13,645 / 14,275 |
data_catalog |
███████████████████░ 95.7% |
4,714 / 4,928 |
product_analytics |
███████████████████░ 95.8% |
30,289 / 31,620 |
feature_flags |
███████████████████░ 95.8% |
29,654 / 30,953 |
revenue_analytics |
███████████████████░ 95.9% |
1,877 / 1,958 |
data_quality |
███████████████████░ 96.0% |
8,561 / 8,915 |
tracing |
███████████████████░ 96.5% |
4,564 / 4,729 |
warehouse_sources |
███████████████████░ 96.5% |
492,991 / 510,624 |
account_audits |
███████████████████░ 96.7% |
770 / 796 |
security |
███████████████████░ 96.8% |
1,597 / 1,650 |
pulse |
███████████████████░ 97.3% |
2,036 / 2,093 |
analytics_platform |
████████████████████ 97.9% |
2,862 / 2,922 |
groups |
████████████████████ 98.3% |
1,864 / 1,897 |
field_notes |
████████████████████ 99.4% |
172 / 173 |
Report-only. Patch coverage = changed backend lines covered vs origin/master. Sorted lowest first.
Known gaps: lines covered only by Temporal tests show as uncovered; core line numbers may drift if master changed the same file.
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 5696a09: 2 Should fix.
This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
…nables A rescheduled copy is now due a minute out at the earliest, so it never reuses the evaluation key of a check that just finished. Turning a moved real-time alert back on through the platform API now checks the active real-time limit, as the insight API and the Max tool do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Risk: No findings This increment adds the plan-entitlement check ( Sentinel reviewed |
There was a problem hiding this comment.
Not approved — this change needs a human reviewer.
Re-add the stamphog label to request another review once you have addressed this.
Owning-team authorship and strong familiarity provide assurance for the risky changes, but @PostHog's current-head entitlement concern remains unfixed. Address that comment and request another review from @PostHog/team-apm or Matt Pua before re-requesting.
- Author wrote 98% of the modified lines and has 38 merged PRs in these paths (familiarity STRONG).
- PostHog Review (Standard) reviewed the current head: 1 finding, posted on the PR.
- posthog[bot] reviewed the current head.
- @PostHog on products/alerts/backend/platform_ownership.py: the entitlement concern remains unresolved. _write_insight_row calls real_time_alert_validation_error without interval_entitlement_error; products/alerts/backend/models/alert.py confirms that the former only checks active-count limits and permits organizations without the feature. The evaluation path in products/alerts/backend/platform_source_cycle.py subsequently rejects the missing entitlement. Add the entitlement check before enabling and cover a downgraded organization in a regression test before re-requesting review.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 108L, 7F substantive, 163L/9F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (163L, 9F, single-area, feat) |
| stamphog 2.7.0 | .stamphog/policy.yml @ d42da77 · reviewed head d42da77 |
…t on Turning a moved alert back on through the platform API now checks the interval entitlement before the active real-time limit, as the insight API does. An organization that lost real-time can no longer enable an alert that the next evaluation would switch off again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Approved.
The risky write-path and plan-admission changes have current-head review assurance, owning-team authorship, and strong author familiarity. The current code addresses the earlier scheduling and admission findings; no unresolved substantive concerns or other refusal grounds were found.
- Author wrote 98% of the modified lines and has 38 merged PRs in these paths (familiarity STRONG).
- PostHog Review (Standard) reviewed the current head: no findings.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 112L, 7F substantive, 172L/9F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (172L, 9F, single-area, feat) |
| stamphog 2.7.0 | .stamphog/policy.yml @ 4b24353 · reviewed head 4b24353 |
|
/trunk merge |
Problem
not_on_platform, and an alert that has already moved can't be edited to real-time.Changes
update_owned_copyasrescheduled. The platform side follows the ruleupsert_configurationalready applies to copies the source owns.How did you test this code?
Test rationale:
test_an_alert_moves_with_its_state_and_schedulegains a real-time row, which fails while the gate is in place. The real-time row in the skip test is removed.test_an_edit_reschedules_the_copy_when_it_reschedules_the_insight_alertreplaces the test that expected the platform to refuse a real-time edit. It covers a real-time edit, a threshold edit and a rename. The first two failed before the reschedule change, and the rename guards against a carry-over that fires on every edit.Ran the alerts, Max tool and alerts platform suites, plus repo-wide mypy, locally. Not checked: a deploy, or a real-time alert moved in production. The cutover waits for the customer email about check timing.
Release status
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Opus 5.5 (
claude-opus-5-5)Skills:
/writing-tests,/writing-code-comments,/code-review,/writing-pr-descriptions/code-review high --fix: two findings, quiet-hours edits and threshold edits not rescheduling the copy. Both fixed by therescheduledflag./simplifywas not run. The diff is small and mostly removes a gate.🤖 Generated with Claude Code