Repository navigation
[C] Public releases API and Stack release UI - #19
Conversation
Serve GET /api/releases from D1 current-stable projections with schema versioning, short public cache, and ETag. Show loading, empty, stale, and unavailable states on the Stack page via a same-origin module so release facts update without a Pages rebuild. Part of docs/GITHUB_RELEASE_WEBHOOK_PLAN.md Phase C.
|
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. |
|
@codex review |
There was a problem hiding this comment.
Pull request overview
Implements Phase C of the GitHub release webhook plan by adding a public, cacheable read API for current stable release facts and wiring a Stack UI surface that consumes it at runtime while remaining usable without JavaScript.
Changes:
- Adds
GET /api/releasesreturningpegma.releases.v1for an allowlisted, display-ordered catalog with ETag +max-age=300caching andnosniff. - Introduces Stack-page UI helpers and a same-origin runtime fetch script that renders loading/empty/populated/stale/unavailable states (with a
<noscript>fallback). - Adds endpoint + display-helper tests and documents the new API in the worker README.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| worker/src/releases-api.ts | Implements public releases endpoint response building, URL projection validation, and ETag-based caching behavior. |
| worker/src/releases-api.test.ts | Adds unit tests for projection safety, allowlist behavior, headers, and conditional 304 responses. |
| worker/src/release-display.ts | Provides shared pure helpers to classify UI states and format labels for release display. |
| worker/src/release-display.test.ts | Tests state classification and label formatting behavior. |
| worker/src/release-catalog.ts | Defines display-ordered catalog and allowlist intersection helpers for public release surfacing. |
| worker/src/index.ts | Routes /api/releases requests through the new handler with configuration checks and error mapping. |
| worker/README.md | Documents the new public releases endpoint and its guarantees (schema, caching, field exclusions). |
| src/styles/global.css | Adds styling hooks for release status/values in different UI states. |
| src/pages/stack.astro | Adds accessible release status shell, per-component placeholders, noscript copy, and script include. |
| public/stack-releases.js | Implements same-origin runtime fetch and DOM updates for Stack release states with input safety checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Validate public release URLs against the catalog display name, honor If-None-Match: *, and remove unreachable empty-status logic.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ad9a257fc
ℹ️ 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".
Hash schema and release rows only so revalidation returns 304 while D1 facts are unchanged.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
* [docs] Mark GitHub release webhook Phases C–D complete; Phase E open. Reconcile plan status with merged PRs #19 and #20. Production secret and organization webhook activation remain. * Clarify Phase D/E wording from Copilot review. * Note ETag invalidation/epoch follow-up in Phase D reconciliation.
Summary
Implements Phase C of docs/GITHUB_RELEASE_WEBHOOK_PLAN.md: public read surface and Stack UI for current stable release facts.
GET /api/releases— schemapegma.releases.v1, allowlisted catalog order, emptycurrentslots,max-age=300+ ETag,nosniff, no ledger/secret fields/stack-releases.jsPhase C exit criteria
GET /api/releasesTest evidence
npm run check— passnpm test— 93 node + 1 D1 tests passnpm run build— passResidual risks
Out of scope (later phases)