Skip to content

perf(sync): shallow clone, parallel sync, and operation timeouts#7

Open
cedric-appdirect wants to merge 1 commit into
jgordijn:mainfrom
cedric-appdirect:perf/parallel-sync-timeouts
Open

perf(sync): shallow clone, parallel sync, and operation timeouts#7
cedric-appdirect wants to merge 1 commit into
jgordijn:mainfrom
cedric-appdirect:perf/parallel-sync-timeouts

Conversation

@cedric-appdirect

Copy link
Copy Markdown

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 ) 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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant