diff --git a/services/libs/tinybird/pipes/organizations_filtered.pipe b/services/libs/tinybird/pipes/organizations_filtered.pipe index b00e86a3fa..4728a3425b 100644 --- a/services/libs/tinybird/pipes/organizations_filtered.pipe +++ b/services/libs/tinybird/pipes/organizations_filtered.pipe @@ -1,5 +1,19 @@ DESCRIPTION > - Provides filters for organizations + Provides filters for organizations. + Only returns organizations that have at least one code contribution (commits, PRs, code + reviews), matching what the organization page dashboard actually renders. Organizations + with only non-code activity — or that were deleted in CDP but are still stale in Tinybird — + are excluded so search never links to an empty org dashboard. + +NODE organizations_code_contributors +DESCRIPTION > + Distinct organizations that have at least one code contribution activity, sourced from the + precomputed org-page timeseries (already filtered to isCodeContribution activity types). + +SQL > + SELECT DISTINCT organizationId + FROM org_page_activities_timeseries_copy_ds + WHERE organizationId != '' NODE organizations_filtered_0 SQL > @@ -11,6 +25,8 @@ SQL > organizations_populated_slug.slug AS slug, organizations_populated_slug.contributionCount AS contributionCount FROM organizations_populated_slug + INNER JOIN organizations_code_contributors + ON organizations_populated_slug.id = organizations_code_contributors.organizationId where 1 = 1 {% if defined(slug) %} diff --git a/services/libs/tinybird/pipes/search_collections_projects_repos.pipe b/services/libs/tinybird/pipes/search_collections_projects_repos.pipe index eeacb3085c..de319c49f3 100644 --- a/services/libs/tinybird/pipes/search_collections_projects_repos.pipe +++ b/services/libs/tinybird/pipes/search_collections_projects_repos.pipe @@ -3,6 +3,7 @@ DESCRIPTION > - Performs search across four entity types using shared `search` parameter and returns up to configurable results per type. - Combines results from `collections_filtered`, `insightsProjects_filtered`, `activityRepositories_filtered`, and `organizations_filtered` pipes. - Filters out inactive projects (with 0 organizations and 0 contributors) to ensure relevant search results. + - Filters out organizations with no code contributions (via `organizations_filtered`) so search never links to an empty org dashboard. - Orders results by relevance: collections by project count, projects by contributor count, repositories alphabetically, organizations by contribution count. - Primary use case: powering global search functionality and autocomplete dropdowns across the platform. - Parameters: