perf: bounded concurrency for synchronizeAllRepositories (3-way)#46
Open
perf: bounded concurrency for synchronizeAllRepositories (3-way)#46
Conversation
## Why Wave-1 Performance and Probot/Octokit agents flagged this as Bug #21 in `docs/agent-fleet/bugs.md`. The org-wide sweep runs `configureRepository` fully serially: ~30-60 s for 13 repos, ~5+ minutes for 100. Each repo config issues 4-6 GitHub API calls; serial means most of that wall time is round-trip latency, not work. Fully parallel risks blowing the GitHub 5000/h core budget on a 100-repo org and saturating the 2-core netcup VPS. The textbook answer is bounded concurrency. ## What Inline `pLimitMap(items, concurrency, fn)` helper (~12 lines, no dependency). Workers pull from a shared cursor; bounded by `concurrency`. Used at `concurrency=3` — enough to overlap GitHub round-trips, light enough to leave headroom for the webhook hot path. The sequential filtering of `archived` and `isControlSurfaceRepo` repos is preserved before dispatch, so per-iteration log lines stay readable. ## Source Bug #21, wave-1 Performance / Probot expert (`docs/agent-fleet/bugs.md`). ## Test plan - [x] 834 tests pass - [x] eslint clean - [ ] After merge + a `/sync-all-repos` invocation in temper-ops: wall time should drop from ~30 s → ~10-15 s for 13-repo org. Visible in the bot's "Synchronized X repositories" reply timing. ## Risk & rollout - Risk: low. Same per-repo behaviour, just parallelised. Each repo's failure is still locally caught and logged. Failure of one doesn't cancel others (was true before too). - Rollout: self-update on merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Bug #21 from
docs/agent-fleet/bugs.md(wave-1 Performance + Probot expert).Inline
pLimitMaphelper (~12 lines, no dep).concurrency=3— overlaps GitHub round-trips without saturating CPU or rate-limit. Per-repo behaviour unchanged.🤖 Generated with Claude Code