Repository navigation
Route Analyze memory through the remote build-server pool - #3032
Conversation
A paired receiver that advertises analyze_memory_supported now runs esphome analyze-memory itself and streams the report back; older receivers are skipped and the job runs locally as before.
|
ESPHome Bot (@esphbot) review |
Merging this PR will not alter performance
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3032 +/- ##
=======================================
Coverage 99.77% 99.77%
=======================================
Files 300 300
Lines 26522 26556 +34
=======================================
+ Hits 26461 26495 +34
Misses 61 61
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues require changes before approval.
No open issues 🎉
What changed in this PR
Routes Analyze Memory through the existing remote build-server pool, addressing #3003 so capable paired receivers can perform the build and analysis instead of the local dashboard.
Changes:
- Adds capability-aware scheduling at submission and dispatch, preserving local fallback for older receivers.
- Introduces an
analyze_memorywire target, streams the report without downloading artifacts, and skips local hash refresh for remote analysis. - Extends capability persistence, events, tests, and documentation; no frontend changes are needed.
| File | Description |
|---|---|
| tests/test_remote_build_submit_job.py | Tests receiver creation of analysis jobs. |
| tests/test_remote_build_peer_link.py | Checks handshake capability advertisement. |
| tests/test_remote_build_peer_link_client.py | Tests capability parsing and pairing refresh. |
| tests/test_remote_build_controller.py | Tests capability exposure in pairing summaries. |
| tests/controllers/firmware/test_remote_runner.py | Tests remote analysis without artifact downloads. |
| tests/controllers/firmware/test_remote_dispatch.py | Tests capability-aware dispatch and local fallback. |
| tests/controllers/firmware/test_refresh.py | Tests hash refresh behavior by job source. |
| tests/controllers/firmware/test_analyze_memory.py | Tests analysis scheduling with capable and older receivers. |
| tests/controllers/firmware/conftest.py | Adds capability support to pairing fixtures. |
| esphome_device_builder/models/remote_build/wire_frames.py | Defines shared submission targets including analysis. |
| esphome_device_builder/models/remote_build/offloader.py | Adds stored and summarized analysis capability. |
| esphome_device_builder/models/remote_build/offloader_events.py | Adds capability fields to event payloads. |
| esphome_device_builder/models/remote_build/__init__.py | Exports the shared submission-target type. |
| esphome_device_builder/helpers/build_scheduler.py | Filters analysis scheduling inputs by receiver capability. |
| esphome_device_builder/controllers/remote_build/submit_job/const.py | Maps the analysis target to its job type. |
| esphome_device_builder/controllers/remote_build/provision.py | Declares receiver support for remote analysis. |
| esphome_device_builder/controllers/remote_build/peer_link/wire_io.py | Advertises analysis support during handshakes. |
| esphome_device_builder/controllers/remote_build/peer_link_client/one_shot.py | Extracts the capability with a false default. |
| esphome_device_builder/controllers/remote_build/peer_link_client/client.py | Carries capability data and accepts the analysis target. |
| esphome_device_builder/controllers/remote_build/peer_link_client/_submit.py | Uses shared target typing for submission frames. |
| esphome_device_builder/controllers/remote_build/peer_link_client/_dispatch.py | Includes analysis capability in session-open events. |
| esphome_device_builder/controllers/remote_build/peer_link_client/__init__.py | Exports the capability extraction helper. |
| esphome_device_builder/controllers/remote_build/pair_status.py | Includes capability in pairing-added events. |
| esphome_device_builder/controllers/remote_build/pair_commands.py | Preserves capability when re-pairing. |
| esphome_device_builder/controllers/remote_build/bus_handlers.py | Refreshes stored capability on session open. |
| esphome_device_builder/controllers/remote_build/_summaries.py | Projects capability into pairing summaries. |
| esphome_device_builder/controllers/firmware/remote_runner.py | Dispatches analysis and completes without artifact retrieval. |
| esphome_device_builder/controllers/firmware/remote_dispatch.py | Applies capability filtering when assigning queued jobs. |
| esphome_device_builder/controllers/firmware/factories.py | Generalizes compile scheduling for analysis jobs. |
| esphome_device_builder/controllers/firmware/controller.py | Routes the analysis command through the scheduler. |
| esphome_device_builder/controllers/firmware/constants.py | Includes analysis among remote-pool job types. |
| esphome_device_builder/controllers/firmware/_state.py | Holds pending analysis jobs in the remote pool. |
| esphome_device_builder/controllers/devices/firmware_sync.py | Skips local hash recomputation after remote analysis. |
| docs/ARCHITECTURE.md | Documents remote analysis and capability propagation. |
| docs/API.md | Documents analysis routing and handshake additions. |
Review effort: Balanced
|
|
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
ESPHome Bot (@esphbot) review |
PR Review — Route Analyze memory through the remote build-server poolReady to merge. Both nits from my last review are fixed, and I found nothing new. What the PR does well:
Prior findings, now resolved:
Checklist
Automated review by Kōan (Claude) |
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
What does this implement/fix?
Analyze memory now runs on a paired build server like Compile and Install do, so it stops pulling toolchains and building on the local machine.
esphome analyze-memoryitself and the report streams back as job output; nothing is downloaded.analyze_memory_supportedhandshake flag, so an older receiver is never picked and the job runs locally as before.How it works
The receiver accepts a new
submit_jobtarget,analyze_memory. On the offloader,build_scheduler.inputs_for_job_typenarrows the pairings to capable receivers both at submit and in the dispatch pool, aREMOTE_PENDINGanalysis waits in the pool beside compiles, and the runner finalises it on the receiver's terminal frame without fetching artifacts (same as clean). The post job hash refresh is skipped for a remote analysis since there is no localbuild_info.jsonto read. The capability is plumbed the same way asreset_build_env_supported.Related issue or feature (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesFrontend coordination
Checklist
ruff,codespell, yaml/json/python checks).tests/where applicable.components.index.json/definitions/components/*.jsonhave not been hand-edited (regenerate viascript/sync_components.pyif a sync is needed).docs/ARCHITECTURE.mdand/ordocs/API.md.