Skip to content

Add GitHub release webhook handler (Phase B) - #18

Merged
FlyOverCoderKY merged 3 commits into
mainfrom
claude/b-github-release-webhook-handler
Jul 29, 2026
Merged

FlyOverCoderKY merged 3 commits into
mainfrom
claude/b-github-release-webhook-handler

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

Summary

  • Authenticate POST /api/webhooks/github/releases with raw-body HMAC-SHA256, org/repo allowlists, and bounded bodies.
  • Record deliveries through vendored @pegma/webhooks (source: github) and project current stable releases into a componentReleases collection (no payload fields in the codec).
  • Draft/prerelease deliveries are acknowledged without projection; duplicates are harmless. Read API/UI/reconciliation/activation remain for later phases.

Plan: docs/GITHUB_RELEASE_WEBHOOK_PLAN.md Phase B.

Test plan

  • npm run check
  • npm run test:node (80 tests, including GitHub signature fixture + handler matrix)
  • npm run test:d1
  • npm run build
  • Security review of the new unauthenticated webhook route before production secret install (Phase E)

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings July 28, 2026 21:47
@cursor

cursor Bot commented Jul 28, 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.

@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: 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".

Comment thread worker/src/release-projection.ts Resolved
Comment thread worker/src/release-projection.ts Resolved
Comment thread worker/src/release-projection.ts Resolved

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

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/releases handler with raw-body HMAC-SHA256 verification, org/repo allowlists, bounded request bodies, and webhook-ledger dedupe/quarantine integration.
  • Introduces a componentReleases collection 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.

Comment thread worker/src/release-projection.ts Resolved
Comment thread worker/src/github-release-webhook.ts Resolved
Co-authored-by: Cursor <cursoragent@cursor.com>
@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: 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".

Comment thread worker/src/github-release-webhook.ts Resolved
Co-authored-by: Cursor <cursoragent@cursor.com>
@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: fbbc2311e5

ℹ️ 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 f59f6b0 into main Jul 29, 2026
1 check passed
@FlyOverCoderKY
FlyOverCoderKY deleted the claude/b-github-release-webhook-handler branch July 29, 2026 01:20
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