Skip to content

fix: production bugs in stars_cumulative_count pipe (CM-1785) - #4768

Merged
themarolt merged 4 commits into
mainfrom
fix/CM-1785-stars-cumulative-count-node-name-collision
Sep 25, 2026
Merged

themarolt merged 4 commits into
mainfrom
fix/CM-1785-stars-cumulative-count-node-name-collision

Conversation

@themarolt

Copy link
Copy Markdown
Contributor

Summary

Two bugs found while performance-testing stars_cumulative_count.pipe against real projects in production (per request), both blocking the pipe entirely:

  • Node/pipe name collision: the pipe's terminal node was named stars_cumulative_count, identical to the pipe itself. Tinybird rejects this at push time (Nodes can't have the same exact name as the Pipe they belong to), so the pipe had never actually deployed until this fix. Renamed to stars_cumulative_count_final, matching the convention already used by every other multi-node pipe in this repo (e.g. activities_count.pipe's activity_count_merged). Cross-pipe callers resolve by pipe name, not node name, so nothing else needed to change.
  • Nullable column breaking a strict-typed lambda: granularity mode failed with Unexpected type of filter column: Nullable ... ILLEGAL_COLUMN. generate_timeseries.pipe's CASE WHEN has no ELSE, so endDate is typed Nullable(Date) even though it's always populated for a valid granularity. The arrayFirst lambda in stars_github_bucketed requires a strict, non-nullable UInt8 boolean, which a Nullable comparison can't produce. Fixed narrowly with assumeNotNull() on just that comparison, rather than touching generate_timeseries.pipe itself (shared infra for every activity/contributor/metric pipe in the repo).

Test plan

Both fixes pushed to lfx_insights (production) and verified against real project data:

  • Summary mode: opentf, longhorn, keystone - all return correct totals in 0.2-0.4s
  • Granularity mode (monthly): same 3 projects - correct, monotonic per-bucket totals in under 2s (previously failed on all 3)

… name collision (CM-1785)

tb push rejects a node with the exact same name as its pipe - "Nodes
can't have the same exact name as the Pipe they belong to." This pipe's
last node was named stars_cumulative_count, identical to the pipe file,
so it never actually deployed until now. Renamed to
stars_cumulative_count_final, matching the convention every other
multi-node pipe in this repo already follows (e.g. activities_count.pipe's
activity_count_merged, activities_cumulative_count.pipe's
cumulative_activity_count). No other file references the node by name -
cross-pipe callers (stars_count.pipe's stars_count_bucketed) resolve by
pipe name, not node name, so they're unaffected.

Signed-off-by: Uroš Marolt <uros@marolt.me>
Granularity mode for `stars_cumulative_count` failed in production with
`Unexpected type of filter column: Nullable ... ILLEGAL_COLUMN`.

`ds.endDate` comes from `generate_timeseries.pipe`'s CASE WHEN block, which
has no ELSE branch - ClickHouse types the column as Nullable(Date) even
though it's always populated for a valid granularity value. The
`arrayFirst` lambda in `stars_github_bucketed` compares against it and
requires a strict, non-nullable UInt8 boolean result, which a Nullable
comparison can't produce.

Wrapped just this comparison in assumeNotNull() instead of touching
generate_timeseries.pipe itself, since that pipe is shared infrastructure
for every activity/contributor/metric pipe in the repo and widening its
blast radius isn't warranted for a one-node fix.

Verified against production data (opentf, longhorn, keystone projects,
monthly granularity) after pushing to lfx_insights - previously failing
queries now return correct, monotonic per-bucket totals in under 2s.

Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI balanced review requested due to automatic review settings September 25, 2026 09:08
@cursor

cursor Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Narrow SQL/node renames in one insights pipe; fixes broken deploy and granularity path with no API contract changes.

Overview
Unblocks deployment and granularity mode for the stars_cumulative_count Tinybird pipe.

The terminal node is renamed from stars_cumulative_count to stars_cumulative_count_final so it no longer matches the pipe name (Tinybird rejects that at push time). In bucketed GitHub star logic, the arrayFirst filter now uses assumeNotNull(ds.endDate) so the lambda gets a strict boolean instead of failing on Nullable(Date) from generate_timeseries.

Pipe DESCRIPTION text is lightly edited (ticket refs removed); response shape and callers are unchanged.

Reviewed by Cursor Bugbot for commit 7b0c981. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

Both targeted fixes are consistent with Tinybird behavior and have production validation.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes two deployment-blocking issues in the cumulative stars Tinybird pipe.

Changes:

  • Handles nullable generated bucket end dates.
  • Renames the terminal node to avoid a pipe-name collision.
File Description
services/​libs/​tinybird/​pipes/​stars_cumulative_count.pipe Fixes nullable comparison and terminal node naming.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 25, 2026 09:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

Both focused changes correctly address the reported Tinybird deployment and query failures.

Review effort: Balanced
Findings: None

@themarolt
themarolt requested a review from epipav September 25, 2026 10:25
…scription (CM-1785)

Per review feedback: pipe DESCRIPTION blocks shouldn't carry ticket
numbers that go stale once the work ships. Reworded the same points
without the CM-XXX references.

Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI review requested due to automatic review settings September 25, 2026 10:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused changes correctly address both reported Tinybird failures without altering the pipe’s external contract.

Review effort: Balanced
Findings: None

@themarolt
themarolt requested a review from epipav September 25, 2026 10:42
@themarolt
themarolt merged commit fe46a9b into main Sep 25, 2026
15 checks passed
@themarolt
themarolt deleted the fix/CM-1785-stars-cumulative-count-node-name-collision branch September 25, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants