feat(analytics-api): collab Messaging peer-counter query + catalog seed (#1527) - #1568
feat(analytics-api): collab Messaging peer-counter query + catalog seed (#1527)#1568mozhaev-dev wants to merge 1 commit into
Conversation
…ed (#1527) PR B of the #1527 split — the backend layer over PR A's gold view. Clones the #1514 AI-personal counter pattern for the collaboration Messaging modality. - Query_ref migration (m20260702_000001): `collab_messaging_counters_qr` reads insight.collab_person_counter_daily, re-aggregates per person with the honest-NULL `if(countIf(x IS NOT NULL) > 0, sumIf …, NULL)` wrapper, ARRAY JOIN unpivot (drops NULLs), and LEFT JOINs per-org_unit_id `quantileExact` bands. Stored on metrics id …0053 (next free after AI counters …0052). - Catalog seed (m20260702_000002): product-default metric_catalog rows for `messages_sent` + `channel_posts`, each with an initial product-default metric_threshold (catalog-probe requirement) and a metric_query_catalog junction link to the query. source_tags carry the vendors (m365/slack/zulip). Thresholds are initial defaults, NOT calibrated (per-org_unit calibration is a post-release follow-up). - Register both migrations in mod.rs. Tests: - Rust unit (feeds #1433): asserts the generated peer-counter SQL emits both keys with the honest-NULL wrapper + per-org_unit band join — no DB, runs in CI coverage. - Extend catalog live_tests (`product_default_wins_when_no_tenant_overlay`) to assert both Messaging keys resolve at product-default. Designed for extension: later modalities add keys to the ARRAY JOIN list + seed rows. Depends on the gold view from PR A (#1567) at deploy time. Honest-NULL rendering is #1517. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Sergei Mozhaev <mozhaev.dev@gmail.com>
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ 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 |
PR B of the #1527 split — the backend layer over PR A's gold view (#1567). Clones the #1514 AI-personal counter pattern for the collaboration Messaging modality.
Split plan: A gold view (#1567) → B (this) → C e2e YAML → D FE (insight-front).
Changes
m20260702_000001_collab_messaging_queries—collab_messaging_counters_qr:insight.collab_person_counter_daily(PR A), re-aggregates per person with the honest-NULLif(countIf(x IS NOT NULL) > 0, sumIf(x, …), NULL)wrapper,org_unit_idquantileExactbands (median/p25/p75 + min/max/count).metrics.id…0053(next free after AI counters…0052).m20260702_000002_seed_collab_messaging_catalog— product-defaultmetric_catalogrows formessages_sent+channel_posts, each with an initial product-defaultmetric_threshold(catalog-probe requirement) and ametric_query_catalogjunction link.source_tagscarry the vendors (["m365","slack","zulip"]/["m365","slack"]).mod.rs.Tests
(metric_key, org_unit_id).domain/catalog/live_tests.rs::product_default_wins_when_no_tenant_overlayto assert both Messaging keys resolve at product-default (#[ignore], needs MariaDB — not in CI coverage).Scope / notes
Refs #1527 · #1516
🤖 Generated with Claude Code