fix(website): keep extension stars fresh - #834
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR adds a first-party Vercel endpoint that retrieves compact GitHub activity, applies shared-cache headers, and refreshes the statically generated extension directory in the browser while retaining build-time metadata as a fallback.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking configuration-quality issue in the new server function’s direct environment access. The endpoint and browser refresh paths are defensively implemented and tested, but GITHUB_TOKEN bypasses the repository’s validated environment-access convention. Files Needing Attention: api/extension-activity.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant B as Browser
participant V as Vercel CDN / Function
participant G as GitHub API
B->>B: Render build-time extension metadata
B->>V: GET /api/extension-activity
alt Cached response available
V-->>B: Compact cached activity
else Cache miss
V->>G: Search public hunk-extension repositories
G-->>V: Repository activity
V-->>B: Compact activity with shared-cache policy
end
B->>B: Update stars, dates, and card ordering
Note over B: On refresh failure, retain build-time metadata
Prompt To Fix All With AI### Issue 1
api/extension-activity.ts:15
**Direct environment access bypasses validation**
The new function reads `GITHUB_TOKEN` directly from `process.env`, bypassing the repository’s required Varlock validation and leaving configuration mistakes unchecked until deployment.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(website): keep extension stars fresh" | Re-trigger Greptile |
| const token = process.env.GITHUB_TOKEN; | ||
| return { | ||
| Accept: "application/vnd.github+json", | ||
| "User-Agent": "hunk.dev-extension-directory", |
There was a problem hiding this comment.
Direct environment access bypasses validation
The new function reads GITHUB_TOKEN directly from process.env, bypassing the repository’s required Varlock validation and leaving configuration mistakes unchecked until deployment.
Context Used: guidelines.mdc Cursor rule (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: api/extension-activity.ts
Line: 15
Comment:
**Direct environment access bypasses validation**
The new function reads `GITHUB_TOKEN` directly from `process.env`, bypassing the repository’s required Varlock validation and leaving configuration mistakes unchecked until deployment.
**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Validation
bun run typecheckbun run website:checkbun run website:buildbun test api/extension-activity.test.ts scripts/generate-docs.test.ts scripts/check-website-links.test.ts scripts/check-extension-catalog.test.tscd website && bunx playwright test tests/extensions-smoke.spec.tsThis PR description was generated by Pi using OpenAI GPT-5.6 Sol