Repository navigation
feat(boards.py): port monitor_filters + check_tool from root platformio.ini (#3274 Phase 1) - #3277
Conversation
… exception_decoder Adds two new optional fields to the `Board` dataclass: - `monitor_filters: list[str] | None` — serial monitor decoders/filters - `check_tool: str | None` — `pio check` static-analysis tool ESP32-family boards (board_name or real_board_name starting with "esp32") auto-default `monitor_filters` to `["default", "esp32_exception_decoder"]` inside `Board.to_platformio_ini()` so that under `bash debug` and other flows that consume the synthesised `.build/pio/<env>/platformio.ini`, crash backtraces decode to file:line without depending on the root `platformio.ini` merge that `ci/compiler/pio.py:155` performs today. The auto-default matches the existing pattern used for QEMU flash-mode detection further up in the same method. A board can suppress the auto-default by setting `monitor_filters=[]`, or override it by setting a custom list. `check_tool` is opt-in per-board (no auto-default) because it only affects `pio check`, not the compile path. Root `platformio.ini` is deliberately left untouched — the two surfaces are orthogonal and both audiences (CI via boards.py; interactive `bash debug` / `bash autoresearch` / `pio run` via root) need the filters declared in their own file. This is Phase 1 of #3274 (sever root `platformio.ini` from CI compile path). The other Phase 1 item — PARLIO IRAM flag — is in PR #3276. Refs #3274 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesBoard monitor_filters and check_tool configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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
Phase 1 remainder of #3274. Adds two new optional fields to the
Boarddataclass and auto-applies the ESP32 crash-decoder filter for the ESP32 family so the synthesised.build/pio/<env>/platformio.inicarries them without depending on the rootplatformio.inimerge.monitor_filters: list[str] | None— serial monitor decoders/filterscheck_tool: str | None—pio checkstatic-analysis tool nameESP32-family boards (
board_nameorreal_board_namestarting withesp32) auto-defaultmonitor_filtersto["default", "esp32_exception_decoder"]insideBoard.to_platformio_ini(). This matches the existing QEMU flash-mode auto-detection pattern in the same method. A board can suppress the auto-default withmonitor_filters=[], or override it with a custom list.check_toolis opt-in per-board with no auto-default — it only affectspio check, not the compile path, and isn't a CI gap. Sets that want it can declarecheck_tool="clangtidy"explicitly.Why
PR #3276 (the PARLIO IRAM piece of Phase 1) and this PR together close the two gaps in
ci/boards.pythat the root-platformio.inimerge inci/compiler/pio.py:155is silently masking. With both landed, severing that merge (Phase 2 of #3274) becomes safe — every flag/filter the merge was carrying for CI has an authoritative declaration inboards.py.Root
platformio.inideliberately untouchedThe orthogonality rule:
ci/boards.pyand rootplatformio.iniserve disjoint audiences (CI vs. interactive local-dev). Root[env:generic-esp]retains its ownmonitor_filtersandcheck_tooldeclarations forbash autoresearch/bash debug/ rawpio run. Adding the flag toboards.pydoes NOT mean removing it from root — both surfaces independently need it.Verification
monitor_filterswithesp32_exception_decoderin the synthesised ini.bash lintclean.Files changed
ci/boards.py—Boarddataclass: 2 new optional fields;to_platformio_ini: ~18-line emission block with the ESP32 auto-detect. +31 / -0.Out of scope (deliberately deferred)
ci/compiler/pio.py:155— Phase 2 of Sever root platformio.ini from CI compile path; deprecate PioCompiler as a build fallback #3274.merge_root_platformio: bool = Falseparameter onPioCompiler— Phase 2.PioCompileras a build fallback — Phase 3.platformio.ini— orthogonality rule.check_tool="clangtidy"on the ESP32 boards — opt-in per-board; defer unless a use case forpio checkfrom the synthesised ini emerges.Possible textual conflict with #3276
Both PRs add fields/constants near each other in
ci/boards.py. Conflicts (if any) will be small and resolvable by whichever lands second.Test plan
bash lint— cleanmonitor_filtersand a non-ESP32 board does notmonitor_filtersline appears in.build/pio/esp32c6/platformio.iniRefs #3274
🤖 Generated with Claude Code
Summary by CodeRabbit