Repository navigation
Add GitHub release webhook handler (Phase B) - #18
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d89ea65d8
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Adds Phase B of the GitHub Releases webhook pipeline to the Cloudflare Worker, so authenticated GitHub release deliveries can be recorded (via vendored @pegma/webhooks) and the “current stable release” per allowlisted Pegma repo can be projected into a componentReleases collection for later read/UI phases.
Changes:
- Adds
POST /api/webhooks/github/releaseshandler with raw-body HMAC-SHA256 verification, org/repo allowlists, bounded request bodies, and webhook-ledger dedupe/quarantine integration. - Introduces a
componentReleasescollection plus a pure “decide + apply” projection layer for stable releases (ignore draft/prerelease; handle delete/unpublish). - Updates docs and worker configuration variables to reflect the new Phase B status and runtime wiring.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| worker/wrangler.jsonc | Adds production vars for GitHub org ID and allowed repository IDs. |
| worker/src/release-projection.ts | New pure decision + idempotent projection application into componentReleases. |
| worker/src/release-projection.test.ts | Unit tests for URL building, projection decisions, and store updates. |
| worker/src/index.ts | Wires /api/webhooks/github/releases route and adds a health detail check. |
| worker/src/github-webhook-signature.ts | Implements Web Crypto HMAC-SHA256 verification for X-Hub-Signature-256. |
| worker/src/github-webhook-signature.test.ts | Tests signature verification (fixture + negative cases). |
| worker/src/github-release-webhook.ts | New authenticated webhook handler: bounded body, signature verify, org/repo checks, ledger + projection. |
| worker/src/github-release-webhook.test.ts | Handler matrix tests for rejection paths, ping, allowlists, dedupe behavior, and draft handling. |
| worker/src/component-release.ts | Defines componentReleases collection and codec that excludes surplus payload fields. |
| worker/README.md | Documents the new webhook endpoint and activation warning (Phase E). |
| worker/.dev.vars.example | Lists new local secrets relevant to identity + GitHub webhook secret. |
| docs/PROJECT_PLAN.md | Marks Phase B as complete and updates roadmap wording. |
| docs/GITHUB_RELEASE_WEBHOOK_PLAN.md | Updates status and adds Phase B reconciliation notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ae5acf9db
ℹ️ 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".
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
Summary
POST /api/webhooks/github/releaseswith raw-body HMAC-SHA256, org/repo allowlists, and bounded bodies.@pegma/webhooks(source: github) and project current stable releases into acomponentReleasescollection (no payload fields in the codec).Plan:
docs/GITHUB_RELEASE_WEBHOOK_PLAN.mdPhase B.Test plan
npm run checknpm run test:node(80 tests, including GitHub signature fixture + handler matrix)npm run test:d1npm run build