Parallelize repository cloning during dev environment setup#72
Merged
swissspidy merged 4 commits intomainfrom Apr 10, 2026
Merged
Parallelize repository cloning during dev environment setup#72swissspidy merged 4 commits intomainfrom
swissspidy merged 4 commits intomainfrom
Conversation
1 task
Agent-Logs-Url: https://github.com/wp-cli/wp-cli-dev/sessions/6509f703-3861-4c87-83a6-f0247ed1904b Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement parallel repository cloning during development setup
Parallelize repository cloning during dev environment setup
Apr 9, 2026
thelovekesh
reviewed
Apr 9, 2026
Agent-Logs-Url: https://github.com/wp-cli/wp-cli-dev/sessions/28119b52-0b7a-445b-b43e-f3189c004e28 Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
…n, cap cores to 8 with env override, drop redundant -n1, exact arg count in clone helper Agent-Logs-Url: https://github.com/wp-cli/wp-cli-dev/sessions/aab74529-eccb-4e94-949e-b1062afb30b2 Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
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.
Sequential
git clonecalls duringcomposer install/composer updatemade initial dev environment setup unnecessarily slow. The refresh step already usedxargsfor parallelism; cloning did not.Changes
.maintenance/clone-all-repositories.sh: Bash script that orchestrates the full clone + refresh flow. Checks thatjqis available at startup with a clear error message. Detects CPU cores vianproc(Linux) orsysctl -n hw.logicalcpu(macOS), defaulting to 4 if neither is available, and caps parallelism at 8 to avoid saturating GitHub connections or IO. The cap can be overridden via theCLONE_JOBSorWPCLI_DEV_JOBSenvironment variables. Fetches the repository list from the GitHub API usingcurl -fsS(failing fast on HTTP errors), validates the response is a JSON array (with distinct messages for rate-limit errors vs. unexpected shapes), parses withjq, filters the skip list, applies the destination map, then clones missing repos and refreshes all repos in parallel usingxargs -P$CORES..maintenance/clone-repository.sh: Bash helper that clones a single repository, accepting exactly<destination>and<clone_url>as arguments (rejects anything other than exactly 2 args)..maintenance/clone-all-repositories.phpand.maintenance/clone-repository.php.composer.json:pre-install-cmdandpre-update-cmdnow callbash .maintenance/clone-all-repositories.sh.