Skip to content

Make OPERATIONS.md Independent of How ESPHome Runs - #223

Merged
ptr727 merged 6 commits into
developfrom
docs/host-agnostic-operations
Oct 15, 2026
Merged

ptr727 merged 6 commits into
developfrom
docs/host-agnostic-operations

Conversation

@ptr727

@ptr727 ptr727 commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • OPERATIONS.md no longer assumes one way of running ESPHome. A copy of this repository may be the dashboard's live /config, or a checkout on a development box with a board on its USB port. A new "Running the ESPHome CLI" section, under "Container and CLI", states the routes once:
    • the dashboard's container, through docker exec esphome,
    • a throwaway container of the same image,
    • uvx --from esphome==<version> esphome ..., with uvx --from esphome==<version> esptool ... for the esptool that release pins,
    • a pinned venv.
  • The section also says how each route pins the dashboard's ESPHome version, and that every route needs a root secrets.yaml. It says where ESPHome's data directory, build tree, and ESP-IDF toolchain cache live on each route.
  • The other commands now take one form, esphome <command> <device>.yaml. Paths that exist only in the container (/cache/build, /cache/data/packages, /opt/venv/...) are described relative to the data directory.
  • The docker exec logs hazard and its /proc cleanup are limited to the dashboard's container. On the uvx route, timeout 25 uvx --from esphome==2026.9.1 esphome logs ... exits 124 and leaves no process behind. Log captures go to the git-ignored logs/ directory.
  • "Framework and Platform Versions" is rewritten for the native ESP-IDF toolchain that ESP32 builds use by default in 2026.9.1. It covers toolchain and --toolchain, version for both frameworks, platform_version, source, which platformio_options still apply, and which platforms build only with PlatformIO. Closes Update OPERATIONS framework notes for the native esp-idf build #217.
  • The host-tools.json note now names uv and python3 beside docker as the ways the ESPHome CLI is reached.

Local Review Findings

Recorded local passes ran before every push. Each finding they listed on text this change wrote now has an outcome.

  1. OPERATIONS.md "Running the ESPHome CLI", toolchain paragraph: the esphome clean-all description was wrong about which directories it empties. Class: introduced. Fixed in 7fd3a32, 756af1d, and c6787c7. The text now says what the command costs rather than listing paths: the toolchain cache, the PlatformIO core directory, and the data directory of each config it reaches.
  2. OPERATIONS.md "Building Against Patched ESPHome Core Components": "esphome clean-all empties .esphome/" held only for some invocations. Class: introduced. Fixed in 756af1d, which now says "can empty it".
  3. OPERATIONS.md "Framework and Platform Versions": the nRF52 bullet left out that its PlatformIO toolchain is deprecated. Class: introduced. Fixed in 7fd3a32.
  4. OPERATIONS.md "Running the ESPHome CLI": the secrets.yaml guard was said to run "for any route", against its own placeholder. Class: introduced. Fixed in 7fd3a32 and 756af1d.
  5. "Deprecated and removed in 2027.2.0" read as already removed, and the throwaway-container logs bullet rested on an unchecked assumption. Class: style and introduced. Fixed in 7fd3a32 and 756af1d. The docker run behavior is now verified: a timeout inside the container exits 124 and leaves nothing running, while one outside leaves the container running.
  6. The docker run logs example lacked --rm, so "leaves no container" was false as written. Class: introduced. Fixed in 756af1d.
  7. The early-closing pipe note claimed more than its docker exec evidence showed. Class: introduced. Fixed in c6787c7.
  8. The last pass noted two places where the esphome clean-all sentence could be more exact. In a container route, "the data directory of each config" reads as /cache/data. And "empties" leaves out that storage/ and top-level .json files survive. Class: introduced, low. No change needed. The reviewer found the sentence true on every route against clean_all() at 2026.9.1. Each gap errs toward deleting more, and the patched-component note warns on its own.

Pre-existing findings from the same passes are filed as #220, #221, and #222.

Test Plan

  • markdownlint-cli2 clean, run on a snapshot of tracked files per "Repository Tooling Hazards".
  • Prose gate clean on the diff. --check sentence-length reports only the pre-existing sdkconfig sentence that Re-check the sdkconfig clean-build claim in OPERATIONS.md on ESPHome 2026.9.1 #220 covers.
  • Each claim about ESPHome behavior was checked against the 2026.9.1 source.
  • Each new uvx command was run on ESPHome 2026.9.1: esphome version, esptool version (5.3.1), the component-grep recipe, and the timeout logs run.
  • The docker run logs timeout was run both ways on ptr727/esphome-nonroot:2026.9.1.
  • All reference-style links are defined and used, and every in-page anchor resolves.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated ESPHome guidance for dashboard, temporary-container, and pinned local installation workflows, including validation, flashing, and log collection.
    • Clarified build requirements, component-source lookup, framework toolchains, VSCode setup, and PlatformIO project paths.
    • Updated the host-tools note to reflect the supported ways to access the ESPHome CLI.

ptr727 and others added 3 commits October 14, 2026 16:32
A copy of this repository is used from the dashboard's container, from a
throwaway container, or through uvx on a development box with a board on
USB. The commands now take one form, with a new "Running the ESPHome CLI"
section that states the three routes once, how each pins the dashboard's
version, and where each keeps ESPHome's data directory. Container-only
paths and the docker exec logs hazard are scoped to the routes they
belong to.

"Framework and Platform Versions" now describes the native esp-idf
toolchain that ESP32 builds use by default in 2026.9.1, where
platform_version is dropped and platformio_options are ignored.

Closes #217

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Scope the throwaway container to checkouts other than the dashboard's copy,
keep log captures in the ignored logs/ directory, pin esptool through the
esphome release, and say where the ESP-IDF toolchain lives on each route.
State which platformio_options the native toolchain still applies, what
version means for the arduino framework, and that platform_version needs
an exact version under the PlatformIO toolchain. Note that the ESPHome CLI
also reaches a host through uvx in host-tools.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name the build tree by the node name beside the YAML, say when ccache is
used and that esphome clean-all deletes the toolchain cache, correct
build_unflags on the native ESP-IDF toolchain, add nRF52, and carry the
CI-parity exception into the pinning rule. Use mktemp without a fixed
/tmp path, and name the pinned venv in host-tools.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 14, 2026 23:59
@ptr727

ptr727 commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 18be5b71462520779c48b3f86153e608a8ef2386, the content this pull request carries at that commit against develop, and it recorded 12 findings.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5051cf0a-649b-4c93-bc89-aa6730243729
📥 Commits

Reviewing files that changed from the base of the PR and between a7ad6c2 and c6787c7.

📒 Files selected for processing: 2
  • OPERATIONS.md
  • host-tools.json
 _________________________________________________
< PhD, MSc, BSc, and a black belt in code review. >
 -------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.07%. Comparing base (a7ad6c2) to head (c6787c7).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #223   +/-   ##
========================================
  Coverage    43.07%   43.07%           
========================================
  Files            1        1           
  Lines          130      130           
========================================
  Hits            56       56           
  Misses          74       74           
Flag Coverage Δ
python-3.13 43.07% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved correctness, safety, and host-tool findings remain.

5 open findings
What changed in this PR

Updates ESPHome operations documentation to support multiple execution environments and refreshes toolchain guidance.

Changes:

  • Documents container, uvx, and pinned virtual-environment workflows.
  • Revises cache, logging, secrets, framework, and platform guidance.
  • Updates host-tool documentation for supported CLI routes.
File Description
OPERATIONS.md Adds host-independent ESPHome procedures and toolchain documentation.
host-tools.json Documents tools covering supported CLI routes.

🧠 Review effort: Lite


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread OPERATIONS.md Resolved
Comment thread OPERATIONS.md Resolved
Comment thread OPERATIONS.md Resolved
Comment thread OPERATIONS.md Resolved
Comment thread OPERATIONS.md Resolved
ptr727 and others added 2 commits October 14, 2026 17:08
State what esphome clean-all deletes and which data directories it
empties, limit the secrets guard to checkouts, say the PlatformIO
toolchains are scheduled for removal rather than removed, and record the
checked docker run logs behavior: a timeout inside the container exits
124 and leaves nothing running, while one outside it leaves the
container running.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Describe esphome clean-all by what it costs rather than by every path it
visits, add --rm to the docker run logs example and say how to stop a
leftover container, and call the dashboard's copy something other than
a checkout where the routes are listed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Oct 15, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 756af1d1dc30dd526ee1d9dac69fc9b1b0fad4d5, the content this pull request carries at that commit against develop, and it recorded 3 findings.

Say that esphome clean-all empties the data directory of each config it
reaches, so the patched-component note that links to it stays accurate,
and limit the early-closing pipe note to docker exec, the case it
describes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Oct 15, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head c6787c7c9a8fc9596ca42177994af85135e6f068, the content this pull request carries at that commit against develop, and it recorded 2 findings.

@ptr727
ptr727 merged commit 36541f1 into develop Oct 15, 2026
13 of 14 checks passed
@ptr727
ptr727 deleted the docs/host-agnostic-operations branch October 15, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants