Repository navigation
fix(company): scope company page stats to PRs credited to the company - #271
Merged
jolelievre merged 1 commit intoSep 29, 2026
Merged
Conversation
The company page summed its members' lifetime stats, so a company got credited with everything its contributors ever did (e.g. Wepika showed 492 merged PRs and 236 reviews instead of its 3 attributed PRs). It now uses the company's own counters from traces and hides reviews, issues, opened PRs, merge rate and PR breakdown, which traces cannot attribute to a company. Repository sections reappear once traces emits per-company repositories. Also fix the "0 contributors" subtitle: employees is often an empty array, which short-circuited the fallback to PR-derived contributors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Progi1984
approved these changes
Sep 29, 2026
jolelievre
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On company pages (e.g. /company/wepika):
employeesis usually an empty array, and[].length ?? contributors.lengthnever falls back.aggregateContributorssummed each member's lifetime stats, on the assumption that they matched the company's counters. They don't: Traces attributes each PR separately (sponsor company, else employee time frame). Wepika showed 492 merged PRs / 236 reviews, but only 3 PRs are attributed to it. 71 of 83 companies were inflated (Kiwik: 36 → 1325, AGRO-LA: 1 → 974…).Fix
merged_pull_requests(_by_year)), andaggregateContributorsis removed.companyMembers()helper (employees if non-empty, else PR-derived contributors), used for the subtitle and the Contributors KPI.repositories/repositories_by_yearfrom feat(topcompanies): emit merged PRs per repository for each company traces#254. They stay hidden until that data is published, so this PR can be merged first.Verification
useEntityDetail.spec.ts: company counters, repos present or absent,companyMembersfallback. The full suite (61 tests) and eslint pass.🤖 Generated with Claude Code