Skip to content

Commit 6c91e71

Browse files
authored
feat: filter org search to code contributors only (IN-1206) (#4371)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent 264ae43 commit 6c91e71

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

services/libs/tinybird/pipes/organizations_filtered.pipe

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
DESCRIPTION >
2-
Provides filters for organizations
2+
Provides filters for organizations.
3+
Only returns organizations that have at least one code contribution (commits, PRs, code
4+
reviews), matching what the organization page dashboard actually renders. Organizations
5+
with only non-code activity — or that were deleted in CDP but are still stale in Tinybird —
6+
are excluded so search never links to an empty org dashboard.
7+
8+
NODE organizations_code_contributors
9+
DESCRIPTION >
10+
Distinct organizations that have at least one code contribution activity, sourced from the
11+
precomputed org-page timeseries (already filtered to isCodeContribution activity types).
12+
13+
SQL >
14+
SELECT DISTINCT organizationId
15+
FROM org_page_activities_timeseries_copy_ds
16+
WHERE organizationId != ''
317

418
NODE organizations_filtered_0
519
SQL >
@@ -11,6 +25,8 @@ SQL >
1125
organizations_populated_slug.slug AS slug,
1226
organizations_populated_slug.contributionCount AS contributionCount
1327
FROM organizations_populated_slug
28+
INNER JOIN organizations_code_contributors
29+
ON organizations_populated_slug.id = organizations_code_contributors.organizationId
1430
where
1531
1 = 1
1632
{% if defined(slug) %}

services/libs/tinybird/pipes/search_collections_projects_repos.pipe

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DESCRIPTION >
33
- Performs search across four entity types using shared `search` parameter and returns up to configurable results per type.
44
- Combines results from `collections_filtered`, `insightsProjects_filtered`, `activityRepositories_filtered`, and `organizations_filtered` pipes.
55
- Filters out inactive projects (with 0 organizations and 0 contributors) to ensure relevant search results.
6+
- Filters out organizations with no code contributions (via `organizations_filtered`) so search never links to an empty org dashboard.
67
- Orders results by relevance: collections by project count, projects by contributor count, repositories alphabetically, organizations by contribution count.
78
- Primary use case: powering global search functionality and autocomplete dropdowns across the platform.
89
- Parameters:

0 commit comments

Comments
 (0)