refactor: consolidate duplicate bounded-concurrency helpers onto mapWithConcurrency (#6602)#6718
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. |
❌ 18 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 9 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-16 22:05:15 UTC
Review summary Nits — 5 non-blocking
CI checks failing
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.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests (6), validate-tests (2), validate-tests (1), validate-tests (3), validate-tests (5), validate-tests (4), validate-code)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
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 (visibly so inprocessors.ts, which imports bothmapWithConcurrencyandmapWithConcurrencyLimitand uses each at different call sites):src/signals/focus-manifest-loader.ts— exportedmapWithConcurrencyLimitsrc/queue/patchless-secret-scan.ts— privatemapPatchLessSecretScanFilesWithConcurrencyChange
Both now delegate to
mapWithConcurrency, preserving their existing names and(items, limit, mapper)signatures so every current caller compiles and behaves unchanged. After this,map-with-concurrency.tsis the only file undersrc/queue/orsrc/signals/that implements the worker-pool loop itself.Pure internal consolidation — no change to public behavior, call signatures, or export names.
Tests / coverage
Per the issue, no new test file is required: both wrappers are already exercised transitively by their existing caller suites —
test/unit/patchless-secret-scan.test.ts(54 tests, incl. the patch-less fallback path that calls the private helper) andtest/unit/focus-manifest-loader.test.ts+ the processors suites that drivemapWithConcurrencyLimit. Confirmed green locally, and the changed delegation lines are covered (focus-manifest-loader's uncovered set is 59-88, not the delegation).