fix(core): add timeouts to GitHub push flow to prevent CLI hangs#35011
Merged
Conversation
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit b7bf7fb
☁️ Nx Cloud last updated this comment at |
49c1601 to
e9d63ed
Compare
FrozenPandaz
requested changes
Mar 25, 2026
dfc4e82 to
96a4710
Compare
## Current Behavior The `pushToGitHub` flow calls `gh api user` and `gh repo create --push` with no timeout via `spawnAndWait()`/`execAndWait()`. When gh CLI is wrapped by 1Password SSH agent, credential managers with GUI prompts, SSH keys with passphrases, or corporate SSO, these calls hang indefinitely—freezing the CLI after workspace creation with no indication of what's happening. YTD data shows a 96.3% failure rate (16,426 failures out of 17,058 attempts). ## Expected Behavior - The initial `gh` auth check (`gh api user`) has a 2-second timeout. If gh is slow to respond (hung on credential prompt), the push flow is skipped gracefully instead of freezing. - The `gh repo create --push` command has a 60-second timeout. If the push hangs, the process is killed and a helpful message is shown. - If `gh` CLI is not installed, the push flow is skipped immediately without attempting any network calls. - Error messages now include actionable fallback: "You can push manually with: git push -u origin main". ## Related Issue(s) Fixes NXC-4141
FrozenPandaz
approved these changes
Mar 25, 2026
FrozenPandaz
pushed a commit
that referenced
this pull request
Mar 26, 2026
) ## Current Behavior The `pushToGitHub` flow in create-nx-workspace calls `gh api user` and `gh repo create --push` with no timeout. When `gh` CLI is wrapped by 1Password SSH agent, credential managers with GUI prompts, SSH keys with passphrases, or corporate SSO, these calls hang indefinitely — freezing the CLI after workspace creation with no indication of what's happening. YTD data shows a **96.3% failure rate** (16,426 failures out of 17,058 push attempts). ## Expected Behavior - The initial `gh` auth check (`gh api user`) has a **2-second timeout**. If `gh` is slow to respond (hung on credential prompt), the push flow is skipped gracefully instead of freezing. - The `gh repo create --push` command has a **15-second timeout**. If the push hangs, the process is killed and a helpful message is shown. - If `gh` CLI is not installed, the push flow is skipped immediately without attempting any network calls. - Error messages now include actionable fallback: *"You can push manually with: git push -u origin main"*. The error is now captured in `recordStat` as well, so when users see this we'll also see it in our stats. <img width="1026" height="334" alt="image" src="https://github.com/user-attachments/assets/10c0b4a8-9083-4063-9558-88ebb8a5a850" /> ## Related Issue(s) Fixes #34482, NXC-4141 (cherry picked from commit 96537f8)
Contributor
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Current Behavior
The
pushToGitHubflow in create-nx-workspace callsgh api userandgh repo create --pushwith no timeout. WhenghCLI is wrapped by 1Password SSH agent, credential managers with GUI prompts, SSH keys with passphrases, or corporate SSO, these calls hang indefinitely — freezing the CLI after workspace creation with no indication of what's happening.YTD data shows a 96.3% failure rate (16,426 failures out of 17,058 push attempts).
Expected Behavior
ghauth check (gh api user) has a 2-second timeout. Ifghis slow to respond (hung on credential prompt), the push flow is skipped gracefully instead of freezing.gh repo create --pushcommand has a 15-second timeout. If the push hangs, the process is killed and a helpful message is shown.ghCLI is not installed, the push flow is skipped immediately without attempting any network calls.The error is now captured in
recordStatas well, so when users see this we'll also see it in our stats.Related Issue(s)
Fixes #34482, NXC-4141