feat(insights): harden investigations, revenue, and delivery#565
feat(insights): harden investigations, revenue, and delivery#565izadoesdev wants to merge 11 commits into
Conversation
|
Too many files changed for review. ( Bypass the limit by tagging |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Unkey Deploy
|
Deployment gate
Do not deploy the application before the additive PostgreSQL schema is present.
insight_generation_configs.dispatch_due_atautumn_webhook_eventsusage_alert_log.organization_idinsight_run_items.config_snapshotlinks_org_created_at_id_idxThis PR performs no destructive ClickHouse DDL. The two legacy hourly vitals objects remain an explicit, approval-gated cleanup for existing clusters.
What changed
Quality evidence
bun run lint: 1,587 files clean.bun run check-types: 37/37 tasks pass.bun run test: 28/28 tasks pass; AI 3,995 pass / 27 integration skips; zero failures.bun run eval:insights: 14 timelines, 17 stages, 9 insights, zero gate failures; deterministic across repeats.Rollout posture
The scheduler and workers stay off by default. Start with a manually inspected staging run, then a small canary. Destructive ClickHouse cleanup and the larger physical revenue-table migration are intentionally deferred.
Summary by cubic
Hardens the insights pipeline, revenue reporting, and payment diagnostics: deterministic investigations, replay‑safe billing ingestion, and safer delivery with clearer UI and docs. Rollout is gated behind new env flags with a canary allowlist.
New Features
apps/basket/src/routes/webhooks/stripe-normalization.ts) unifies sales, subscriptions, refunds, failure reasons, and attribution; revenue UI adds currency‑aware formatting/filters with a neutral fallback for invalid configs; payment failure diagnostics are scoped to active filters and only shown when data is available.private, no-storecaching, and non‑reflective validation errors in production.INSIGHTS_SCHEDULED_DISPATCH_ENABLEDandINSIGHTS_SCHEDULED_ORGANIZATION_IDS; rollup/run tie‑breakers and recovery sweeps added; investigation upgrades (custom‑event disappearance, currency‑scoped revenue signals, revenue‑transaction confirmation); ClickHouse test doubles isolated for reliability.Migration
insight_generation_configs.dispatch_due_at,autumn_webhook_events,usage_alert_log.organization_id, default forinsight_run_items.config_snapshot,links_org_created_at_id_idx, plus included partial unique/index changes.INSIGHTS_SCHEDULED_DISPATCH_ENABLED=false,INSIGHTS_SCHEDULED_ORGANIZATION_IDS=""(comma‑separated IDs); keep workers off by default and enable via allowlist after a manual staging run.Written for commit ecd1173. Summary will update on new commits.