Skip to content

Count main branch commit contributors on the website - #1689

Open
Cedric Vidal (cedricvidal) wants to merge 8 commits into
mainfrom
cedricvidal-count-imported-contributor-prs
Open

Cedric Vidal (cedricvidal) wants to merge 8 commits into
mainfrom
cedricvidal-count-imported-contributor-prs

Conversation

@cedricvidal

@cedricvidal Cedric Vidal (cedricvidal) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The contributor wall counted only pull requests merged natively in microsoft/scope, so historical work imported from scope-core as 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-data publication workflow and its mixed-version payload semantics. Contributor cards continue to open merged-PR searches, with copy clarifying that the displayed number is commits on main.

A root .mailmap entry maps Todd Anglin's preserved Todd.Anglin@microsoft.com commit 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 reaches main and 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-core history.

Contributor widget before, showing 13 contributors and 77 merged PRs

After

The repository contributor query reports 644 commits attributed on main, including the imported history.

Contributor widget after, showing 13 contributors and 644 commits on main

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.
  • Live gh api repos/microsoft/scope/contributors transformation 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

  • If Portal features changed, keep CLI capabilities in sync. (N/A: website only.)
  • If Portal components changed, update their Storybook stories. (N/A: no Portal components.)
  • If database changes require a migration, include up() / down() and keep it CosmosDB-compatible. (N/A: no database changes.)
  • If dependencies changed, update the lockfile and regenerate NOTICE / NOTICE-REVIEW.txt with pnpm notice as needed. (N/A: no dependency changes.)
  • Video showing the behavior before the suggested change (N/A: count/copy-only website change.)
  • Video showing the behavior after the suggested change (N/A: count/copy-only website change.)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added type: documentation Documentation additions, corrections, and improvements. area: cicd Build, test, release, and deployment pipelines. language: javascript Work involving JavaScript code, tooling, or dependencies. topic: testing Test coverage, test infrastructure, and validation quality. topic: ui Portal, visual presentation, layout, and interface components. labels Nov 20, 2026
@github-actions

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #608

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3342 3342 0 0 0 0 0 1m33s

🎉 All tests passed!

Github Test Reporter

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@cedricvidal Cedric Vidal (cedricvidal) changed the title Count commit contributors on the website Count main branch commit contributors on the website Nov 20, 2026
@github-actions

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #609

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3342 3342 0 0 0 0 0 1m12s

🎉 All tests passed!

Github Test Reporter

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #610

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3342 3342 0 0 0 0 0 1m11s

🎉 All tests passed!

Github Test Reporter

Comment thread .github/workflows/contribution-data.yml Outdated
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" \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

Comment thread website/src/scripts/contributors.ts Resolved
Comment thread .github/workflows/contribution-data.yml Resolved
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>
@github-actions

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #614

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3348 3340 0 8 0 0 0 1m4s

🎉 All tests passed!

Github Test Reporter

@cedricvidal

Copy link
Copy Markdown
Collaborator Author

Thanks for the thorough review. I’ve addressed the rollout and freshness concerns by removing the website-data workflow entirely—the website now reads GitHub’s contributor statistics directly, so there’s no cross-deployment format mismatch or stale persisted snapshot.

For Todd, I added a .mailmap entry mapping Todd.Anglin@microsoft.com to @toddanglin’s canonical noreply address. Git resolves it locally, but I’ve left that thread open because we can only verify GitHub’s statistics attribution after the mapping reaches main and its cache refreshes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #615

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3348 3340 0 8 0 0 0 1m18s

🎉 All tests passed!

Github Test Reporter

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cicd Build, test, release, and deployment pipelines. language: javascript Work involving JavaScript code, tooling, or dependencies. topic: testing Test coverage, test infrastructure, and validation quality. topic: ui Portal, visual presentation, layout, and interface components. type: documentation Documentation additions, corrections, and improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants