fix(selfhost): wire WEBHOOKS queue binding for the Orb relay receiver#1384
Merged
Conversation
The Orb relay receiver (handleOrbRelay) calls c.env.WEBHOOKS.send() to enqueue incoming relay events onto the dedicated webhook lane — the same path as GitHub's own webhook receiver. server.ts wired JOBS but not WEBHOOKS, so every relayed event failed with enqueue_failed and a 500. Both lanes share the in-process DurableQueue in self-host mode (the queue consumer processes all job types regardless of which binding sent them), so the fix is a one-line alias. Tests added for handleOrbRelay covering every branch: missing headers (400), unconfigured relay (404), invalid HMAC (401), queue failure (500), and the success path (202 queued on the WEBHOOKS lane).
|
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 #1384 +/- ##
=======================================
Coverage 95.36% 95.36%
=======================================
Files 191 191
Lines 20714 20714
Branches 7489 7489
=======================================
Hits 19753 19753
Misses 380 380
Partials 581 581 🚀 New features to boost your workflow:
|
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 Orb relay receiver (
handleOrbRelay) callsc.env.WEBHOOKS.send()to enqueue relayed webhook events onto the dedicated webhook lane — the same path as GitHub's own webhook receiver.server.tswiredJOBSbut notWEBHOOKS, so every brokered-relay event failed immediately withenqueue_failed(500), silently eating all forwarded events and preventing any reviews from running on a brokered self-host.Both
JOBSandWEBHOOKSmap to the same in-processDurableQueuein self-host mode (all job types share one queue; the consumer handles them regardless of which binding sent them), so the fix is addingWEBHOOKS: backend.queue.bindingalongside the existingJOBSalias.Tests added for all
handleOrbRelaybranches: missing GitHub headers (400), unconfigured relay/no enrollment secret (404), invalid HMAC signature (401), WEBHOOKS queue failure (500 enqueue_failed), and the success path (202 queued on the WEBHOOKS lane).Scope
Validation
npx vitest run test/unit/webhook.test.ts— 9 tests (4 existing + 5 new), all passnpm run test:ci— exit 0, full gate greenSafety