Skip to content

feat(website): show live GitHub/npm stats and a release stream on the homepage - #4382

Merged
kovtcharov-amd merged 2 commits into
mainfrom
worktree-website-stats-and-animation
Sep 26, 2026
Merged

kovtcharov-amd merged 2 commits into
mainfrom
worktree-website-stats-and-animation

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Summary

The homepage stopped its argument at "here's how to install it" — nothing on the page showed a visitor that the project has real traction or ships often. This adds a stats row (GitHub stars/forks, release downloads, release count, npm downloads) and a release stream with relative-date badges ("Today" / "N days ago"), both placed directly under the install button.

Numbers are fetched live at build time and labeled honestly: "GitHub release downloads", not a bare "downloads" — the site's own install button actually downloads from a Cloudflare R2 bucket with zero tracking today, so a number implying "everyone who's ever installed GAIA" would overclaim. The real all-source download/traffic dashboard is scoped separately in docs/plans/website-admin-dashboard.md rather than folded into this PR.

Test plan

  • cd website && npm test — 109 tests pass, including 17 new tests in src/data/github.test.ts
  • cd website && HUB_CATALOG_URL=https://hub.amd-gaia.ai npm run build — type-checks and builds clean
  • cd website && HUB_CATALOG_URL=https://hub.amd-gaia.ai npm run dev, visit /, confirm the stats row and release stream render under the install button in both light and dark theme

… homepage

The homepage stopped at "here's how to install it" with nothing to show a
visitor that the project has real traction or ships often. Add a stats row
(GitHub stars/forks, release downloads, release count, npm downloads) and a
release stream with relative-date badges, both placed directly under the
install button.

Stats are fetched live at build time (website/src/data/github.ts), same
fail-loud discipline as the existing hub-catalog fetcher: no bundled fixture,
no silent fallback. Labels are deliberately specific ("GitHub release
downloads") rather than a bare "downloads", since the site's own install
button downloads from an R2 bucket that has no tracking at all — a private
admin dashboard covering that real number is scoped separately in
docs/plans/website-admin-dashboard.md.
@github-actions github-actions Bot added documentation Documentation changes devops DevOps/infrastructure changes website GAIA website (amd-gaia.ai) labels Sep 26, 2026
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 26, 2026
Merged via the queue into main with commit 81d972f Sep 26, 2026
29 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the worktree-website-stats-and-animation branch September 26, 2026 08:13
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

The stats row and release stream look correct, with honest labels, and the pagination and error paths are tested. One deploy risk is worth fixing.

🟡 Production deploys can fail because of GitHub rate limits. The Railway build calls the GitHub API without a token. That limit is 60 requests an hour per IP, and Railway's build machines share outbound IPs with other customers. Someone else's traffic can use up the quota. The next deploy then gets a 403, and because there's deliberately no fallback, the whole website build fails. Set GITHUB_TOKEN (a PAT with no scopes) in Railway now, and describe it as recommended, not "optional".

🟢 Nits:

  • The "GITHUB_TOKEN is not set" message prints once per request: once for the repo and once for every page of releases. Logging it once per build is enough.
  • Releases GitHub marks as pre-release still count toward "Releases" and show up in the stream if their tag looks like vX.Y.Z. Only drafts are filtered out.
🔍 Technical details
  • .github/workflows/deploy_website.yml: the comment calls GITHUB_TOKEN "OPTIONAL … well under the 60/hr cap". That only holds if the builder's egress IP is yours alone. githubFetch in website/src/data/github.ts throws on any non-2xx response, so a 403 fails astro build.
  • github.ts githubHeaders(): runs on every githubFetch call. Move the unset-token console.log behind a module-level let warned = false guard.
  • getReleaseStats(): nonDraft.filter((r) => isMainReleaseTag(r.tag_name)) doesn't check r.prerelease. Add && !r.prerelease if pre-releases shouldn't count toward cadence. Keep them in totalDownloadCount, which the comment intentionally scopes to include them.

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

Labels

devops DevOps/infrastructure changes documentation Documentation changes website GAIA website (amd-gaia.ai)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant