Repository navigation
Fetch component status through GitHub API - #5
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
Pull request overview
This PR updates the build-time “component status” compiler used by the roadmap/stack pages to fetch each repo’s PROJECT_PLAN.md via the GitHub Contents API (raw media) instead of raw.githubusercontent.com, aiming to reduce stale status during static builds.
Changes:
- Switch plan fetch URL from
raw.githubusercontent.comtoapi.github.com/repos/.../contents/...withAccept: application/vnd.github.raw. - Add request options/headers intended to prevent stale/cached responses during the build.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const res = await fetch(url, { | ||
| cache: 'no-store', | ||
| headers: { | ||
| Accept: 'application/vnd.github.raw', | ||
| 'User-Agent': 'pegma-dev-status-build', | ||
| }, | ||
| signal: AbortSignal.timeout(10_000), | ||
| }); |
| const url = new URL(`https://api.github.com/repos/pegma-dev/${repo}/contents/${plan}`); | ||
| url.searchParams.set('ref', 'main'); | ||
| const res = await fetch(url, { | ||
| cache: 'no-store', | ||
| headers: { | ||
| Accept: 'application/vnd.github.raw', | ||
| 'User-Agent': 'pegma-dev-status-build', | ||
| }, | ||
| signal: AbortSignal.timeout(10_000), | ||
| }); |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1241eec062
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| headers: { | ||
| Accept: 'application/vnd.github.raw', | ||
| 'User-Agent': 'pegma-dev-status-build', | ||
| }, |
There was a problem hiding this comment.
Authenticate the contents API requests
Each CI build now sends nine unauthenticated GitHub REST requests, but unauthenticated traffic is limited to 60 requests per hour per source IP; hosted runners share source IPs, so an exhausted quota makes these requests return 403. Because fetchStage silently converts those responses to null, the production or preview build then publishes the hand-written now values rather than the source plans. Pass an authenticated token from the workflow or retain an endpoint that does not consume the REST API quota.
AGENTS.md reference: AGENTS.md:L28-L30
Useful? React with 👍 / 👎.
Summary
Verification