Repository navigation
fix: baseline stars_count first bucket against startDate, not 0 (CM-1819) - #4791
Conversation
…819) Signed-off-by: Uroš Marolt <uros@marolt.me>
PR SummaryLow Risk Overview Adds Reviewed by Cursor Bugbot for commit fbbff7f. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The documentation incorrectly claims the fix works regardless of snapshot backfill completeness.
Review effort: Balanced
Findings: 1
What changed in this PR
Fixes inflated first-bucket star deltas by baselining against cumulative stars at startDate.
Changes:
- Adds a GitHub and non-GitHub baseline node.
- Uses the baseline as
lagInFrame’s default value. - Updates pipe documentation.
| File | Description |
|---|---|
services/libs/tinybird/pipes/stars_count.pipe |
Corrects first-bucket star calculations and documents the behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…-1819) Signed-off-by: Uroš Marolt <uros@marolt.me>
…uxfoundation/crowd.dev into fix/CM-1819-stars-count-first-bucket

Summary
Fixes the Stars widget's "New" tab showing an inflated spike in the first bucket of any date range -
stars_count.pipenow baselines the first bucket against the real cumulative total as ofstartDateinstead of 0.Changes
stars_count_baselinenode: computes cumulative stars total as ofstartDate(mirrorsstars_count_summary's existinggithub_at_start/gitlab_newlogic).stars_count_bucketed: pass the baseline aslagInFrame's owndefaultargument instead of viacoalesce()after the call - ClickHouse'slagInFramealready returns0(notNULL) for a missing prior row, so the previouscoalesce(lagInFrame(...), baseline)pattern never triggered the fallback.coalesce((SELECT baseline FROM stars_count_baseline), 0)to avoid a ClickHouse type mismatch (Nullable(Int64)vsInt64) when passed aslagInFrame's default.Verified live on production (
lfx_insights) against two independent projects (k8s, heroic-games-launcher) - first bucket now matches expected deltas instead of the pre-range cumulative total.Type of change
JIRA ticket
https://linuxfoundation.atlassian.net/browse/CM-1819