From 21bf1ba3f75e2e88c0cb7a3cdf0768dc8c18e324 Mon Sep 17 00:00:00 2001 From: Joana Maia Date: Mon, 30 Mar 2026 13:21:05 +0100 Subject: [PATCH 1/4] fix: gerrit repositories filtering (CM-1079) Signed-off-by: Joana Maia --- ...tions_bucket_clean_enrich_copy_pipe_0.pipe | 5 +--- ...tions_bucket_clean_enrich_copy_pipe_1.pipe | 5 +--- ...tions_bucket_clean_enrich_copy_pipe_2.pipe | 5 +--- ...tions_bucket_clean_enrich_copy_pipe_3.pipe | 5 +--- ...tions_bucket_clean_enrich_copy_pipe_4.pipe | 5 +--- ...tions_bucket_clean_enrich_copy_pipe_5.pipe | 5 +--- ...tions_bucket_clean_enrich_copy_pipe_6.pipe | 5 +--- ...tions_bucket_clean_enrich_copy_pipe_7.pipe | 5 +--- ...tions_bucket_clean_enrich_copy_pipe_8.pipe | 5 +--- ...tions_bucket_clean_enrich_copy_pipe_9.pipe | 5 +--- .../tinybird/pipes/repos_to_channels.pipe | 23 +++++++++++-------- 11 files changed, 23 insertions(+), 50 deletions(-) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_0.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_0.pipe index 00b8f9241d..956ec3a0a2 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_0.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_0.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_0.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_1.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_1.pipe index 61ee900921..b1fc326f46 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_1.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_1.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_1.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_2.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_2.pipe index ddebb000a5..f5186a7f20 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_2.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_2.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_2.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_3.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_3.pipe index 0800087faa..afe662f168 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_3.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_3.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_3.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_4.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_4.pipe index d8ad2393a6..f1e1f058e3 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_4.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_4.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_4.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_5.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_5.pipe index 68edc301d6..eaae8c9b30 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_5.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_5.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_5.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_6.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_6.pipe index e2bb209a8d..d9de878a1a 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_6.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_6.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_6.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_7.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_7.pipe index f0a4ef5ca7..56bd72bdb5 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_7.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_7.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_7.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_8.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_8.pipe index 87acb15cb0..dd9659055d 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_8.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_8.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_8.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_9.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_9.pipe index 0cb64dc1d8..ed024bf301 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_9.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_9.pipe @@ -37,10 +37,7 @@ SQL > ( platform IN ('git', 'gerrit', 'github', 'gitlab') AND (channel, activityRelations_bucket_MV_ds_9.segmentId) IN ( - SELECT r.url, r.segmentId - FROM repositories r FINAL - INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id - WHERE isNull (r.deletedAt) AND isNull (i.deletedAt) AND r.enabled = true + SELECT channel, segmentId FROM repos_to_channels ) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') diff --git a/services/libs/tinybird/pipes/repos_to_channels.pipe b/services/libs/tinybird/pipes/repos_to_channels.pipe index 0e321ede91..714ff4313d 100644 --- a/services/libs/tinybird/pipes/repos_to_channels.pipe +++ b/services/libs/tinybird/pipes/repos_to_channels.pipe @@ -6,7 +6,7 @@ DESCRIPTION > - Parameters: - `repos`: Optional array of repository URLs to expand. If not provided, defaults to all enabled repositories. - `excluded`: Optional boolean. When true, expands excluded repositories instead of enabled ones. Used to build exclusion filters. - - Response: `channel` - all possible channel URL formats for the given repos + - Response: `channel` - all possible channel URL formats for the given repos; `segmentId` - segment the repo belongs to (empty string when repos param is provided) TAGS "Repository URLs", "Gerrit" @@ -20,13 +20,15 @@ SQL > SELECT arrayJoin( {{ Array(repos, 'String', description="Repository URLs to expand", required=False) }} - ) AS url + ) AS url, + '' AS segmentId {% else %} - SELECT url - FROM repositories FINAL + SELECT r.url, r.segmentId + FROM repositories r FINAL + INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id WHERE - isNull (deletedAt) AND enabled = true - {% if defined(excluded) and excluded %} AND excluded = true + isNull (r.deletedAt) AND r.enabled = true AND isNull (i.deletedAt) + {% if defined(excluded) and excluded %} AND r.excluded = true {% end %} {% end %} @@ -35,7 +37,7 @@ DESCRIPTION > Identify Gerrit repositories by joining with integrations table SQL > - SELECT r.url + SELECT r.url, r.segmentId FROM repositories r FINAL JOIN integrations i FINAL ON r.sourceIntegrationId = i.id WHERE i.platform = 'gerrit' AND isNull (r.deletedAt) AND r.url IN (SELECT url FROM repos_to_expand) @@ -46,7 +48,7 @@ DESCRIPTION > SQL > -- Original URLs (all repos) - SELECT url AS channel + SELECT url AS channel, segmentId FROM repos_to_expand UNION ALL -- Gerrit channel variants: insert q/project: after the base path @@ -67,7 +69,8 @@ SQL > '/q/project:', if(path(url) = '/', '', substring(path(url), 2)) ) - END AS channel + END AS channel, + segmentId FROM gerrit_repos NODE channels_deduplicated @@ -75,4 +78,4 @@ DESCRIPTION > Final deduplicated list of all possible channel URLs SQL > - SELECT DISTINCT channel FROM expanded_urls + SELECT DISTINCT channel, segmentId FROM expanded_urls From 5907e73d95875dd53a9e0c3f49deec9e4d2992c3 Mon Sep 17 00:00:00 2001 From: Joana Maia Date: Mon, 30 Mar 2026 14:29:10 +0100 Subject: [PATCH 2/4] fix: exclusion repos rules Signed-off-by: Joana Maia --- services/libs/tinybird/pipes/repos_to_channels.pipe | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/libs/tinybird/pipes/repos_to_channels.pipe b/services/libs/tinybird/pipes/repos_to_channels.pipe index 714ff4313d..ee879786e8 100644 --- a/services/libs/tinybird/pipes/repos_to_channels.pipe +++ b/services/libs/tinybird/pipes/repos_to_channels.pipe @@ -40,7 +40,13 @@ SQL > SELECT r.url, r.segmentId FROM repositories r FINAL JOIN integrations i FINAL ON r.sourceIntegrationId = i.id - WHERE i.platform = 'gerrit' AND isNull (r.deletedAt) AND r.url IN (SELECT url FROM repos_to_expand) + INNER JOIN insightsProjects p FINAL ON r.insightsProjectId = p.id + WHERE + i.platform = 'gerrit' + AND isNull (r.deletedAt) + AND r.enabled = true + AND isNull (p.deletedAt) + AND r.url IN (SELECT url FROM repos_to_expand) NODE expanded_urls DESCRIPTION > From acd42a74eba769a858b500249c6d26b55475af4b Mon Sep 17 00:00:00 2001 From: Joana Maia Date: Mon, 30 Mar 2026 14:33:04 +0100 Subject: [PATCH 3/4] fix: formatting Signed-off-by: Joana Maia --- .../activityRelations_bucket_clean_enrich_copy_pipe_0.pipe | 5 ++--- .../activityRelations_bucket_clean_enrich_copy_pipe_1.pipe | 5 ++--- .../activityRelations_bucket_clean_enrich_copy_pipe_2.pipe | 5 ++--- .../activityRelations_bucket_clean_enrich_copy_pipe_3.pipe | 5 ++--- .../activityRelations_bucket_clean_enrich_copy_pipe_4.pipe | 5 ++--- .../activityRelations_bucket_clean_enrich_copy_pipe_5.pipe | 5 ++--- .../activityRelations_bucket_clean_enrich_copy_pipe_6.pipe | 5 ++--- .../activityRelations_bucket_clean_enrich_copy_pipe_7.pipe | 5 ++--- .../activityRelations_bucket_clean_enrich_copy_pipe_8.pipe | 5 ++--- .../activityRelations_bucket_clean_enrich_copy_pipe_9.pipe | 5 ++--- 10 files changed, 20 insertions(+), 30 deletions(-) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_0.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_0.pipe index 956ec3a0a2..848fc45ef2 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_0.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_0.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_0.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_0.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_1.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_1.pipe index b1fc326f46..0efa5978c2 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_1.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_1.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_1.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_1.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_2.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_2.pipe index f5186a7f20..6f583d89e1 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_2.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_2.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_2.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_2.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_3.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_3.pipe index afe662f168..3beebf43cd 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_3.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_3.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_3.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_3.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_4.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_4.pipe index f1e1f058e3..b2af521676 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_4.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_4.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_4.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_4.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_5.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_5.pipe index eaae8c9b30..5adb1c2b18 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_5.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_5.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_5.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_5.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_6.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_6.pipe index d9de878a1a..32004341a6 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_6.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_6.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_6.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_6.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_7.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_7.pipe index 56bd72bdb5..8580ca47c6 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_7.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_7.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_7.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_7.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_8.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_8.pipe index dd9659055d..1b2dc032ff 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_8.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_8.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_8.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_8.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) diff --git a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_9.pipe b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_9.pipe index ed024bf301..065f2909d1 100644 --- a/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_9.pipe +++ b/services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_9.pipe @@ -36,9 +36,8 @@ SQL > and ( ( platform IN ('git', 'gerrit', 'github', 'gitlab') - AND (channel, activityRelations_bucket_MV_ds_9.segmentId) IN ( - SELECT channel, segmentId FROM repos_to_channels - ) + AND (channel, activityRelations_bucket_MV_ds_9.segmentId) + IN (SELECT channel, segmentId FROM repos_to_channels) ) OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab') ) From dec518e92b6cf506d014e2b5a240122ea0f6eadf Mon Sep 17 00:00:00 2001 From: Joana Maia Date: Mon, 30 Mar 2026 14:43:06 +0100 Subject: [PATCH 4/4] fix: ambiguity in returned data Signed-off-by: Joana Maia --- services/libs/tinybird/pipes/repos_to_channels.pipe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/libs/tinybird/pipes/repos_to_channels.pipe b/services/libs/tinybird/pipes/repos_to_channels.pipe index ee879786e8..19e6de8670 100644 --- a/services/libs/tinybird/pipes/repos_to_channels.pipe +++ b/services/libs/tinybird/pipes/repos_to_channels.pipe @@ -23,7 +23,7 @@ SQL > ) AS url, '' AS segmentId {% else %} - SELECT r.url, r.segmentId + SELECT r.url AS url, r.segmentId AS segmentId FROM repositories r FINAL INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id WHERE @@ -37,7 +37,7 @@ DESCRIPTION > Identify Gerrit repositories by joining with integrations table SQL > - SELECT r.url, r.segmentId + SELECT r.url AS url, r.segmentId AS segmentId FROM repositories r FINAL JOIN integrations i FINAL ON r.sourceIntegrationId = i.id INNER JOIN insightsProjects p FINAL ON r.insightsProjectId = p.id