Fix Pre-generate Contributor Data - #1803
Open
David Aniebo (Webmekanic) wants to merge 3 commits into
Open
David Aniebo (Webmekanic) wants to merge 3 commits into
David Aniebo (Webmekanic) wants to merge 3 commits into
Conversation
David Aniebo (Webmekanic)
requested a review
from David Pine (IEvangelist)
as a code owner
October 1, 2026 12:58
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation removes build-time network access while providing validated, automated contributor-data refreshes.
Review effort: Balanced
Findings: None
What changed in this PR
Pre-generates contributor data so Astro builds no longer depend on GitHub API availability.
Changes:
- Adds a paginated contributor-data updater and committed JSON snapshot.
- Renders contributor lists from local data and removes runtime fetching/caching.
- Integrates contributor refreshes into automation with validation tests.
| File | Description |
|---|---|
.github/instructions/astro.instructions.md |
Documents contributor data updates. |
.github/workflows/update-integration-data.yml |
Supplies authentication and stages generated data. |
src/frontend/astro.config.mjs |
Removes the contributor cache integration. |
src/frontend/package.json |
Adds contributor update commands. |
src/frontend/scripts/check-data-files.mjs |
Requires generated contributor data. |
src/frontend/scripts/update-contributors.ts |
Fetches, validates, and writes contributor data. |
src/frontend/scripts/update-integration-data.ps1 |
Includes contributor data in automation. |
src/frontend/src/components/ContributorList.astro |
Renders committed contributor data. |
src/frontend/src/content/i18n/en.json |
Removes obsolete unavailable-state translations. |
src/frontend/src/data/github-contributors.json |
Stores generated contributor records. |
src/frontend/src/utils/contributors.ts |
Removes build-time GitHub fetching and caching. |
src/frontend/tests/unit/contributor-list.vitest.test.ts |
Tests rendering, generation, and network guards. |
src/frontend/tests/unit/contributors.vitest.test.ts |
Removes obsolete runtime-fetch tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| it('has no api.github.com requests outside scripts/', () => { | ||
| const offenders = roots | ||
| .flatMap((root) => [...sourceFiles(join(frontendRoot, root))]) | ||
| .filter((file) => readFileSync(join(frontendRoot, file), 'utf8').includes('api.github.com')); |
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.
Summary
The Contributors page called
https://api.github.com/repos/{repo}/contributorswhile it was being rendered, once per repo for each language version of the page. Our internal Azure DevOps build (Aspire.Dev-Build) runs these calls without a token. On shared agent IPs, they hit GitHub's anonymous rate limit and return403 Forbidden: builds 3087220 and 3086870 logged 41–42 of these errors. When a call failed, the page was built and deployed without that repo's contributor list, in every language version.The build shouldn't depend on an outside service at all. These calls can fail, they make the output vary between builds, and they slow down CI. Setting a
PUBLIC_GITHUB_TOKENwould still leave network calls in the build. Because it's aPUBLIC_*variable, the token could also end up in client code.Validation
pnpm exec vitest run --config vitest.config.ts tests/unit/contributor-list.vitest.test.tspasses (9 tests). It covers:ContributorListrenders from the committed JSON, and a stubbedfetchis never calledignorelist and case-insensitive repo namespnpm update:contributorsgithub-contributors.jsontests/unit/release-contributors.vitest.test.tspasses.pnpm exec eslint --max-warnings 0on the changed.ts/.mjsfiles is clean.pnpm update:contributorsran successfully against GitHub and generated the committed JSON: 306 / 40 / 88 / 78 / 19 contributors. Pagination worked, sincemicrosoft/aspireneeded 4 pages.