fix(observability): close two zero-trace webhook/relay loss points#3838
Conversation
enqueueWebhookByEnv attempted JSON.parse before writing any webhook_events row, so an unparseable delivery left zero durable trace anywhere -- indistinguishable from GitHub never having sent it. Hash the raw body before the parse attempt and record an "error" row on a parse failure so every delivery is traceable. drainOrbRelay's pull-mode batch parser silently filtered out any relayed event missing/mistyping one of its three required fields, with no log and no counter. Log a structured, Sentry-visible event and increment a counter on the drop, naming which field was missing. Part of #3812; the new fast open-PR reconciliation job is tracked separately.
|
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 #3838 +/- ##
=======================================
Coverage 93.41% 93.41%
=======================================
Files 326 326
Lines 32855 32859 +4
Branches 12035 12035
=======================================
+ Hits 30691 30695 +4
Misses 1530 1530
Partials 634 634
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-06 19:22:47 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Part of #3812 — the two "adjacent zero-trace loss points on the same ingestion path" fixes it calls out. The new fast open-PR reconciliation job (the third deliverable) is a larger, separate change tracked in a follow-up PR so this one stays reviewable.
src/github/webhook.ts:enqueueWebhookByEnvattemptedJSON.parse(rawBody)before writing anything towebhook_events. An unparseable delivery returned"invalid_json"with zero durable trace anywhere — indistinguishable from GitHub never having sent it at all. Hoists the raw-body hash (independent of parse validity) above the parse attempt and writes awebhook_eventsrow withstatus: "error"on a parse failure, so every delivery — parseable or not — leaves a trace an operator can find.src/orb/broker-client.ts:drainOrbRelay's pull-mode batch parser silently dropped any relayed event missing/mistyping one of its three required fields (deliveryId/eventName/rawBody), with no log and no counter. Adds a structuredorb_relay_malformed_event_droppederror log (Sentry-visible) and agittensory_orb_relay_malformed_events_totalcounter on the drop, naming which of the three fields was missing.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateSafety
UI Evidencesection below. (N/A — no visible UI change.)