test(registry): cover refreshRegistry all-sources-failed path#9396
Conversation
refreshRegistry's status:error syncRuns branch (every API candidate + raw fallback exhausted) had no test ? only the successful raw-GitHub fallback was covered. Add a regression asserting the thrown error and persisted error sync_runs row. Closes JSONbored#9314
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-27 16:07:16 UTC
Review summary Nits — 2 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver 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://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
refreshRegistrymarks thesyncRunsrowstatus: "error"and re-throws when everyAPI_CANDIDATESprobe and theGITTENSOR_REGISTRY_URLraw fallback fail. That branch was never covered — the existing test only exercises a successful raw-GitHub fallback (same gap the siblingfetchTrackedSourcealready covers inupstream-ruleset.test.ts).Adds a regression that stubs every candidate to fail (mix of non-OK + thrown errors), asserts the thrown error message, and checks the persisted
sync_runserror row + 7 per-candidate warnings.No production code change — the new test did not surface a defect.
Test plan
test/unit/registry.test.ts: all-sources-failed case (test(registry): refreshRegistry's all-sources-failed error path is never exercised #9314)Closes #9314