fix(fbuild-python): forward PLATFORMIO_SRC_DIR through build/deploy requests (#274)#310
Conversation
…equests (#274) The Rust CLI reads `PLATFORMIO_SRC_DIR` and forwards it into `BuildRequest`/`DeployRequest.src_dir`, but the PyO3 `DaemonConnection` and `AsyncDaemonConnection` request model omitted `src_dir` entirely. FastLED's autoresearch wrapper uses the Python binding, so the caller env override was lost and the daemon fell back to `platformio.ini`'s `src_dir = examples/Sailboat` instead of the requested `examples/AutoResearch`. Add `src_dir: Option<String>` to the shared `OpRequest` and a `platformio_src_dir_from_env()` helper that mirrors the CLI's `.ok().filter(|s| !s.is_empty())` contract. Both the sync and async `build_request`/`deploy_request` constructors now populate `src_dir` from the env var; monitor requests intentionally leave it `None` since the daemon doesn't compile during monitor. Python signatures are unchanged. Tests: - `platformio_src_dir_helper_*` exercise set / unset / empty env values. - `daemon_connection_*` and `async_daemon_connection_*` request constructors verify forwarding when set and omission when unset for both build and deploy. - `op_request_serializes_src_dir_only_when_set` guards the wire format so the daemon's `platformio.ini` fallback still kicks in when the env var is unset. Env-var tests share a `Mutex<()>` and an RAII guard (`PlatformioSrcDirGuard`) that holds the lock across set -> call -> assert -> restore, so cargo's default parallel test runner doesn't race them. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 47 minutes and 26 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
src_dir: Option<String>to PyO3OpRequest; populate fromPLATFORMIO_SRC_DIRin both syncDaemonConnectionand asyncAsyncDaemonConnectionbuild/deploy requests, matching the CLI.PlatformioSrcDirGuard(RAII + module-levelMutex<()>) keeps env-mutating tests serialized without--test-threads=1.Closes #274.
Test plan
soldr cargo check --workspace --all-targetssoldr cargo clippy --workspace --all-targets -- -D warningssoldr cargo test -p fbuild-python— 23 tests (10 new, 13 existing)bash ./testfull workspace — 0 failures🤖 Generated with Claude Code