Show the receiver esphome version only when it builds with it - #2628
Conversation
|
@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 #2628 +/- ##
=======================================
Coverage 99.72% 99.72%
=======================================
Files 276 276
Lines 23490 23497 +7
=======================================
+ Hits 23426 23433 +7
Misses 64 64
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@esphbot review |
There was a problem hiding this comment.
Pull request overview
This PR fixes incorrect receiver ESPHome version labeling in the firmware tasks drawer by only attaching a receiver-side ESPHome version to a job when the receiver will actually build using its own installed ESPHome (i.e., when there’s a version mismatch and the receiver cannot provision the offloader’s version into a venv). This aligns the displayed build source with the real compiler environment used on the receiver.
Changes:
- Introduce
receiver_build_version()andbuild_source_for_pairing()inhelpers/build_scheduler.pyto centralize the “when should we surface receiver ESPHome version” rule alongside provisioning eligibility logic. - Remove
JobBuildSource.for_pairing()from the firmware model to avoid model-layer coupling to provisioning/version logic, updating call sites to usebuild_source_for_pairing(). - Add/adjust tests to cover the new stamping behavior, including dispatch behavior when
auto_provision_supportedis set.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_build_scheduler.py | Adds focused unit tests for receiver_build_version() and build_source_for_pairing(). |
| tests/models/test_firmware_job.py | Removes tests tied to the deleted JobBuildSource.for_pairing() constructor. |
| tests/controllers/firmware/test_remote_dispatch.py | Verifies remote dispatch stamps source_esphome_version only when the receiver truly builds with its own ESPHome. |
| tests/controllers/firmware/conftest.py | Extends pairing stubs to include auto_provision_supported for scheduler/dispatch tests. |
| esphome_device_builder/models/firmware.py | Removes JobBuildSource.for_pairing() and updates source_esphome_version semantics documentation. |
| esphome_device_builder/helpers/build_scheduler.py | Adds receiver_build_version() + build_source_for_pairing() and refactors provisioning check into _can_provision(). |
| esphome_device_builder/controllers/remote_build/submit_job_commands.py | Switches reset-build-env job creation to use build_source_for_pairing(). |
| esphome_device_builder/controllers/firmware/remote_dispatch.py | Switches remote dispatch stamping to use build_source_for_pairing() with the offloader version from the scheduler snapshot. |
| esphome_device_builder/controllers/firmware/clean.py | Switches remote clean fan-out jobs to use build_source_for_pairing(). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
Suggestion 2 taken in b2d2cf1: the reset build-env path imports the installed version directly instead of building a scheduler snapshot for one field. Suggestion 1 left as is. A cross-reference comment pointing at _resolve_esphome_cmd is the kind of framing this repo keeps out of code, and a receiver-reported build version is a wire change beyond this fix. The dev offloader window closes as soon as the receiver refuses to provision and the job re-routes local; the uncached CLEAN case is already surfaced in the job log by the receiver. |
|
@esphbot review |
1 similar comment
|
@esphbot review |
|
@esphbot review |
Confirmed both. b2d2cf1 imports Suggestion 1 accepted as won't-fix. Your reasoning holds: cross-reference prose contradicts AGENTS.md, and a receiver-reported version widens the wire. Dev-offloader window self-closes on provision refusal; uncached CLEAN already logs the fallback at |
PR Review — Show the receiver esphome version only when it builds with itMerge-ready. Prior suggestion 2 is fixed, suggestion 1 is dismissed with a reason I accept, and re-reading the head commit turned up nothing new. What's solid here:
✅ Resolved since last review (1)Previously-flagged issues verified fixed
Checklist
Automated review by Kōan (Claude) |
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
What does this implement/fix?
The firmware tasks drawer showed "Building on windoze (2026.8.0)" while the receiver was actually compiling with 2026.8.1 in a provisioned venv. The job snapshotted the pairing's installed esphome verbatim, so a receiver that auto provisions our version was labelled with the wrong one.
The version now only rides on the job when the receiver really builds with its own esphome: a version mismatch with no venv provisioning. Same version, or a provisionable mismatch, shows just the receiver name. The rule lives next to the scheduler's eligibility check in
helpers/build_scheduler.py(receiver_build_version/build_source_for_pairing), andJobBuildSource.for_pairingis gone since the model can't reach the version helpers.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.