Repository navigation
refactor(python): dedup mount config parsing and add error-case tests - #788
Merged
Merged
Conversation
Follow-up to #768: - Extract shared parse_mount_configs() helper used by both PyBash and BashTool - Add comment explaining why realfs feature is always-on - Document live handle semantics on fs() (per-op interpreter lock) - Add error-case tests: unmount nonexistent, write to readonly, bad host path, read/stat missing files
…ailure The readonly text mount sets mode 0o444 but OverlayFs may still allow shell redirects. Test the actual guarantee (permission bits) instead.
chaliy
added a commit
that referenced
this pull request
May 30, 2026
…#788) ## Summary Follow-up to #768 addressing review feedback: - **Extract `parse_mount_configs()` helper** — removes ~50 lines of duplicated mount config collection between `PyBash::new()` and `BashTool::new()` - **Document `realfs` always-on** — one-line comment in Cargo.toml explaining why - **Document live handle semantics** — `fs()` docstrings in both Rust and `.pyi` stubs note per-op interpreter lock behavior - **Add error-case tests** — unmount nonexistent path, write to readonly mount, `FileSystem.real()` with bad host path, read/stat missing files ## Test plan - [ ] `cargo clippy -p bashkit-python --all-targets -- -D warnings` passes - [ ] `cargo fmt --check -p bashkit-python` passes - [ ] `ruff check crates/bashkit-python && ruff format --check crates/bashkit-python` passes - [ ] `pytest crates/bashkit-python/tests/ -v` passes (requires `maturin develop`) - [ ] CI green
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #768 addressing review feedback:
parse_mount_configs()helper — removes ~50 lines of duplicated mount config collection betweenPyBash::new()andBashTool::new()realfsalways-on — one-line comment in Cargo.toml explaining whyfs()docstrings in both Rust and.pyistubs note per-op interpreter lock behaviorFileSystem.real()with bad host path, read/stat missing filesTest plan
cargo clippy -p bashkit-python --all-targets -- -D warningspassescargo fmt --check -p bashkit-pythonpassesruff check crates/bashkit-python && ruff format --check crates/bashkit-pythonpassespytest crates/bashkit-python/tests/ -vpasses (requiresmaturin develop)