perf(sync): shallow clone, parallel sync, and operation timeouts#7
Open
cedric-appdirect wants to merge 1 commit into
Open
perf(sync): shallow clone, parallel sync, and operation timeouts#7cedric-appdirect wants to merge 1 commit into
cedric-appdirect wants to merge 1 commit into
Conversation
Three performance and resilience improvements: 1. Shallow clone (--depth=1 --single-branch): only fetches a single commit and its tree/blobs. For branch/tag refs, uses --branch to clone directly at the right ref. For commit SHAs, clones default branch shallowly then does a targeted fetch (git fetch --depth=1 origin <sha>) of the specific commit. Requires git 2.5+. 2. Parallel sync: syncRepositories now uses Promise.all instead of a sequential for-loop. Each syncRepository captures its own errors into SyncResult.error, so one bad repo doesn't reject the batch. 3. Operation timeouts: withTimeout helper (60s default) wraps git clone and fetch. Prevents hung git processes from blocking the plugin indefinitely. Uses typed TimeoutError for discrimination. Assisted-by: OpenCode with claude-opus-4-7 Signed-off-by: Cedric BAIL <cedric.bail@appdirect.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.
Three performance and resilience improvements:
Shallow clone (--depth=1 --single-branch): only fetches a single commit and its tree/blobs. For branch/tag refs, uses --branch to clone directly at the right ref. For commit SHAs, clones default branch shallowly then does a targeted fetch (git fetch --depth=1 origin ) of the specific commit. Requires git 2.5+.
Parallel sync: syncRepositories now uses Promise.all instead of a sequential for-loop. Each syncRepository captures its own errors into SyncResult.error, so one bad repo doesn't reject the batch.
Operation timeouts: withTimeout helper (60s default) wraps git clone and fetch. Prevents hung git processes from blocking the plugin indefinitely. Uses typed TimeoutError for discrimination.