feat(api): CF Queue + DLQ for GitHub webhook ingestion - #337
Merged
Zach Dunn (zachdunn) merged 1 commit intoJul 21, 2026
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
uploads-api | 44e61ac | Commit Preview URL Branch Preview URL |
Jul 21 2026, 12:45 PM |
|
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 ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Zach Dunn (zachdunn)
deleted the
claude/webhook-queue-implementation-d43486
branch
July 21, 2026 12:49
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.
Closes #287.
Why now
#287 deferred a CF Queue + DLQ because webhook work was purely self-healing KV
invalidation. That stopped being true: auto-promotion (#284 phase 3) and
comment reconciliation (#291/#332) now run fire-and-forget in
ctx.waitUntil.GitHub does not redeliver a 2xx delivery, so a failed promote on a
pull_requestopenedwith no follow-up push is durable loss — exactly the"revisit" trigger the issue defined.
Shape (matches
releases/workers/webhooksprior art)handleWebhookis split into a pureextractWebhookEvent(delivery →WebhookEvent { keys, promote?, reconcile? }or null) and
processWebhookEvent(KV deletes + promote/reconcile). Only thecompact event crosses the queue — GitHub payloads can exceed the 128 KB queue
message cap. Gating (fork-head rejection,
isReconcilableCommentEvent) staysin the pure extraction, so ordinary
issue_commenttraffic enqueues nothing.uploads-github-webhookvia theGITHUB_WEBHOOK_QUEUEbinding after HMAC verification.queue()export on the api worker(
github-webhook-queue.ts). Per-message ack/retry;max_retries: 6→uploads-github-webhook-dlq, whose consumer logs the compact event and acks.findRepoLinkStrictso a D1outage throws → retry, instead of the lenient
findRepoLinkreading as"repo not linked" and ack-dropping the event.
send()falls back to thepre-existing inline
waitUntilpath (errors swallowed + logged, 204 always) —tests and queueless local dev keep working unchanged.
Deploy prerequisite
Before the first deploy of this config:
Notes
@uploads/apiis a deploy-only ignored package, anda changeset against it poisons the release pipeline.
auto-promote, and reconcile suites pass unchanged on the inline path.
Full run: 163 files / 2014 tests green; api typecheck clean
(generated Env now includes
GITHUB_WEBHOOK_QUEUE: Queue).