Skip to content

feat: filter org search to code contributors only (IN-1206) - #4371

Merged
gaspergrom merged 1 commit into
mainfrom
feat/IN-1206-filter-org-code-contributions
Jul 21, 2026
Merged

feat: filter org search to code contributors only (IN-1206)#4371
gaspergrom merged 1 commit into
mainfrom
feat/IN-1206-filter-org-code-contributions

Conversation

@gaspergrom

Copy link
Copy Markdown
Contributor

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 by contributionCount. That contributionCount is countState(activityId) — it counts all activities, not just code contributions. Meanwhile the organization page dashboard only renders activity where (type, platform) matches an activityTypes row with isCodeContribution = true.

Verified against prod Tinybird:

  • 519,349 orgs were searchable (all have contributionCount > 0, so a naive contributionCount = 0 filter is a no-op).
  • Only 198,694 of them have any code contributions.
  • So ~62% of searchable orgs had activity but zero code contributions → they linked to an empty dashboard. Examples with huge activity but no code contributions: Eventual Inc (2.2M), Groups.io Inc (610K), Databricks (257K).

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.pipe now INNER JOINs against the distinct set of org IDs in org_page_activities_timeseries_copy_ds — the precomputed datasource that is already scoped to isCodeContribution activity types (10-year window), i.e. the exact definition the org page uses. Only orgs that would render something on the dashboard survive.

organizations_filtered is consumed only by search_collections_projects_repos.pipe, so org pages, leaderboards, and the shared organizations_populated_slug datasource are unaffected.

Result (validated on prod)

  • Searchable orgs: 519,349 → 198,583.
  • Stale high-activity, no-code orgs (Eventual Inc, Groups.io, Databricks) no longer appear.
  • Real orgs preserved (Google, Kubernetes, etc.).

Deploy order

⚠️ This Tinybird pipe change must be deployed to prod before it takes effect for the Insights search bar (which already consumes the pipe via #4368 / IN-1206).

Test plan

  • Confirmed contributionCount = 0 filter is a no-op (0 rows) — wrong approach.
  • Confirmed org_page_activities_timeseries_copy_ds join removes non-code orgs (Eventual Inc et al.) and preserves code-contributing orgs (Google, Kubernetes).
  • Confirmed row-count drop (519k → 199k) matches the count of code-contributing orgs.

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>
Copilot AI review requested due to automatic review settings July 21, 2026 09:44
@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Large reduction in searchable orgs (~62%) changes global search UX; change is isolated to the search pipe but relies on the org-page timeseries datasource staying in sync with dashboard semantics.

Overview
Global search organization results are limited to orgs that have at least one code contribution (commits, PRs, code reviews), aligned with what the organization page dashboard actually shows.

organizations_filtered.pipe adds an organizations_code_contributors node (distinct organizationId from org_page_activities_timeseries_copy_ds) and inner-joins it to organizations_populated_slug, dropping orgs with only non-code activity and stale CDP-deleted rows with no code-contribution timeseries. Pipe docs note the behavior; search_collections_projects_repos.pipe documents that org hits come through this filter.

Scope is search onlyorganizations_filtered is consumed by the unified search pipe, not org pages or leaderboards directly.

Reviewed by Cursor Bugbot for commit 98f89e6. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gaspergrom
gaspergrom merged commit 6c91e71 into main Jul 21, 2026
16 checks passed
@gaspergrom
gaspergrom deleted the feat/IN-1206-filter-org-code-contributions branch July 21, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants