fix(cron): normalize bash script paths on Windows - #23489
Conversation
|
Thanks for the focused Windows compatibility fix. The premise remains live on current main: The common A separate open item, #46364, documents WSL Automated hermes-sweeper review. |
|
Independent verification of this fix against current Premise still live on current main: Merge verification (3-way against origin/main 6858e0d):
Tests (merged tree, direct pytest, Windows native git-bash):
Recommendation: this is the cluster's canonical fix — the only open PR with a sweeper |
CI on this branch is stale (May 11 base) — not caused by this PR — and the fix is a strict subset of the open canonical #52204, which is fully greenDiagnosis of the three failing checks (runs 25645674966 / 25645675001):
No failure in any failing job is attributable to this PR's two files. On the fix itself: Premise check on current main ( Recommendation: close as duplicate of #52204 (matches the triage verdict). The fix and its regression tests are already carried there with green CI; nothing in this branch is lost. |
|
Correction to my earlier comment: the canonical for this cluster is #77393 (open, all required checks green,
Recommendation stands with the corrected pointer: close this PR as a duplicate of #77393. Nothing in this branch is lost — the |
What does this PR do?
Fixes native Windows Git Bash cron
.sh/.bashscript execution by normalizing the script argument to a forward-slash path before invokingbash.Without this,
_run_job_script()passes a native Windows path likeC:\Users\denis\.hermes\scripts\hermes-backup.sh, and Git Bash treats the backslashes as escape characters, mangling the path intoC:Usersdenis...and failing with exit code 127.Related Issue
Fixes #23404
Type of Change
Changes Made
_format_bash_script_path()in/cron/scheduler.pyto centralize bash path formatting..sh/.bashexecution in_run_job_script()to use a bash-safe path argument on Windows./tests/cron/test_scheduler.pyfor Windows and POSIX path formatting behavior.How to Test
uv run --frozen pytest -q -o addopts='' tests/cron/test_scheduler.pyuv run --frozen ruff check cron/scheduler.py tests/cron/test_scheduler.py.shscript and verify the script path reaches bash in forward-slash form instead of losing backslashes.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
uv run --frozen pytest -q -o addopts='' tests/cron/test_scheduler.py->123 passeduv run --frozen ruff check cron/scheduler.py tests/cron/test_scheduler.py->All checks passed!pytest tests/ -qentrypoint still fails during collection on both this branch and a cleanorigin/mainworktree with the same preexisting environment-level errors (tomllib,acp,websockets.asyncio,StrEnum), so I left that checklist item unchecked rather than claiming a false full-green run.