Repository navigation
fix(dev): support stdin '-' and normalize path separators in ci-pytest-batches.py - #1767
Conversation
|
While testing the new selective pytest hook from #1764 on Windows, noticed it crashed on /dev/stdin resolution and silently dropped backslash paths. Opened this PR to standardize on stdin -, normalize path separators, and keep the hook cleanly cross-platform. Ready for review whenever you get a chance @potiuk - happy to address any feedback or requested changes! |
- module docstring: `--changed-file` names a file, or `-` to read the changed paths from stdin - `--help` text for `--changed-file`: add "or - for stdin" Generated-by: Claude Code (Opus 5.5)
7b217f8 to
5687143
Compare
|
Thanks for adding the docstrings @potiuk! Formatted |
potiuk
left a comment
There was a problem hiding this comment.
Reading the list from stdin with - and normalising \ to / is the right fix for #1766: pipefail keeps a Python failure visible through the new | tr -d '\r', the CI path (tests.yml passes a real file) is unchanged, and the new test covers stdin with backslash paths. The one gap was documentation, so rather than ask for another round I pushed it to your branch as 7b217f8 before merging:
tools/dev/ci-pytest-batches.pymodule docstring:--changed-filenow says it takes a file, or-to read the changed paths from stdin.tools/dev/ci-pytest-batches.py--helptext for--changed-file: added "or - for stdin".
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
Contributing guide.
Summary
-and normalize Windows path separators intools/dev/ci-pytest-batches.py, resolvingFileNotFoundErrorand silent test drops on Windows (fix(dev): workspace-pytest hook crashes on Windows with FileNotFoundError for /dev/stdin and drops backslash paths #1766).tools/dev/run-workspace-check.shto pass--changed-file -and strip\rfrom command substitution so Windows paths do not failuv run --directory.try/except OSError: pytest.skip(...)withtarget_is_directory=Trueintools/dev/tests/test_ci_pytest_batches.pyfor platforms where symlink privileges are unheld, and add a unit test for stdin-with backslash paths.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
uv run pytest/ruff check/mypypassesprintf 'tools/agent-guard/src/agent_guard/__init__.py\n' | python3 tools/dev/ci-pytest-batches.py --changed-file - --paths-> outputstools/agent-guardprintf 'tools\\agent-guard\\src\\agent_guard\\__init__.py\n' | python3 tools/dev/ci-pytest-batches.py --changed-file - --paths-> outputstools/agent-guardtools/dev/run-workspace-check.sh pytest "pytest --version" tools/agent-guard/src/agent_guard/__init__.py tools/vcs/src/vcs/__init__.py-> passes across all 3 applicable members cleanly without CRLF syntax errors.RFC-AI-0004 compliance
<PROJECT>,<tracker>,<upstream>,<security-list>) used in all skill / tool prose (thecheck-placeholdersprek hook is the mechanical gate)Linked issues
Closes #1766