fix(reliability): harden webhook/queue/public-fetch error handling (#786, #787, #790, #791) - #817
Conversation
Pre-agent-layer reliability fixes from the 2026-06-17 audit — the gate path must be solid before it can ever take write actions. Surgical, no signature changes. - #786 webhook: wrap JOBS.send in try/catch. On enqueue failure, flag the event "error" (so the dedup guard lets GitHub redeliver) and return 500 so GitHub retries, instead of silently stranding the event as "queued" forever. - #787 queue: isolate each login in buildContributorDecisionPacks and buildContributorEvidence (per-login try/catch) so one failing login can't fail the whole batch and poison-pill the queue (which would re-run from login #1). - #790 public: add a 12s AbortSignal.timeout to fetchPublicContributorProfile's two api.github.com calls so a hung response can't stall the 500-login evidence loop. (The auth-token rate-ceiling lift is tracked separately on #790.) - #791 backfill: aggregate contributor stats by canonical lowercase login so one user across mixed casings collapses to a single ContributorRepoStatRecord. New webhook enqueue-failure test; existing tests cover the rest; the trivial log-and-continue handlers are v8-ignored per the repo idiom. 1892 unit tests pass; all changed lines covered. Closes #786 Closes #787 Closes #791
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 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. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
gittensory · advisory review Reviewed 5 changed file(s) — two independent AI reviewers. Changed files: Suggested action: 🛠️ Request changes. (reviewers split: merge / request changes) Address the suggestions below before merging. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #817 +/- ##
=======================================
Coverage 96.76% 96.77%
=======================================
Files 97 97
Lines 13992 14000 +8
Branches 5098 5098
=======================================
+ Hits 13540 13548 +8
Misses 86 86
Partials 366 366 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Completes #790 — the timeout half shipped in #817. fetchPublicContributorProfile's two api.github.com calls were unauthenticated (60/hr ceiling), so the 500-login contributor-evidence loop could exhaust it and silently return source: unavailable. Thread an optional env through the 8 callers and send Authorization: Bearer when GITHUB_PUBLIC_TOKEN is set, lifting the ceiling to 5000/hr (mirrors the existing fetchPublicRepoStats). Signature stays backward-compatible (env is optional). Closes #790
Pre-agent-layer reliability fixes from the 2026-06-17 audit — the webhook→gate→queue path must be solid before it can ever take write actions. Surgical: 4 source files, 52 lines, no signature changes.
JOBS.sendwrapped in try/catch — on failure, flag the eventerror(so the dedup guard lets GitHub redeliver) + return 500 so GitHub retries, instead of leaving itqueuedforever.buildContributorDecisionPacks+buildContributorEvidenceso one failing login can't fail the whole batch (which would re-run from login #1 on retry).AbortSignal.timeoutonfetchPublicContributorProfile's two api.github.com calls so a hung response can't stall the 500-login evidence loop.Tests
New webhook enqueue-failure test (valid signature + failing
JOBS.send→ 500 + row flaggederror); existing tests cover the rest; trivial log-and-continue handlersv8 ignored per the repo idiom. 1892 unit tests pass; all changed lines covered (verified against the lcov).Note
This closes #786/#787/#791. #790 stays open for its second half — the GitHub-public-token rate-ceiling lift (needs threading
envthrough callers; deferred to keep this PR surgical). The hang (the P1) is fixed here.Closes #786
Closes #787
Closes #791