From 49f194945ed0dafc708dbbaacf4f7be5d9e514ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C5=A1per=20Grom?= Date: Sat, 18 Jul 2026 12:07:49 +0100 Subject: [PATCH] fix: include community collections in collectionsSlugs (IN-1195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit collection_insights_aggregate reported 0 contributors and no health score for community (non-LF) collections because insights_projects_populated_copy excluded them via isNull(c.ssoUserId) when building collectionsSlugs. Drop that filter so community collection memberships are populated too. Downstream leaderboard and insightsProjects_filtered pipes only apply the collectionsSlugs filter when an explicit collectionSlug param is passed, so un-scoped listings are unaffected. Claude-Session: https://claude.ai/code/session_014Fc86j8FLeWFAs3fDCQs38 Signed-off-by: Gašper Grom --- .../pipes/insights_projects_populated_copy.pipe | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/libs/tinybird/pipes/insights_projects_populated_copy.pipe b/services/libs/tinybird/pipes/insights_projects_populated_copy.pipe index 3351ba8f10..d874ab6efe 100644 --- a/services/libs/tinybird/pipes/insights_projects_populated_copy.pipe +++ b/services/libs/tinybird/pipes/insights_projects_populated_copy.pipe @@ -1,12 +1,18 @@ NODE insights_projects_populated_copy_collections_slugs DESCRIPTION > - Returns collection slugs per project + Returns collection slugs per project, for both curated (ssoUserId IS NULL) and + community (ssoUserId IS NOT NULL) collections. Community collections were previously + excluded here, which left their slugs out of collectionsSlugs and caused + collection_insights_aggregate to report 0 contributors / no health for them (IN-1195). + Downstream leaderboard/insightsProjects_filtered pipes only apply the collectionsSlugs + filter when an explicit collectionSlug param is passed, so including community slugs does + not change any un-scoped listing. SQL > SELECT cip.insightsProjectId, groupArray(c.slug) AS "collectionsSlugs" FROM collectionsInsightsProjects cip FINAL JOIN collections c FINAL ON c.id = cip.collectionId - WHERE isNull (c.deletedAt) AND isNull (c.ssoUserId) AND isNull (cip.deletedAt) + WHERE isNull (c.deletedAt) AND isNull (cip.deletedAt) GROUP BY cip.insightsProjectId NODE insights_projects_populated_copy_segment_id_mapping