Skip to content

[C] Public releases API and Stack release UI - #19

Merged
FlyOverCoderKY merged 3 commits into
mainfrom
grok/github-release-webhook-phase-c
Jul 29, 2026
Merged

FlyOverCoderKY merged 3 commits into
mainfrom
grok/github-release-webhook-phase-c

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

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 — schema pegma.releases.v1, allowlisted catalog order, empty current slots, max-age=300 + ETag, nosniff, no ledger/secret fields
  • Stack page shell with loading / empty / populated / stale / unavailable states via same-origin /stack-releases.js
  • Page remains usable when the API is down or JavaScript is disabled (repository links)

Phase C exit criteria

  • Add GET /api/releases
  • Accessible static shell and same-origin runtime fetch
  • Loading, empty, stale, and unavailable states
  • Endpoint and page (display-helper) tests
  • Release facts come from D1 without a Pages content change; page useful when API unavailable

Test evidence

npm run check — pass
npm test — 93 node + 1 D1 tests pass
npm run build — pass

Residual risks

  • Production still has no release rows until Phase D backfill / Phase E webhook activation; UI will show empty states.
  • Stale threshold (12h) anticipates Phase D reconciliation; without recon, observations age until webhook traffic.

Out of scope (later phases)

  • Phase D: backfill, six-hour reconciliation, health extensions, ops docs
  • Phase E: secret install, org webhook, production smoke

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.
Copilot AI review requested due to automatic review settings July 29, 2026 01:53
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

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.

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/releases returning pegma.releases.v1 for an allowlisted, display-ordered catalog with ETag + max-age=300 caching and nosniff.
  • 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.

Comment thread worker/src/releases-api.ts Resolved
Comment thread public/stack-releases.js Resolved
Comment thread worker/src/releases-api.ts Resolved
Validate public release URLs against the catalog display name, honor If-None-Match: *, and remove unreachable empty-status logic.
@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread worker/src/releases-api.ts Resolved
Hash schema and release rows only so revalidation returns 304 while D1 facts are unchanged.
@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 9d288c6035

ℹ️ 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".

@FlyOverCoderKY
FlyOverCoderKY merged commit 4940a7f into main Jul 29, 2026
1 check passed
@FlyOverCoderKY
FlyOverCoderKY deleted the grok/github-release-webhook-phase-c branch July 29, 2026 02:12
FlyOverCoderKY added a commit that referenced this pull request Jul 29, 2026
Reconcile plan status with merged PRs #19 and #20. Production secret and organization webhook activation remain.
FlyOverCoderKY added a commit that referenced this pull request Jul 29, 2026
* [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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants