fix: seed private mirror over gh-authenticated HTTPS to stop setup hang#43
Merged
Conversation
`venfork setup` hung forever at "Pushing <branch> to private mirror repository". The upstream clone uses `gh repo clone` (HTTPS + gh token), but the seeding push forced a raw SSH URL (git@github.com:...). When SSH is not usable (no key, passphrase-protected key, or unknown host key), ssh prints an interactive prompt that is invisible behind the @Clack spinner, with no timeout and no progress, so setup hangs indefinitely. - Add `netExec`: execa `$` bound with stdin ignored (credential/host-key prompts fail fast instead of hanging), a hard timeout (VENFORK_GIT_TIMEOUT, default 10m), non-interactive env (GIT_TERMINAL_PROMPT=0, GCM_INTERACTIVE=never, GIT_SSH_COMMAND="ssh -o BatchMode=yes -o ConnectTimeout=15"), and inherited stderr for live git progress. - Add `runNetOp`: wraps a network op with start/stop messages and turns a timeout into a clear GitError instead of an indefinite hang. - Seed the new mirror over gh-authenticated HTTPS using gh as a per-invocation git credential helper, with http.lowSpeedLimit/Time so a stalled transfer aborts in 60s. No SSH dependency, no global gitconfig mutation, no token in argv. Saved remote URLs are unchanged. - Route both `gh repo clone` calls through `runNetOp` with --progress. Tests: extend the @Clack mock with log.success/step; assert the seeding push uses HTTPS + gh credential helper + --progress and never the raw SSH URL, and that both clones pass --progress.
There was a problem hiding this comment.
Pull request overview
Fixes a venfork setup hang where the seeding push to a new private mirror used a raw SSH URL while the rest of the flow uses gh-authenticated HTTPS. When SSH was unusable, an invisible interactive prompt blocked the push forever. The PR introduces a non-interactive, timeout-bounded execa wrapper for network git/gh operations, switches seeding to HTTPS using gh as a per-invocation credential helper, and adds --progress to clones so large transfers are visible.
Changes:
- Adds
netExec/runNetOphelpers with hard timeout,stdin: ignore, non-interactive env (GIT_TERMINAL_PROMPT=0,GCM_INTERACTIVE=never,GIT_SSH_COMMAND='ssh -o BatchMode=yes -o ConnectTimeout=15'), and a typedGitErroron timeout. - Routes seeding push through HTTPS +
credential.https://github.com.helper=!gh auth git-credentialwithhttp.lowSpeedLimit/Timeguards; saved remote URLs remain SSH. - Adds
--progressto upstream/private clones and adds tests asserting HTTPS seeding, credential helper, no SSH URL in seed push, and--progresson clones.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/commands.ts | New netExec/runNetOp helpers; seed push moved to HTTPS via gh credential helper; clones get --progress. |
| tests/commands.test.ts | Extends @clack mock with log.success/log.step; adds tests for HTTPS seeding and --progress clones. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 15, 2026
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.
Problem
venfork setuphangs forever at the spinnerPushing <branch> to private mirror repository.Root cause: the upstream clone uses
gh repo clone(HTTPS + gh token), but the seeding push forced a raw SSH URL (git@github.com:...). When SSH is not usable (no key, passphrase-protected key, orgithub.comhost key not inknown_hosts),sshemits an interactive prompt that is invisible behind the @Clack spinner. With no timeout and no progress, setup hangs indefinitely. Large monorepos (e.g. genkit-ai/genkit) make a working push look dead too, since there is zero feedback.Changes (
src/commands.ts)netExec(cwd?)— execa$bound withstdin: ignore(credential/host-key prompts fail fast instead of hanging), a hard timeout (VENFORK_GIT_TIMEOUT, default 10m), non-interactive env (GIT_TERMINAL_PROMPT=0,GCM_INTERACTIVE=never,GIT_SSH_COMMAND="ssh -o BatchMode=yes -o ConnectTimeout=15"), inherited stderr for livegit --progress.runNetOp(start, stop, op)— start/stop messaging; converts a timeout into a clearGitErrorinstead of an indefinite hang.https://github.com/<owner>/<name>.gitusing gh as a per-invocation git credential helper, plushttp.lowSpeedLimit/Timeso a stalled transfer aborts in 60s. No SSH dependency, no global gitconfig mutation, no token in argv. Saved remote URLs (privateCloneUrl/publicForkUrl) are unchanged — only transient seeding traffic moves to HTTPS.gh repo clonecalls routed throughrunNetOpwith-- --progress.Tests (
tests/commands.test.ts)log.success/log.step.--progressand never the raw SSH URL.--progress.Verification
bunx tsc --noEmit— cleanbun run check(biome) — cleanbun test— 288 pass, 0 fail, 6 skip (e2e)