fix/ph-insights
safeba4f438 · incrementalpre-PRreviewed 2026-08-01 00:54 UTC0H · 0M · 1L · 1IThe branch
- Purpose
- Fix Terraform apply failures caused by PostHog provider bug when detaching insights from dashboards
- Goal
- Stabilize posthog IaC so terraform apply succeeds; codify CFE delivery-health analytics insights (BAT-293)
- Sub-goals
- Codify CFE delivery-health insights (warehouse-backed) into IaC
- Remove broken tiles that referenced never-firing cfe_job.* events
- Work around provider limitation preventing dashboard_ids=[] on existing insights
The changes (whole branch)
- What
- infra/posthog/ — added warehouse-backed CFE delivery-health insights + dashboards (BAT-293), then iteratively fixed provider errors: removed non-renderable tiles, re-tiled dead insights with explicit dead labels as provider workaround
- Why
- PostHog Terraform provider throws 'inconsistent result after apply' when setting dashboard_ids=[] on an insight that already has a dashboard association. Re-tiling with a dead label is the only stable state until BAT-286 removes them properly.
- Areas
- infra/posthog/dashboards.tf+47−14infra/posthog/insights.tf+355−20
- Blast
- 2 files, +402/-34 lines, entirely within infra/posthog/. No app code, no migrations, no API surface touched.
terraform-provider-workaround dead-events BAT-286-tracks-cleanup
➖ci· no runner on pre-PR branch➖coderabbit· no .coderabbit.yaml➖tests· Terraform IaC — no unit tests by design
Findings · 2
conventions2
low
Spanish section comment in English-only Terraform file
infra/posthog/dashboards.tf:268
New tile section header is in Spanish ('Tiles muertos…') while all surrounding Terraform comments are in English. Suggest: '# ── Dead tiles (empty by design; superseded by warehouse insights) ──'
info
Redundant depends_on — reference in dashboard_ids already implies it
infra/posthog/insights.tf:657
Both insights reference posthog_dashboard.platform_health.id inside dashboard_ids, creating an implicit Terraform dependency. The explicit depends_on is redundant. Harmless — may have been added defensively given prior provider bugs.