ci: harden script path validation and subprocess error handling in run_checks_parallel with CLI suite #2590
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2598"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-25T22:32:47Z.
Summary
tools/run_checks_parallel.py:main(argv=None) -> intvia_validate_script_path(), rejecting empty/whitespace, missing, directory, and non-regular paths cleanly with exit status 1 and zero raw tracebacks before launchingrun_checks().run_one(check)against empty commands (ValueError) and catch(OSError, subprocess.SubprocessError)withstdin=subprocess.DEVNULLso spawn/executable failures never crashThreadPoolExecutor, returning deterministic failure output and status 1 while sibling checks continue in order.(ValueError, OSError, subprocess.SubprocessError)cleanly inmain()while preserving-j 0worker clamping (max(1, jobs)), ordered::group::/::endgroup::output,SKIP_EXIT_CODE = 77reporting, andrun_checks(checks, jobs=None)signature.tests/run_checks_parallel_cli_check.pyand registerci_run_checks_parallel_cli_checkinCMakeLists.txt.Verification
python -B tests/run_checks_parallel_cli_check.py -v->Ran 7 tests in 1.546s(OK, exit 0)python -B tests/run_checks_parallel_check.py->run_checks_parallel_check: ok(exit 0)run_oneOSError/SubprocessErrorhandlers & return code,mainValueError/OSError/SubprocessErrorhandlers & exit code, upfront validation loop,-jclamping, andargvforwarding) ->15/15 KILLEDpython -B tests/form_coverage_check.py->form coverage checks passed(exit 0)python -B tests/docs_links_check.py->Self-test passed. Checked 19 Markdown files and 498 links.(exit 0)python -B tests/bidi_controls_check.py->Self-test passed. Checked 1829 tracked source, script and build/CI files: no bidirectional controls.(exit 0)AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T22:41:05Z.
Review: COMMENTED
Review of head
1a5db4b7against origin/main (3 commits behind, no overlap with the changed files).What I checked:
tools/run_checks_parallel.py(upfront script path validation, spawn-error handling inrun_one,main()error exit), the newtests/run_checks_parallel_cli_check.py, and the CMake registration.-j 0clamping, the::group::output andSKIP_EXIT_CODE = 77are unchanged.windows.ymlusesrun_checksand the CLI with real script paths) are not affected.Commands run locally:
python3 -B tests/run_checks_parallel_cli_check.py-> 7 tests OKpython3 -B tests/run_checks_parallel_check.py-> okpython3 tests/docs_links_check.py-> ok;python3 tests/bidi_controls_check.py-> ok;git diff --check origin/main...HEAD-> cleanZeroDivisionErrorinstead of(OSError, SubprocessError)inrun_one-> the suite fails (6 errors).stdin=subprocess.DEVNULL-> the suite still passes. Not a blocker: nothing in the tests guards that line. A test that runs a child which reads stdin would cover it.No blocking findings.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T22:43:24Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
1a5db4b7d388667484bd460b2d305d2699ed5170:--preset dev):cmake --build --preset dev -- -j 2):50.40s(configure4.28s)ctest --preset dev -R '^ci_run_checks_parallel_cli_check$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (1.52s:ci_run_checks_parallel_cli_check1.41s)/O2(--preset release):cmake --build --preset release -- -j 2):57.17s(configure1.85s)ctest --preset release -R '^ci_run_checks_parallel_cli_check$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (1.39s:ci_run_checks_parallel_cli_check1.29s)tests/run_checks_parallel_check.pyok (1.7s)sccache: 196/212 hits; wall129.4sAI-assisted; commands listed were executed locally.