Skip to content

Commit c1cc168

Browse files
committed
fix: run tb fmt on collections widget pipes (IN-1195)
CI's Datafiles checks job runs `tb fmt --diff` on every changed pipe; these 5 files had formatting drift. pull_requests_filtered.pipe needed a small WHERE-clause reorder (AND is commutative, no behavior change) because tb fmt oscillates indefinitely on the original `{% end %} AND pra.channel IN (...)` line. Confirmed with the exact CI-pinned tinybird-cli==5.22.2 binary that re-running `tb fmt --yes` on that line flips between a collapsed and expanded form forever, so no direct reformat converges. Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent 508459a commit c1cc168

5 files changed

Lines changed: 10 additions & 13 deletions

File tree

services/libs/tinybird/pipes/active_contributors.pipe

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ SQL >
5959
{% if defined(collectionSlug) %}
6060
insightsProjectId IN (SELECT insightsProjectId FROM segments_filtered_by_collection)
6161
{% else %} insightsProjectId = (SELECT insightsProjectId FROM segments_filtered)
62-
{% end %}
63-
AND role = 'maintainer'
62+
{% end %} AND role = 'maintainer'
6463
{% if defined(repos) %}
6564
AND repoUrl
6665
IN {{ Array(repos, 'String', description="Filter maintainer repo list", required=False) }}

services/libs/tinybird/pipes/collection_insights_aggregate.pipe

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ DESCRIPTION >
1010
- `projectCount`: count of distinct projects in the collection.
1111
- `uniqueContributorCount`: total unique contributors across all projects in the collection, deduplicated (a contributor active on multiple projects in the collection is counted once).
1212
- `avgHealthScore`: average health score across the collection's onboarded projects, rounded. A project
13-
is "onboarded" when it has at least one contributor or organization attributed to it (same definition
14-
used by insightsProjects_filtered.pipe's `onboarded` filter and the frontend's project-row `isOnboarded`
15-
check) — projects with no attributed contributors/organizations have no meaningful health signal yet
16-
and would otherwise pull the average down artificially.
13+
is "onboarded" when it has at least one contributor or organization attributed to it (same definition
14+
used by insightsProjects_filtered.pipe's `onboarded` filter and the frontend's project-row `isOnboarded`
15+
check) — projects with no attributed contributors/organizations have no meaningful health signal yet
16+
and would otherwise pull the average down artificially.
1717

1818
TAGS "Insights, Widget", "Collection"
1919

services/libs/tinybird/pipes/contributors_leaderboard.pipe

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ SQL >
4040
NODE is_request_from_non_lf_project
4141
SQL >
4242
%
43-
{% if defined(collectionSlug) %}
44-
SELECT false AS result
43+
{% if defined(collectionSlug) %} SELECT false AS result
4544
{% else %}
4645
SELECT not isLF AS result
4746
FROM insightsProjects final

services/libs/tinybird/pipes/pull_requests_filtered.pipe

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ SQL >
1919
SELECT *
2020
FROM pull_requests_analyzed pra
2121
WHERE
22+
pra.channel IN (SELECT channel FROM repos_to_channels)
2223
{% if defined(collectionSlug) %}
23-
pra.segmentId IN (SELECT segmentId FROM segments_filtered_by_collection)
24-
{% else %} pra.segmentId = (SELECT segmentId FROM segments_filtered)
24+
AND pra.segmentId IN (SELECT segmentId FROM segments_filtered_by_collection)
25+
{% else %} AND pra.segmentId = (SELECT segmentId FROM segments_filtered)
2526
{% end %}
26-
AND pra.channel IN (SELECT channel FROM repos_to_channels)

services/libs/tinybird/pipes/search_volume.pipe

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ SQL >
2323
FROM searchVolume FINAL
2424
WHERE
2525
{% if defined(collectionSlug) %}
26-
insightsProjectId
27-
IN (select toUUID(insightsProjectId) from segments_filtered_by_collection)
26+
insightsProjectId IN (select toUUID(insightsProjectId) from segments_filtered_by_collection)
2827
{% else %} insightsProjectId = toUUID((select insightsProjectId from segments_filtered))
2928
{% end %}
3029
{% if defined(startDate) %}

0 commit comments

Comments
 (0)