mirror of
https://github.com/horizon-rust/horizon-site.git
synced 2026-12-03 19:12:41 +07:00
[PR #34] [MERGED] Fresh GitHub data within a minute: revalidate on Kira's call #36
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
horizon-rust/horizon-site#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/horizon-rust/horizon-site/pull/34
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111
Base:
main← Head:feat/revalidate-on-push📝 Commits (2)
57cb79bRevalidate GitHub data on Kira's call: fresh within a minute of a push3314bf9Read GitHub's REST API through Kira's proxy, straight from GitHub as a fallback📊 Changes
11 files changed (+153 additions, -34 deletions)
View changed files
📝
CLAUDE.md(+1 -1)📝
README.md(+10 -0)➕
app/api/revalidate/route.ts(+33 -0)📝
components/contributors.tsx(+5 -5)📝
components/docs-data.ts(+4 -2)➕
components/github-api.ts(+30 -0)➕
components/github-fresh.ts(+38 -0)📝
components/github-releases.ts(+5 -5)📝
components/hub-data.ts(+9 -9)📝
components/journal-feed.ts(+13 -9)📝
components/mods-data.ts(+5 -3)📄 Description
Xmilon: "commits on the site don't update". This PR only changes how data is refreshed. Nothing visible changes: no markup or styles are touched.
Why it lagged
cacheLife), docs and contributors for hours.raw.githubusercontent.comkeeps a branch's files for another 5 min.GITHUB_TOKEN, so reads are anonymous (60 an hour for its address).What
components/github-fresh.ts):github:horizon:main,github:horizon:issues,github:horizon:releases,github:horizon-mods:main.POST /api/revalidate: bearerREVALIDATE_SECRET, body{"tags": [...]}(allowlisted). It callsrevalidateTag(tag, { expire: 0 }). Kira calls it from GitHub's webhook, then loads the pages once. Without the secret, the route is a 404.rawMainUrl): roadmap.json, docs/api, README, MOD-POLICY. This avoids raw's 5-minute cache.components/github-api.ts,GITHUB_PROXY_URL): Kira's GitHub App and its ETag cache. If Kira doesn't answer, reads go straight to api.github.com.cacheLife, as before. The only difference is that docs now revalidate every 15 min instead of every hour, because they follow main's commit.Kira side: horizon-rust/kira#107 (merged, live).
Tests
npm run lint,npm run build: OK.npm start:/api/revalidateanswers 401 with a wrong secret and 400 with unknown tags. With the right secret, the tagged pages go fromx-nextjs-cache: HITtoMISS(regenerated), then back toHIT.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.