Repository navigation
fix: repair repos filter in issue/PR resolve-velocity pipes (DE-1063) - #4782
Conversation
Production had drifted from git with an invalid lower(channel) IN arrayMap(...) rewrite that ClickHouse rejects (400: Function 'in' is supported only if second argument is constant or table expression), breaking the Issues resolution and Pull requests widgets on every single-repo Development page. Restore a valid IN-subquery form that also preserves IN-1307's lowercase channel matching. Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
PR SummaryMedium Risk Overview When No other parameters or query logic change; only the Reviewed by Cursor Bugbot for commit 641ba4d. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The predicates are valid, consistently formatted, and align with upstream channel normalization.
Review effort: Balanced
Findings: None
What changed in this PR
Repairs repository filtering in issue and pull-request resolution velocity Tinybird pipes.
Changes:
- Uses a valid
INsubquery for repository filtering. - Lowercases repository parameters to match normalized channel data.
| File | Description |
|---|---|
pull_requests_average_resolve_velocity.pipe |
Fixes repository filtering for PR velocity. |
issues_average_resolve_velocity.pipe |
Fixes repository filtering for issue velocity. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
issues_average_resolve_velocity.pipeandpull_requests_average_resolve_velocity.pipe: someone hand-edited thereposfilter branch directly on the deployed pipes tolower(channel) IN arrayMap(x -> lower(x), [...]), which ClickHouse rejects (Function 'in' is supported only if second argument is constant or table expression).reposfilter).IN (SELECT lower(arrayJoin(...)))subquery form, which ClickHouse accepts and which preserves IN-1307's lowercasechannelmatching (verified against 0 mixed-case rows across 16.9M + 39.4M rows in the underlying datasources, and re-verified against a real uppercase-URL repo, 10up/ElasticPress).Root cause
Insights-layer code was correct throughout (
getBucketIdForProject,activityTypes_filtereddefaults,segments_filteredproject resolution were all ruled out as contributing causes). The bug was isolated entirely to a drifted Tinybird pipe definition — production had a differentreposfilter branch than what was committed onorigin/main.Validation (already deployed to production by crowd-tinybird-manager prior to this PR)
400forrepos-filtered calls.issues_average_resolve_velocity.pipe— staging'sissues_analyzeddatasource is missing thechannelcolumn entirely (pre-existing gap, unrelated to this fix, flagged separately).Test plan
JIRA: DE-1063 (https://linuxfoundation.atlassian.net/browse/DE-1063)
linuxfoundation/insights#2301