Repository navigation
Conversation
efc94a0 to
28738f1
Compare
|
Thanks for tightening the Windows shell contract here. I reviewed the diff and ran the affected backend shell-contract/unit tests locally in a clean env with no repo secrets: Result: The implementation looks directionally good: resolving Bash through Git for Windows avoids accidentally invoking the WSL launcher, I’m not formally approving because this touches CI/shell-contract behavior and should still get maintainer review on the workflow impact, but I don’t see a blocker from this pass. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Concrete defect: bare 'bash' resolves to the System32 WSL launcher on Windows, so backend shell contract tests failed with UTF-16/GBK garbage and needs-typecheck.sh silently skipped type checking via the missing /dev/stdin. Shared testing.shell helper is the right seam; 41 tests pass and an AST audit proves no literal bash invocations remain. Green CI.
What changed and why
Resolve shell subprocesses through the active Git for Windows installation instead of invoking a bare
bash, which Windows process lookup can resolve to the System32 WSL launcher. A sharedtesting.shellhelper now discovers Git Bash fromgit --exec-path, converts native paths withcygpath, and keeps command arguments separate from shell source.Migrate every direct Bash subprocess in the backend test tree to that helper. Tests that inject fake tools now prepend their POSIX path inside Git Bash, and shell-consumed temporary scripts and path lists use LF explicitly. This covers workflow scope rendering, VM startup and reaper contracts, backend test runners, changed-files, gateway deploy probes, and the LC3 replay harness.
Make
backend/scripts/needs-typecheck.shconsume inherited stdin directly instead of redirecting/dev/stdin, which Git for Windows does not provide in this environment. This preserves file-list behavior while preventing the Windows pre-push hook from silently skipping backend type checking.Product invariants affected
none
How it was verified
backend/.venv/Scripts/python.exe -m pytestacross the 9 affected test modules (41 passed)backend/tests/**/*.py: zero subprocess commands whose executable is a literalbash,/bin/bash, or/usr/bin/bashblack --checkacross the 10 affected Python filesruff 0.4.4 checkacross the 10 affected Python files0 errors; existing warnings remain in older untyped tests)C:\Program Files\Git\bin\bash.exe -n backend/scripts/needs-typecheck.shgit diff --checkcheck-manifest-contractat the existing main-branch Windows Bash/Python command-resolution boundary; fix(ci): make Windows preflight path-safe #10825 fixes that independent release-guard test issue and is green.Tests
The focused suites were first run from ordinary PowerShell before the fixes and reproduced the WSL launcher failures, UTF-16/GBK decode warnings, fake-PATH misses, and
/dev/stdinfailure. The same combined suite now passes through Git Bash selected from the active Git installation.test_windows_bash_resolution_uses_the_active_git_installationalso covers discovery without relying on the host installation layout.Failure class (fixes)
Failure-Class: none