Skip to content

Promote: ESP-IDF dependencies, compile test, and release gating - #163

Merged
ptr727 merged 9 commits into
mainfrom
develop
Jul 18, 2026
Merged

ptr727 merged 9 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Jul 18, 2026 •

Copy link
Copy Markdown
Owner

Promotes develop to main. Four feature pull requests plus the routine bot bumps already on develop.

Closes #161

ESP-IDF runtime dependencies (#162)

ESPHome's ESP-IDF toolchain installer validates the openocd-esp32 tool by executing it, and that binary dynamically links libusb-1.0.so.0, which the final image did not carry - so every ESP-IDF build failed. Adds libusb-1.0-0, plus ccache, which ESPHome enables automatically whenever the binary is on PATH and whose cache lands in the /cache volume.

Upstream's base image also carries build-essential, libcairo2, libmagic1t64, and patch. Those are deliberately not copied - this image splits builder from final, and no cairo or magic bindings are installed. Verified against a Bluetooth proxy configuration (1429 build targets, BLE stack, TLS, esp_http_client) that compiles with no missing-tool errors.

Compile test. A build-only smoke cannot see this class of break, because the toolchains that link against the missing library are downloaded on first compile. validate-task gains a compile-test job that builds the image and compiles checked-in configurations inside it as uid 1000, spanning Xtensa ESP-IDF, RISC-V ESP-IDF, wired Ethernet, and PlatformIO/Arduino. The publisher always runs it, so a firmware break blocks the push and the release; push CI runs it when a change-gate sees the image or the pin move.

Upstream-dependency watcher. A daily job snapshots the package list ESPHome's own base image installs and opens a review pull request when it changes. Not auto-merged: whether a package upstream adds belongs here is a human call.

Release gating (#138)

The publisher's push trigger was branches: [main, develop], so a pin bump on either branch published - contradicting the contract, which asserts branches: [main] in three places and states that the develop pin update is sync-only. In practice develop published a prerelease on every pin bump. Narrows the trigger to main and routes the decision through a single plan job (publish-plan-task.yml), so the tracker's auto-merged pin bump releases while a hand-edited pin does not.

Behavior change to expect after this lands: develop pin bumps stop auto-publishing prereleases; a develop prerelease now comes from a dispatch. This is the documented intent, but it is worth watching on the first tracker run after promotion.

Known limitation: the plan job's actor allowlist is a hardcoded identity, so if that identity changes the gate closes silently - pin pushes stop publishing, nothing errors, and the weekly schedule keeps releasing, leaving "upstream ships up to a week late" as the only symptom. Recorded in WORKFLOW.md section 3 and raised upstream with a recommended fix.

Change-gate correctness (#164)

The change-gate's fail-open for a non-push event sat inside the main/develop arm, so a workflow_dispatch on a feature branch fell through to the merge-base diff and could resolve to 'false' - contradicting D1.1, which states a dispatch always compile-tests. Any non-push event now short-circuits before the branch logic. Raised by the Copilot review on this promotion and fixed on develop before promoting.

Verification discipline (#165)

Adds an AGENTS.md section recording the checks that separate work actually done from work that merely reports success: run the whole lint gate rather than the seemingly relevant part, read a job's log instead of its tick, assert the mechanism a test names, treat the first CI run as the real exercise of a workflow change, make gates fail loud rather than narrow quietly, and avoid regex reassembly of CRLF files.

Release notes

version.json floor moves to 1.9, with README carrying the 1.9 summary and HISTORY the full entry.

Verification

  • All four feature pull requests merged green with the Copilot review loop driven to no outstanding findings.
  • The compile test ran for real on develop CI: all four fixtures produced firmware.
  • git diff origin/main origin/develop carries no main-only content - the single deletion-only hunk is the device-builder-link definition, removed intentionally when the v1.7 block left README.

ptr727-codegen Bot and others added 5 commits July 16, 2026 07:21
#155)

Co-authored-by: ptr727-codegen[bot] <275599072+ptr727-codegen[bot]@users.noreply.github.com>
Bumps the actions-deps group with 1 update: [actions/setup-dotnet](https://github.com/actions/setup-dotnet).


Updates `actions/setup-dotnet` from 5.4.0 to 6.0.0
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](actions/setup-dotnet@26b0ec1...a98b568)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions-deps
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ptr727-codegen[bot] <275599072+ptr727-codegen[bot]@users.noreply.github.com>
ESPHome's ESP-IDF toolchain installer validates the openocd-esp32 tool by
executing it, and that binary dynamically links libusb-1.0.so.0, which the final
image did not carry, so every ESP-IDF build failed. Add libusb-1.0-0, plus
ccache, which ESPHome enables automatically whenever the binary is on PATH.

A build-only smoke cannot see this class of break: the toolchains that link
against the missing library are downloaded on first compile. Add a compile-test
job to the validation gate that builds the image and compiles checked-in
configurations inside it as a non-root user, covering the Xtensa ESP-IDF,
RISC-V ESP-IDF, wired Ethernet, and PlatformIO build paths. The publisher always
runs it, so a firmware break blocks the push and the release; push CI runs it
when a change-gate sees the image or the upstream pin move, diffing a feature
branch against its merge-base so a later docs-only commit cannot retire it.

Add a daily upstream-dependency watcher that snapshots the package list
ESPHome's own base image installs and opens a review pull request when that list
changes, so the next dependency addition is caught before a user reports it.

Bump the version floor to 1.9 and update the release notes.
The push trigger was branches: [main, develop], so a pin bump on either branch
published. Three places in the contract assert branches: [main] - section 3
states outright that the develop pin update is sync-only - yet develop published
a prerelease on every pin bump. Narrow the trigger to main, which is what the
contract already claimed.

Add publish-plan-task.yml so one job owns the release-gate decision and the
publish job gates on its output instead of re-testing the event and ref. It
publishes for a schedule, for a dispatch of main or develop, and for a push to
main by the codegen App or Dependabot, so the tracker's auto-merged pin bump
releases while a hand-edited pin does not.

Document the gate: D4.9, a section 3 subsection, an updated D4.1 and audit row,
a glossary entry, and scenarios S18-S20, including that the outputs are strings
and that an unused stable output is expected of a shared task.
Copilot AI review requested due to automatic review settings July 18, 2026 19:29

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.

Pull request overview

Promotes develop to main, bringing in the ESP-IDF runtime dependency fix (libusb-1.0-0), adding a publish-gating compile test that builds real firmware inside the image as non-root, and tightening release gating so only bot pin pushes to main auto-publish (with dispatch-driven prereleases for develop). This also introduces an upstream-dependency watcher and updates release notes/version floor accordingly.

Changes:

  • Add libusb-1.0-0 (and ccache) to the runtime image to unblock ESP-IDF builds, and bump pinned upstream versions.
  • Add a reusable compile-test validation job plus fixtures, and change-gate it in push CI so it runs only when image inputs change.
  • Centralize publish eligibility in a reusable plan workflow, and narrow pin-push publishing to main only; add an upstream dependency snapshot workflow.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
WORKFLOW.md Documents the new compile-test gate, upstream-dependency watcher, and the centralized publish plan job.
version.json Bumps NBGV version floor from 1.8 to 1.9.
upstream-version.json Updates pinned ESPHome/device-builder versions.
upstream-dependency.json Adds the tracked upstream base-image apt package snapshot file.
README.md Updates Release Notes to the 1.9 summary and cleans up link references.
HISTORY.md Adds full 1.9 release entry and supporting link references.
Docker/Dockerfile Installs ccache and libusb-1.0-0 in the final image.
cspell.json Adds new terms (e.g., libusb/openocd/Xtensa) for spellcheck.
AGENTS.md Updates repo structure docs and replaces template-lineage section with shared-contract-files framing.
.github/workflows/validate-task.yml Adds optional compile-test job to compile fixtures inside the built image.
.github/workflows/test-pull-request.yml Adds the inline change-gate job and wires compile-test into PR CI when relevant paths change.
.github/workflows/publish-release.yml Narrows pin-push publishing to main and gates publishing via the new plan job output.
.github/workflows/publish-plan-task.yml New reusable workflow that decides whether the current run should publish (publish/stable outputs).
.github/workflows/get-version-task.yml Updates actions/setup-dotnet pin.
.github/workflows/check-upstream-dependency.yml New workflow to snapshot upstream base-image apt packages and open a review PR on changes.
.github/workflows/build-release-task.yml Ensures publish validation includes the compile-test gate (and passes secrets through).
.github/copilot-instructions.md Updates shared-contract guidance text.
.github/compile-test/esp32-bluetooth-proxy.yaml New firmware compile fixture (Xtensa ESP-IDF + BLE).
.github/compile-test/esp32c6-bluetooth-proxy.yaml New firmware compile fixture (RISC-V ESP-IDF + BLE).
.github/compile-test/esp32-ethernet.yaml New firmware compile fixture (ESP-IDF + Ethernet).
.github/compile-test/esp8266-d1-mini.yaml New firmware compile fixture (PlatformIO + Arduino).
.editorconfig Minor comment tweak; retains existing line-ending rules.

Comment thread .github/workflows/test-pull-request.yml Resolved
Records the checks that distinguish work actually done from work that merely
reports success: run the full lint gate rather than the seemingly relevant part,
read a job's log instead of its tick, assert the mechanism a test names, treat
the first CI run as the real exercise of a workflow change, make gates fail loud
rather than narrow quietly, and avoid regex reassembly of CRLF files.
Copilot AI review requested due to automatic review settings July 18, 2026 21:44
The dispatch fail-open sat inside the main/develop branch of the change-gate, so
a workflow_dispatch on a feature branch fell through to the merge-base diff and
could resolve to false - contradicting D1.1, which states a dispatch always
compile-tests. Short-circuit any non-push event before the branch logic.

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.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/validate-task.yml Resolved
Both the input's own comment and D1.2 still said the compile test stays off on
push CI, which stopped being true when the change-gate landed: push CI enables
it whenever the image or its test inputs move.
Copilot AI review requested due to automatic review settings July 18, 2026 21:55

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.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/validate-task.yml Resolved
Passing a command bypasses the image entrypoint, so cache.sh never ran and the
compile relied on each tool creating its own tree under the world-writable
mount. That works today but is incidental, tests a path no user takes, and left
cache.sh exercised by nothing.
Copilot AI review requested due to automatic review settings July 18, 2026 22:10

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.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit 3d795cb into main Jul 18, 2026
12 checks passed
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.

New ESPHome Build dependencies

2 participants