From a9f979417fcecad78efd0b882614f8d5290eb414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C5=A1per=20Grom?= Date: Mon, 28 Sep 2026 09:13:06 +0100 Subject: [PATCH] fix: repair repos filter in issue/PR resolve-velocity pipes (DE-1063) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../pipes/issues_average_resolve_velocity.pipe | 17 +++++++++++++++-- .../pull_requests_average_resolve_velocity.pipe | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/services/libs/tinybird/pipes/issues_average_resolve_velocity.pipe b/services/libs/tinybird/pipes/issues_average_resolve_velocity.pipe index b2c3e55ff5..12eb526e99 100644 --- a/services/libs/tinybird/pipes/issues_average_resolve_velocity.pipe +++ b/services/libs/tinybird/pipes/issues_average_resolve_velocity.pipe @@ -25,8 +25,21 @@ SQL > {% else %} segmentId = (SELECT segmentId FROM segments_filtered) {% end %} AND isNotNull(closedAt) {% if defined(repos) %} - AND channel - IN {{ Array(repos, 'String', description="Filter activity repo list", required=False) }} + AND channel IN ( + SELECT + lower( + arrayJoin( + {{ + Array( + repos, + 'String', + description="Filter activity repo list", + required=False, + ) + }} + ) + ) + ) {% else %} AND channel IN (SELECT channel FROM repos_to_channels) {% end %} {% if defined(startDate) %} diff --git a/services/libs/tinybird/pipes/pull_requests_average_resolve_velocity.pipe b/services/libs/tinybird/pipes/pull_requests_average_resolve_velocity.pipe index 0abe59e0f6..8edf425339 100644 --- a/services/libs/tinybird/pipes/pull_requests_average_resolve_velocity.pipe +++ b/services/libs/tinybird/pipes/pull_requests_average_resolve_velocity.pipe @@ -26,8 +26,21 @@ SQL > {% else %} segmentId = (SELECT segmentId FROM segments_filtered) {% end %} AND isNotNull(resolvedAt) AND resolvedInSeconds > 0 AND platform != 'gerrit' {% if defined(repos) %} - AND channel - IN {{ Array(repos, 'String', description="Filter activity repo list", required=False) }} + AND channel IN ( + SELECT + lower( + arrayJoin( + {{ + Array( + repos, + 'String', + description="Filter activity repo list", + required=False, + ) + }} + ) + ) + ) {% else %} AND channel IN (SELECT channel FROM repos_to_channels) {% end %} {% if defined(startDate) %}