fix(git): run git and gh non-interactively so prompts can't hang the tools - #1365
Piyushrathoree wants to merge 1 commit into
Conversation
nc-review: nothing to raise@Piyushrathoree — nothing to raise from the automated review. The PR closes stdin and sets 🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
|
Hey @Piyushrathoree, one of the required tests is currently failing. Could you fix that? Once it’s resolved I’ll review the PR. |
74e4dce to
ac27a7c
Compare
ac27a7c to
613e494
Compare
|
@akramcodez its passing locally not sure why its failing over here |

Fixes #1344.
Description
execProcessinsource/tools/git/utils.tsspawnedgitandghwith inherited stdin, noGIT_TERMINAL_PROMPT, and no timeout. Anything that asked for input (a credential helper, a pre-commit hook reading stdin) blocked forever, and since everygit_*tool andgit_prgo through it, the whole process froze.Now stdin is
ignore,GIT_TERMINAL_PROMPT=0is set (same asskills/install.tsalready does for clone), and a 60s timeout kills the child and rejects. The timeout settles immediately instead of waiting onclose, because a helper git spawned (ssh, gpg, credential manager) can still hold the stderr pipe and keepclosefrom ever firing.GIT_TERMINAL_PROMPT=0only covers git's own credential prompt. SSH passphrase and gpg pinentry read the tty directly, so those are caught by the timeout rather than prevented. 60s matchesCLONE_TIMEOUT_MS;git_commitruns hooks under it, so happy to raise it if that feels tight.Testing
utils.spec.tscheckGIT_TERMINAL_PROMPTreaches the child and that a!catalias returns instead of blocking. Both fail (the second hangs) against the old code.git ls-remoteon an HTTPS repo withcredential.helper=now fails in under a second withcould not read Username ... terminal prompts disabled.git_commitwith a pre-commit hook that reads stdin completes.!sleep 300alias rejects at 60s withGit command timed out after 60s, no orphan process.Type of Change
Changeset
pnpm changeset) describing this change for the changelogTesting
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist