refactor: consolidate duplicate bounded-concurrency helpers onto mapWithConcurrency (#6602)#6727
Conversation
…ithConcurrency (JSONbored#6602) src/queue/map-with-concurrency.ts's mapWithConcurrency is the canonical bounded-concurrency worker-pool helper, but two hand-duplicated copies of the same loop had drifted in beside it: - src/signals/focus-manifest-loader.ts's exported mapWithConcurrencyLimit - src/queue/patchless-secret-scan.ts's private mapPatchLessSecretScanFilesWithConcurrency Both now delegate to mapWithConcurrency, keeping their existing names and (items, limit, mapper) signatures so every caller compiles and behaves unchanged (processors.ts uses both mapWithConcurrency and mapWithConcurrencyLimit side by side today). map-with-concurrency.ts is now the only file under src/queue or src/signals that implements the loop itself. Pure internal consolidation — no public behavior, signature, or export-name change. Covered by the existing caller suites (patchless-secret-scan, focus-manifest-loader/processors); no new test needed. Closes JSONbored#6602
|
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 #6727 +/- ##
==========================================
- Coverage 93.65% 93.65% -0.01%
==========================================
Files 682 682
Lines 68133 68117 -16
Branches 18701 18701
==========================================
- Hits 63808 63792 -16
Misses 3347 3347
Partials 978 978
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-17 04:50:42 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
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.
|
Closes #6602.
src/queue/map-with-concurrency.ts'smapWithConcurrencyis the canonical bounded-concurrency worker-pool helper, but two hand-duplicated copies of the same loop had drifted in beside it (visible inprocessors.ts, which imports both):src/signals/focus-manifest-loader.ts— exportedmapWithConcurrencyLimitsrc/queue/patchless-secret-scan.ts— privatemapPatchLessSecretScanFilesWithConcurrencyBoth now delegate to
mapWithConcurrency, preserving their names and(items, limit, mapper)signatures so every caller compiles and behaves unchanged. After this,map-with-concurrency.tsis the only file undersrc/queue/orsrc/signals/implementing the loop itself. Pure internal consolidation — no public behavior, signature, or export-name change.Tests / coverage: no new test needed per the issue — both wrappers are exercised transitively by existing suites (
test/unit/patchless-secret-scan.test.ts54 tests incl. the patch-less fallback path;focus-manifest-loader+ processors suites drivemapWithConcurrencyLimit). Verified green (89 tests) andtscclean on current main; the changed delegation lines are covered.(Resubmit of #6718, which was auto-closed as collateral while main was briefly tsc-broken by an unrelated duplicate import in
src/api/routes.ts— now fixed. The change itself is unchanged and was reviewed as "a straightforward consolidation.")