Repository navigation
fix: replay dead-lettered GitHub webhook events - #1340
Conversation
Log the full compact event, including the GitHub delivery id, when uploads-github-webhook-dlq acks a batch. Email OPERATOR_ALERT_EMAIL once per batch, and add a script that re-enqueues those payloads. Co-authored-by: Zach Dunn <zachdunn@users.noreply.github.com>
|
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 2
🚫 Excluded labels (none allowed): 1
Please check the settings in the CodeRabbit UI or the
|
|
No uploads on this PR yet This PR changes UI files (
Tips for agentsLabel each shot so reviewers know what they're seeing. Labels apply to every file in a call, so run one uploads put after.png --pr 1340 --meta path=/settings --state after --caption "Saved settings toast"
uploads put chat.png --pr 1340 --app ios --screen "Chat" --state afterNo CLI? With the Uploads MCP, call This comment updates with each upload, so you don't need to post the images yourself. A shot or two in the PR description is still welcome. Check what's attached with Workspace admins can turn this comment off in Settings → GitHub · docs |
Dead-lettered GitHub webhook events were acked and forgotten. The log kept a compact event, but not the GitHub delivery id, and nothing told the operator. This keeps the full event, sends one email per batch, and adds a script that puts those payloads back on the queue. It covers the burst Zach Dunn (@zachdunn) recovered in #1338.
What it does / what it is not
uploads-github-webhook-dlqreceives a batch, each event is logged as JSON, includingX-GitHub-Delivery, and then acked.OPERATOR_ALERT_EMAILonuploads-auth(the same address as the storage FYI). Unset, the mail is skipped. The log line is still written.apps/api/scripts/replay-github-webhook-dlq.mjsreads that JSON and pushes it ontouploads-github-webhook.How to try it
After this deploys, save the JSON from the operator email (or the
eventfield from the log line) and run:CLOUDFLARE_API_TOKENneeds Queues Write.--dry-runprints the delivery ids and does not send.Technical notes
The delivery id rides on the compact
WebhookEvent. Processing ignores it. The auth worker sends the mail fromPOST /internal/webhook-dlq/notify, on the same service-binding path as the storage FYI. The script uses the Queues HTTP API because wrangler has no producer-send command.Test plan
pnpm --filter @uploads/api exec vitest run src/github-webhook-queue.test.ts src/routes/github-webhook-route.test.ts scripts/replay-github-webhook-dlq.test.ts src/github-webhook.test.tspnpm --filter @uploads/auth exec vitest run src/internal-routes.test.ts -t webhook-dlqpnpm --filter @uploads/email exec vitest run src/webhook-dlq.test.tsOPERATOR_ALERT_EMAILCloses #1338