feat(orb): central Orb App webhook receiver (POST /v1/orb/webhook) - #1293
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1293 +/- ##
==========================================
+ Coverage 95.07% 95.09% +0.01%
==========================================
Files 178 179 +1
Lines 20039 20092 +53
Branches 7206 7228 +22
==========================================
+ Hits 19053 19106 +53
Misses 395 395
Partials 591 591
🚀 New features to boost your workflow:
|
3 tasks
First piece of the central Gittensory Orb GitHub App (#1255) — the ONE shared app maintainers install (das-github-mirror model). GitHub delivers its install + PR/review events here, to gittensory-api; this is the data spine for the homepage fleet metrics (reviews initiated / merged / closed / reversals). Ports the proven src/github/webhook.ts handler verbatim — only the secret and the dedup table differ: - Verifies the Orb App's OWN webhook secret (ORB_GITHUB_WEBHOOK_SECRET, distinct from the review app's GITHUB_WEBHOOK_SECRET; absent → fail-closed 401, so the route is inert until the secret is injected). - Its own orb_webhook_events dedup table (migration 0063) — a GitHub delivery_id is only unique per App, so it can't share webhook_events with the review app. - Body-size cap, signature verification, dedup, and 202/400/401/413 responses identical to the review-app handler. Exempt from requiresApiToken; strict rate-limit class. Receive + verify + record only — install-registry and PR-outcome processing land in follow-up PRs. Purely additive; the live /v1/orb/ingest collector is untouched. Advances #1255.
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
JSONbored
force-pushed
the
feat/orb-webhook-receiver
branch
from
June 25, 2026 02:04
2a72c81 to
2f6f189
Compare
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
This was referenced Jun 25, 2026
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
…1300) #1293 (orb webhook receiver) and the re-gate sweep PR both grabbed migration number 0063, so main shipped a duplicate 0063_*.sql and db:migrations:check fails for every branch off main. Renumber the newest (orb_webhook_events, which uses CREATE TABLE/INDEX IF NOT EXISTS and is not yet deployed) to the next free number; the sweep marker keeps 0063.
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The first piece of the central Gittensory Orb GitHub App (#1255) — the one shared app maintainers install (the das-github-mirror model). GitHub delivers its install + PR/review events to
POST /v1/orb/webhookongittensory-api; this is the data spine for the homepage fleet metrics (reviews initiated / merged / closed / reversals).It ports the proven
src/github/webhook.tshandler verbatim — only the secret and the dedup table differ:ORB_GITHUB_WEBHOOK_SECRET, distinct from the review app'sGITHUB_WEBHOOK_SECRET). Absent secret → fail-closed 401, so the route is inert until the secret is injected (wrangler secret put).orb_webhook_eventsdedup table (migration0063) — a GitHubdelivery_idis only unique per App, so it can't safely sharewebhook_eventswith the review app.202/400/401/413responses. Exempt fromrequiresApiToken;strictrate-limit class (same as/v1/github/webhook).Receive + verify + record only — install-registry and PR-outcome processing land in follow-up PRs (#2–#7 of the Orb-app sequence). Purely additive: the live
/v1/orb/ingestcollector,orb_signals, and fleet analytics are untouched. The endpoint must exist now because GitHub starts POSTing install/ping deliveries the moment the Orb App is created.Scope
0063_orb_webhook_events.sqlis the next contiguous numberValidation
npm run test:ci— green (db:migrations:check, typecheck, coverage, workers, ui)src/orb/webhook.ts(15 cases: missing headers, absent/invalid signature, content-length vs streamed 413, non-JSON, install-event extraction, null-field payloads, redelivery dedup, changed-payload re-record, processed/error status handling, empty-body, undefined-chunk, non-numeric content-length)Safety
delivery_idcollision with the review appDeploy note
After merge + auto-deploy, inject the secret:
wrangler secret put ORB_GITHUB_WEBHOOK_SECRET(the value you set in the Orb App's webhook config). Until then every delivery returns 401 — no crash, no data loss.Advances #1255.