Repository navigation
Count main branch commit contributors on the website - #1689
Cedric Vidal (cedricvidal) wants to merge 8 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Test Results (Node.js 22)test: Run #608
🎉 All tests passed! |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Test Results (Node.js 22)test: Run #609
🎉 All tests passed! |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Test Results (Node.js 22)test: Run #610
🎉 All tests passed! |
| gh api --paginate \ | ||
| -H 'Accept: application/vnd.github+json' \ | ||
| -H 'X-GitHub-Api-Version: 2022-11-28' \ | ||
| "repos/${REPO}/contributors?per_page=100&anon=0" \ |
There was a problem hiding this comment.
Historical attribution: a verified contributor is still omitted. The migrated record for #331 records Original author: @toddanglin and an original merge timestamp. The corresponding commit, e5b3b38b, preserves Todd Anglin as its Git author. However, GitHub returns that commit as an anonymous contributor named Todd Anglin when queried with anon=1; this request and the subsequent user-only filter omit him entirely.
This endpoint does recover other preserved Git authors, so this is not a claim that the imported history is all incorrectly credited to the migration account. It is a concrete remaining gap in historical contributor coverage. Could we reconcile unmapped imported contributions through verified original-author metadata or an explicit attribution mapping? Historical PR credit should remain separate from commit totals unless the commit-to-account mapping is verified.
There was a problem hiding this comment.
Good catch. I added a root .mailmap entry mapping the preserved Todd.Anglin@microsoft.com author identity to 647319+toddanglin@users.noreply.github.com. Git resolves that identity locally now. I’m leaving this thread open because GitHub’s contributor-statistics behavior can only be confirmed after the mailmap reaches main and its cache refreshes.
Auto-replied by the GitHub Copilot app
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Test Results (Node.js 22)test: Run #614
🎉 All tests passed! |
|
Thanks for the thorough review. I’ve addressed the rollout and freshness concerns by removing the For Todd, I added a |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Test Results (Node.js 22)test: Run #615
🎉 All tests passed! |
Summary
The contributor wall counted only pull requests merged natively in
microsoft/scope, so historical work imported fromscope-coreas issues was absent. This changes the source of truth to GitHub's repository contributors endpoint and presents the metric explicitly as commits attributed on the default branch (main).The browser now reads that public endpoint directly, follows its pagination links, and filters anonymous and bot accounts. This removes the intermediate
website-datapublication workflow and its mixed-version payload semantics. Contributor cards continue to open merged-PR searches, with copy clarifying that the displayed number is commits onmain.A root
.mailmapentry maps Todd Anglin's preservedTodd.Anglin@microsoft.comcommit identity to@toddanglin's canonical GitHub noreply address. Git applies that mapping locally; its effect on GitHub's contributor statistics will be verified after it reachesmainand the cached statistics refresh.The PR also documents a pinact exception for
dtolnay/rust-toolchain, whose toolchain-specific commits have no matching Git tags. The workflow retains full-SHA and explanatory-comment enforcement while allowing CI to verify the rest of the action pins.Demos
The same homepage contributor widget is shown with deterministic contributor data from each counting method.
Before
The native merged-PR query reports 77 PRs and omits the imported
scope-corehistory.After
The repository contributor query reports 644 commits attributed on
main, including the imported history.Testing
All commands passed. The pnpm commands were invoked through the cached pnpm 10.29.1 launcher because the machine's default Corepack shim referenced a broken Homebrew Node installation.
pnpm --dir website test- 22 tests passed.pnpm exec vitest run scripts/ci-workflow.test.ts- 34 tests passed.SITE=https://microsoft.github.io BASE_PATH=/scope pnpm --dir website run build- production build passed.BASE_PATH=/scope playwright test --config website/playwright.config.ts- 92 tests passed across light/dark and desktop/mobile projects.pinact --config .github/pinact.yaml run --fix=false --verify- passed.pinact run --check --verify-comment- passed.gh api repos/microsoft/scope/contributorstransformation check - 13 non-bot user contributors and 646 commits attributed on the repository's default branch at validation time.Documentation and compatibility
Updated the contributor documentation, README, Contributors page, development sample, runtime copy, and post-merge guidance to identify the metric as commits attributed on
main.The browser uses GitHub's unauthenticated public API, so its documented per-IP rate limit and contributor-statistics cache apply. Network or rate-limit failures preserve the fallback link to GitHub's contributor graph; local development additionally uses a checked-in sample.
Checklist
up()/down()and keep it CosmosDB-compatible. (N/A: no database changes.)NOTICE/NOTICE-REVIEW.txtwithpnpm noticeas needed. (N/A: no dependency changes.)