fix(ci): resolve Windows npm install timeout caused by SSH-locked git deps#1597
Conversation
tree-sitter-gleam and tree-sitter-clojure were locked in package-lock.json as git+ssh:// URLs. Windows CI runners have no SSH key configured for GitHub, so npm install hangs cloning these deps and times out at the 20-minute limit — causing every Windows CI job to fail on PR branches. Two changes: - package-lock.json: rewrite both resolved URLs from git+ssh:// to git+https:// so future installs use HTTPS directly - ci.yml: add git url.insteadOf config before every npm install as defense-in-depth so any future lockfile regeneration that captures SSH URLs does not break CI again
| git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" | ||
| git config --global url."https://github.com/".insteadOf "git@github.com:" |
There was a problem hiding this comment.
Second
git config silently overwrites the first
git config key value without --add replaces an existing key, so the second url.insteadOf call discards the first value. After both lines execute, only the git@github.com: → HTTPS rewrite is active; the ssh://git@github.com/ rewrite — the exact pattern that caused the original timeout — is silently a no-op. Add --add to the second call: git config --global --add url."https://github.com/".insteadOf "git@github.com:". The same two-line pattern appears at four other npm install blocks and needs the same fix.
There was a problem hiding this comment.
Fixed — added --add flag to the second git config url.insteadOf line at all 5 npm install blocks so both rewrites are active. Without --add, the ssh://git@github.com/ rewrite was silently discarded (replaced by the git@github.com: rewrite), leaving the exact URL pattern that caused the original Windows timeout unaddressed.
|
Addressed Greptile finding: added --add to the second git config url.insteadOf call at all 5 npm install blocks in ci.yml — without it the ssh:// rewrite was silently overwritten by the git@github.com: rewrite, leaving the exact URL pattern that caused the original Windows timeout unaddressed. |
Root cause
`tree-sitter-gleam` and `tree-sitter-clojure` were locked in `package-lock.json` as `git+ssh://git@github.com/...` URLs. The lockfile was generated on a machine with SSH configured for GitHub, so npm captured SSH as the resolved protocol.
Windows GitHub Actions runners have no SSH key for GitHub. When npm install hits these deps and the npm cache is cold, it tries to clone via SSH — which hangs indefinitely (no fast-fail, no fallback) and times out at the 20-minute CI limit. This is what killed every Windows job on PRs #1580 and #1581.
Main branch CI passes because its Windows runs have been completing sequentially (not cancelled mid-install), keeping the npm cache warm. PR branch runs are cancelled and restarted, so the cache never gets written and every run hits the cold-path hang.
Fix
`package-lock.json` — rewrite both `resolved` URLs from `git+ssh://` to `git+https://`. The commit hash and integrity fields are unchanged; the content is identical, just fetched over HTTPS.
`.github/workflows/ci.yml` — add `git config url.insteadOf` before every `npm install` block as defense-in-depth. This ensures any future lockfile regeneration that captures SSH URLs does not silently re-introduce the problem.
After merging
Rebase PRs #1580 and #1581 on main — their Windows CI jobs will pass immediately.