fix(test-ipc-server): allow tilde in shell-arg paths for Windows 8.3 short names#11661
Conversation
…short names
`os.tmpdir()` on GitHub's Windows runners returns the 8.3 short-name form
of the user-profile directory (e.g. `C:\Users\RUNNER~1\AppData\Local\Temp`)
because `runneradmin` is longer than 8 characters. The `~` then trips the
`quoteShellArg` allowlist regex and every test that calls `sendLineScript`
or `generateSendStdinScript` throws "Unsupported character in shell argument".
The tilde is safe to allow:
- cmd.exe performs no tilde expansion at all.
- POSIX shells only expand `~` when it is unquoted at the start of a word;
inside the double-quoted `"${arg}"` wrapper produced here it is literal.
The matching CodeQL shell-injection sanitization argument is unchanged —
the allowlist is still anchored and still rejects every metacharacter.
The bug was masked until #11659 because the Windows test legs had been
silently no-op'ing since #11608.
---
Written by an agent (Claude Code, claude-opus-4-7).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (1)📚 Learning: 2026-05-14T09:04:00.133ZApplied to files:
🔇 Additional comments (3)
📝 WalkthroughWalkthroughTestIpcServer's shell argument quoting mechanism extends its ChangesShell Argument Allowlist Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…short names (pnpm#11661) `os.tmpdir()` on GitHub's Windows runners returns the 8.3 short-name form of the user-profile directory (e.g. `C:\Users\RUNNER~1\AppData\Local\Temp`) because `runneradmin` is longer than 8 characters. The `~` then trips the `quoteShellArg` allowlist regex and every test that calls `sendLineScript` or `generateSendStdinScript` throws "Unsupported character in shell argument". The tilde is safe to allow: - cmd.exe performs no tilde expansion at all. - POSIX shells only expand `~` when it is unquoted at the start of a word; inside the double-quoted `"${arg}"` wrapper produced here it is literal. The matching CodeQL shell-injection sanitization argument is unchanged — the allowlist is still anchored and still rejects every metacharacter. The bug was masked until pnpm#11659 because the Windows test legs had been silently no-op'ing since pnpm#11608. --- Written by an agent (Claude Code, claude-opus-4-7).
Summary
os.tmpdir()returns the 8.3 short-name form of the user profile dir —C:\Users\RUNNER~1\AppData\Local\Temp— becauserunneradminis longer than 8 chars. The~character then trips the allowlist regex in__utils__/test-ipc-server/src/TestIpcServer.ts'squoteShellArg, and every test that callssendLineScriptorgenerateSendStdinScriptthrowsUnsupported character in shell argument.~to the allowlist:cmd.exeperforms no tilde expansion at all.~when it is unquoted at the start of a word; inside the double-quoted"${arg}"wrapper produced byquoteShellArgit is literal.building/commands'recursive.ts:rebuild multiple packages in correct order.Test plan
building/commands'test/build/recursive.ts.Written by an agent (Claude Code, claude-opus-4-7).
Summary by CodeRabbit
~character, improving compatibility with Windows short-path notation and Unix home directory references in test scenarios.