feat: filter org search to code contributors only (IN-1206)#4371
Conversation
The global search org results come from organizations_populated_slug, whose contributionCount counts all activities (countState(activityId)), not just code contributions. As a result ~62% of searchable orgs had activity but zero code contributions and linked to an empty organization dashboard, which only renders isCodeContribution activity types. Orgs deleted in CDP also linger as stale rows in Tinybird. Restrict organizations_filtered to orgs present in org_page_activities_timeseries_copy_ds (already scoped to isCodeContribution activity types over a 10-year window), matching what the org page shows. This sub-pipe is consumed only by the search pipe, so org pages and leaderboards are unaffected. Searchable orgs drop from 519k to 199k; stale high-activity orgs with no code contributions no longer appear. Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
PR SummaryMedium Risk Overview
Scope is search only — Reviewed by Cursor Bugbot for commit 98f89e6. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Pull request overview
Filters organization search results to organizations with code contributions visible on organization dashboards.
Changes:
- Adds a code-contributor organization filter using the precomputed activity datasource.
- Documents the filtering behavior in the global search pipe.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
organizations_filtered.pipe |
Joins organizations against code-contribution activity. |
search_collections_projects_repos.pipe |
Documents organization filtering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Filters the global search organization results down to orgs that actually have code contributions, so search never links to an empty organization dashboard. Follow-up to #4368, backs insights ticket IN-1206.
Why
The org results in global search come from
organizations_populated_slug, ordered bycontributionCount. ThatcontributionCountiscountState(activityId)— it counts all activities, not just code contributions. Meanwhile the organization page dashboard only renders activity where(type, platform)matches anactivityTypesrow withisCodeContribution = true.Verified against prod Tinybird:
contributionCount > 0, so a naivecontributionCount = 0filter is a no-op).Orgs deleted in CDP also linger as stale rows in Tinybird — this filter drops those too, since they have no code-contribution activity.
How
organizations_filtered.pipenowINNER JOINs against the distinct set of org IDs inorg_page_activities_timeseries_copy_ds— the precomputed datasource that is already scoped toisCodeContributionactivity types (10-year window), i.e. the exact definition the org page uses. Only orgs that would render something on the dashboard survive.organizations_filteredis consumed only bysearch_collections_projects_repos.pipe, so org pages, leaderboards, and the sharedorganizations_populated_slugdatasource are unaffected.Result (validated on prod)
Deploy order
Test plan
contributionCount = 0filter is a no-op (0 rows) — wrong approach.org_page_activities_timeseries_copy_dsjoin removes non-code orgs (Eventual Inc et al.) and preserves code-contributing orgs (Google, Kubernetes).