feat(miner): retry a transient 5xx in the discovery fanout - #5425
Conversation
A network blip while fetching a repo's policy docs or target issues was silently swallowed into a warning, dropping that repo's results for the entire discover run with no retry. Wrap the fanout's single shared fetch helper (githubGetJson) with the same fetchWithRetry discipline the CI and gate-verdict pollers use (JSONbored#4829): a transient 5xx response is retried with bounded exponential backoff before the repo is dropped, so a brief blip recovers instead of losing results. A 4xx/404 is returned immediately and a thrown network error still propagates to each caller's try/catch (unchanged). sleepFn is threaded through normalizeOptions so tests inject an instant retry; a persistent 5xx still warns after the retries are exhausted. Closes JSONbored#4830
|
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 #5425 +/- ##
=======================================
Coverage 94.45% 94.45%
=======================================
Files 554 554
Lines 44371 44371
Branches 14659 14659
=======================================
Hits 41912 41912
Misses 1784 1784
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 18:58:15 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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
A network blip while fetching a repo's policy docs or target issues was silently swallowed into a warning, dropping that repo's results for the entire
discoverrun — with no retry.This wraps the discovery fanout's single shared fetch helper (
githubGetJson) with the samefetchWithRetrydiscipline the CI and gate-verdict pollers already use (#4829): a transient 5xx response is retried with bounded exponential backoff before the repo is dropped, so a brief blip recovers instead of losing results. Since every fanout fetch (policy docs, target issues, search issues) goes through that one helper, the retry covers all three paths with a single wiring point.4xx/404is returned immediately (no retry).try/catch, unchanged.sleepFnis threaded throughnormalizeOptionsso tests inject an instant retry; a persistent 5xx still warns after the retries are exhausted (existing behaviour preserved).Scope
sleepFn+ testsfetchWithRetry(Add retry/backoff to the CI and gate-verdict pollers #4829); no new retry logicpackages/), noblockedPaths, no secrets/private terms;.d.tsupdatedValidation
npm run typechecknpm run test:coverage(full unsharded suite)test/unit/miner-opportunity-fanout.test.ts: a transient 5xx is retried and the target's issues are kept (not dropped, no warning) — the Add retry on transient fetch failures in the discovery fanout #4830 acceptance; the existing persistent-5xx tests still warn (after instant retries) unchangedsleepFnso they stay fastSafety
Closes #4830