From fe13fe574bd58018d3761bf0a394842c6356f64b Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:01:10 -0700 Subject: [PATCH 01/12] Run CI on pull requests with the hub's paths filter Move test-pull-request.yml from push to the hub's pull_request trigger, and gate the smoke build on a paths filter over the image, so a docs-only or workflow-only pull request skips it per D1.1 and D1.4. The validate hook's compile gate now diffs the test merge commit against its first parent, which keeps a later docs-only push from retiring a compile test. WORKFLOW.md section 7 drops the push-only deviation record. Closes #328 Co-Authored-By: Claude Opus 5.5 --- .github/actions/validate/action.yml | 35 +++++---------- .github/workflows/publish-release.yml | 2 +- .github/workflows/test-pull-request.yml | 57 ++++++++++++++++--------- OPERATIONS.md | 6 +-- WORKFLOW.md | 23 +++++----- 5 files changed, 62 insertions(+), 61 deletions(-) diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml index 080c16d..01e3c29 100644 --- a/.github/actions/validate/action.yml +++ b/.github/actions/validate/action.yml @@ -1,7 +1,7 @@ # The validate hook the hub's validate-task.yml runs in place of its no-op default, this repo's own domain check. # It builds the image under test and compiles firmware in it, since the toolchains ESPHome downloads on first compile link against system libraries. # A missing runtime package fails here and nowhere else, so lint and a build-only smoke cannot see it. -# The publisher always compiles, and the push CI compiles only when the image, what is compiled in it, or the hub pin that runs it changed. +# The publisher always compiles, and pull request CI compiles only when the image, what is compiled in it, or the hub pin that runs it changed. # A composite action cannot read secrets, so the build reads the public base image and the shared cache without a Docker Hub login. name: ESPHome-NonRoot validate hook description: Compile every .github/compile-test configuration in the built image as a non-root user. @@ -10,9 +10,8 @@ runs: using: composite steps: - # Only a push run of the pull request workflow is gated. - # The publisher and a dispatch always compile, and so does a new main or develop, which carries no before-commit to diff against. - # A feature branch diffs against its merge-base with develop, so a later docs-only push cannot retire a compile test the branch earned. + # Only a pull request run of the pull request workflow is gated, and the publisher and a dispatch always compile. + # The diff runs from the test merge commit's first parent, the base tip, so it is the whole pull request and a later docs-only push cannot retire a compile test. - name: Decide compile test step id: decide shell: bash @@ -20,8 +19,6 @@ runs: EVENT: ${{ github.event_name }} WORKFLOW_REF: ${{ github.workflow_ref }} REPOSITORY: ${{ github.repository }} - REF_NAME: ${{ github.ref_name }} - BEFORE: ${{ github.event.before }} AFTER: ${{ github.sha }} run: | set -Eeuo pipefail @@ -30,29 +27,17 @@ runs: echo "Compile test: $1 ($2)" exit 0 } - if [[ "$EVENT" != "push" || "$WORKFLOW_REF" != "$REPOSITORY/.github/workflows/test-pull-request.yml@"* ]]; then - compile true "not a pull request workflow push" + if [[ "$EVENT" != "pull_request" || "$WORKFLOW_REF" != "$REPOSITORY/.github/workflows/test-pull-request.yml@"* ]]; then + compile true "not a pull request workflow run" fi - if [[ "$REF_NAME" == "main" || "$REF_NAME" == "develop" ]]; then - if [[ -z "$BEFORE" || "$BEFORE" =~ ^0+$ ]]; then - compile true "new branch" - fi - from="$BEFORE" - else - from="" - fi - # The hub task checks out one commit, so deepen it and fetch develop before reasoning about a diff. - deepen=() - if [[ "$(git rev-parse --is-shallow-repository)" == "true" ]]; then - deepen=(--unshallow) - fi - if ! git fetch --quiet --no-tags "${deepen[@]}" origin "+refs/heads/develop:refs/remotes/origin/develop"; then + # The hub task checks out the merge commit alone, so fetch it again with its parents before reasoning about a diff. + if ! git fetch --quiet --no-tags --depth=2 origin "$AFTER"; then compile true "history fetch failed" fi - if [[ -z "$from" ]] && ! from="$(git merge-base origin/develop "$AFTER")"; then - compile true "no merge-base with develop" + if ! git rev-parse --verify --quiet "$AFTER^2^{commit}" > /dev/null; then + compile true "not a test merge commit" fi - if ! diff="$(git diff --name-only "$from" "$AFTER")"; then + if ! diff="$(git diff --name-only "$AFTER^1" "$AFTER")"; then compile true "diff base not in history" fi # The two stubs carry the hub pin, so a hub release bump compile-tests the hooks under the new tasks before it auto-merges. diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 7634c65..77be7d3 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -39,7 +39,7 @@ jobs: actor: ${{ github.actor }} ref_name: ${{ github.ref_name }} - # The same reusable gate the push CI runs, on the triggering commit, running only when a publish will happen. + # The same reusable gate pull request CI runs, on the triggering commit, running only when a publish will happen. # The validate hook always compiles firmware here, since a publisher run is never change-gated. validate: name: Validate job diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index fa717b5..ab00139 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -1,17 +1,10 @@ name: Test pull request action -# CI for every branch, a thin caller onto the hub's reusable validate and build-release tasks. -# Runs on push so the aggregator, the ruleset required status check, is produced on the head SHA by the sole producing run. -# The validate and smoke-build jobs run on every push with no paths filter, so a hub pin bump always exercises the docker-prepare hook. -# Only the compile test inside the validate hook is change-gated, on the image, its test inputs, and the hub pin in this file and the publisher. +# CI for every pull request into main or develop, a thin caller onto the hub's reusable validate and build-release tasks. # CI never publishes, since the publisher runs on schedule, dispatch, or a bot pin push. -# -# There is deliberately no pull_request trigger: a fork PR cannot push to this repo, so it produces no run and cannot satisfy the required check. -# A maintainer lands such a contribution on an in-repo branch, which pushes and so validates, before merging. on: - # All branches, but not tags, since a release tag must not re-run CI. - push: - branches: ['**'] + pull_request: + branches: [main, develop] workflow_dispatch: concurrency: @@ -23,11 +16,32 @@ permissions: {} jobs: - # The same reusable gate the publisher runs, so the push gate and the publish gate are identical. - # A branch-deletion push is skipped, since github.sha is all zeros and the checkout would fail. + # The one image target lists its own paths, and its build hook under .github/actions/** builds it, so a workflow-only or docs-only pull request marks nothing. + changes: + name: Detect changed targets job + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + outputs: + release: ${{ steps.filter.outputs.release }} + steps: + - name: Checkout code step + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Filter changed paths step + id: filter + uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 + with: + filters: | + release: + - 'Docker/**' + - 'version.json' + - 'upstream-version.json' + - '.github/actions/**' + + # The same reusable gate the publisher runs, so the pull request gate and the publish gate are identical. validate: name: Validate job - if: ${{ !github.event.deleted }} uses: ptr727/ProjectTemplate/.github/workflows/validate-task.yml@fb7f02b24d6282f943ecb2ded1b206326d3f4610 # 2.0.1122 permissions: contents: read @@ -36,7 +50,8 @@ jobs: # The Docker Hub secrets are mapped even on smoke, since the hub task logs in on every build for the higher rate limit. smoke-build: name: Smoke build job - if: ${{ !github.event.deleted }} + needs: [changes] + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.release == 'true' uses: ptr727/ProjectTemplate/.github/workflows/build-release-task.yml@fb7f02b24d6282f943ecb2ded1b206326d3f4610 # 2.0.1122 permissions: contents: read @@ -53,22 +68,22 @@ jobs: enable_pypi: false expect_release_assets: false docker_image: ptr727/esphome-nonroot - branch: ${{ github.ref_name }} + # On a pull_request event github.ref_name is the PR ref (for example 123/merge), so the logical branch reads base_ref first. + branch: ${{ github.base_ref || github.ref_name }} # Single required status check, whose name is the ruleset-bound context in the live branch rulesets. # Do not rename it without updating the rulesets in lockstep, and it must succeed, not merely not fail. - # Skips on a branch deletion, when the jobs it needs also skip, so the deletion push does not fail it. check-workflow-status: name: Check pull request workflow status job runs-on: ubuntu-latest permissions: {} - needs: [validate, smoke-build] - if: ${{ always() && !github.event.deleted }} + needs: [changes, validate, smoke-build] + if: always() steps: - name: Check workflow results step run: | set -Eeuo pipefail - for result in "validate:${{ needs.validate.result }}" "smoke-build:${{ needs.smoke-build.result }}"; do + for result in "changes:${{ needs.changes.result }}" "validate:${{ needs.validate.result }}"; do name="${result%%:*}" value="${result#*:}" if [[ "$value" != "success" ]]; then @@ -76,3 +91,7 @@ jobs: exit 1 fi done + if [[ "${{ needs.smoke-build.result }}" != "success" && "${{ needs.smoke-build.result }}" != "skipped" ]]; then + echo "::error::Job 'smoke-build' did not succeed (${{ needs.smoke-build.result }})." + exit 1 + fi diff --git a/OPERATIONS.md b/OPERATIONS.md index 676e9a3..aa86ac3 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -6,12 +6,12 @@ How this repo is run: what verifying a change requires before it is pushed, how Verifying a change here means running the gates, then running by hand the parts of the contract the pull request pipeline never reaches. -The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cspell` (scoped to `README.md` and `HISTORY.md`), `actionlint`, `editorconfig-checker`, and shellcheck and shfmt over `Docker/entrypoint/*.sh`, plus its repo gate, which checks action pins, line-ending coverage, and the composite-action hooks under `.github/actions/`. CI runs all of them, so run all of them before every push rather than the ones that look relevant. From a hub checkout, `python3 scripts/docker_lint.py --root ` runs the linters through Docker with no local toolchain, and `python3 scripts/repo_gate.py --root ` runs the repo gate. The hub task's prose gate runs only on a `pull_request` event, which this repo's push-triggered CI never raises, so run `python3 /scripts/prose_lint.py --diff ` by hand from this repo's root, since it diffs the repository it runs in. A change to `Docker/` is also smoke-built locally with the `docker buildx build` command in the runbook below before it is pushed, the same amd64 build CI runs. +The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cspell` (scoped to `README.md` and `HISTORY.md`), `actionlint`, `editorconfig-checker`, and shellcheck and shfmt over `Docker/entrypoint/*.sh`, plus its repo gate, which checks action pins, line-ending coverage, and the composite-action hooks under `.github/actions/`. CI runs all of them, so run all of them before every push rather than the ones that look relevant. From a hub checkout, `python3 scripts/docker_lint.py --root ` runs the linters through Docker with no local toolchain, and `python3 scripts/repo_gate.py --root ` runs the repo gate. The hub task's prose gate runs on every pull request, and `python3 /scripts/prose_lint.py --diff ` runs it locally from this repo's root, since it diffs the repository it runs in. A change to `Docker/` is also smoke-built locally with the `docker buildx build` command in the runbook below before it is pushed, the same amd64 build CI runs. **What pull request CI structurally cannot exercise:** - **The arm64 image.** The pull request smoke build and every `develop` publish build `linux/amd64` only. Only a full `main` publish builds `linux/amd64,linux/arm64`, so an arm64-only break first surfaces on `main`. -- **The firmware compile test, unless the change touches the image.** On a push run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. +- **The firmware compile test, unless the change touches the image.** On a pull request run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. - **A running dashboard.** No workflow starts the container and talks to the dashboard. A change that can affect the entrypoint, the dashboard, or file permissions is verified by building and running the image locally, per the runbook below. Two traps make a headless test of the running container pass while proving nothing: @@ -34,7 +34,7 @@ The dashboard is then at `http://localhost:6052`. `docker exec -it --user 1001:1 ### Compile a Test Configuration in the Image -The [`validate`](./.github/actions/validate/action.yml) hook, which the hub's `validate-task.yml` runs for push CI and the publisher alike, runs `/entrypoint/cache.sh`, then `esphome config` and `esphome compile` for each fixture in [`.github/compile-test/`](./.github/compile-test/), inside the built image as a non-root user. Reproduce it against a locally built image by bind-mounting the fixtures and running the same two commands for the fixture in question. [`WORKFLOW.md`](./WORKFLOW.md) "The Image Compile Test" states what each fixture covers. +The [`validate`](./.github/actions/validate/action.yml) hook, which the hub's `validate-task.yml` runs for pull request CI and the publisher alike, runs `/entrypoint/cache.sh`, then `esphome config` and `esphome compile` for each fixture in [`.github/compile-test/`](./.github/compile-test/), inside the built image as a non-root user. Reproduce it against a locally built image by bind-mounting the fixtures and running the same two commands for the fixture in question. [`WORKFLOW.md`](./WORKFLOW.md) "The Image Compile Test" states what each fixture covers. ### Check Whether `develop` Is Missing a `main`-Only Fix diff --git a/WORKFLOW.md b/WORKFLOW.md index 6675ebd..2f0cc62 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -312,7 +312,7 @@ Sections 1 to 6 are the fleet contract. This section holds what is particular to The repository builds one multi-arch Docker image and declares the `docker` and `upstream-wrapper` types on the `release` workflow model. Every standard job graph is a hub task reached by a pinned `uses:`, and the repository carries only its caller stubs and three composite-action hooks: -- **`test-pull-request.yml`** is CI for every branch. It calls `validate-task.yml` and, with `smoke: true`, `build-release-task.yml`, and its aggregator is the ruleset-bound required check. +- **`test-pull-request.yml`** is CI for every pull request into `main` or `develop`, in the shape section 3 describes. It calls `validate-task.yml` on every pull request and, with `smoke: true`, `build-release-task.yml` when its paths filter marks the image changed, and its aggregator is the ruleset-bound required check. - **`publish-release.yml`** is the publisher. Its `plan`, `validate`, `publish`, and `publish-docker-readme` jobs call `publish-plan-task.yml`, `validate-task.yml`, `build-release-task.yml`, and `publish-docker-readme-task.yml`. It runs on a weekly schedule, which rebuilds `main` to pick up base-image updates, on a manual dispatch of `main` or `develop`, and on a push to `main` that changes `upstream-version.json`, which the plan task publishes only when the tracker's App made it. - **`check-upstream-version.yml`** is the upstream-version tracker, calling `check-upstream-version-task.yml`. - **`merge-bot-pull-request.yml`** calls `merge-bot-task.yml` with `delete-branch: true`, since the repository-wide auto-delete is off so that `main` and `develop` survive a promotion. @@ -321,10 +321,7 @@ The repository builds one multi-arch Docker image and declares the `docker` and - **`.github/actions/validate/action.yml`** is the image compile test, below. - **`.github/actions/resolve-upstream/action.yml`** resolves the latest `esphome` and `esphome-device-builder` releases from PyPI for the tracker. -Two choices differ from the shape section 3 describes, and both are deliberate: - -- **CI runs on `push`, with no `pull_request` trigger.** The aggregator is produced on the head SHA by the push run as the sole producer of its context. A fork cannot push, so a fork pull request produces no run and cannot satisfy the required check. A maintainer lands such a contribution on an in-repo branch, which pushes and so validates, before merging. The hub task's prose gate runs only on a `pull_request` event, so it never runs here, and a green CI run says nothing about prose. -- **`smoke-build` runs on every push, with no paths filter.** A hub pin bump is a workflow-only change, and the smoke build is the only pre-merge run of the `docker-prepare` hook against the bumped task. S2 and S3 therefore run the smoke build here rather than skipping it. Only the compile test inside the `validate` hook is change-gated. +The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`, so a docs-only or workflow-only pull request skips the smoke build per D1.1 and D1.4. A hub pin bump is such a workflow-only change. Its pre-merge check of the `docker-prepare` hook is the compile test, which runs that hook and builds the image when either hub-pinned stub changes, rather than the smoke build. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build therefore fails at the Docker Hub login when it touches the image, so a maintainer lands such a contribution on an in-repo branch before merging. ### The Upstream-Version Tracker @@ -342,9 +339,9 @@ The watcher stays a repository-owned job rather than a second caller of `check-u The [`validate`][validate-hook] hook, which the hub's `validate-task.yml` runs in its `validate` job, builds the commit being validated (amd64, loaded locally, cache read-only, never pushed) and runs `esphome compile` inside it as uid 1000. It is the validate hook because a repository's own domain checks belong there: the fleet lint block is the source-level gate, and this is the artifact-level one. The publisher's `publish` job needs its `validate` job, so a firmware break blocks the push and the release with no extra wiring. -It is deliberately not a standalone daily job. The image only changes when a build fires, on a weekly rebuild, a pin push, or a dispatch. Testing on that trigger covers every distinct image, where a blind daily schedule would mostly recompile yesterday's bits. The tracker's daily pin bump is what makes the upper bound roughly once a day. Push CI runs it too, but only when the change can affect the image. About five minutes on every push is a poor trade for a push that cannot move what it tests. +It is deliberately not a standalone daily job. The image only changes when a build fires, on a weekly rebuild, a pin push, or a dispatch. Testing on that trigger covers every distinct image, where a blind daily schedule would mostly recompile yesterday's bits. The tracker's daily pin bump is what makes the upper bound roughly once a day. Pull request CI runs it too, but only when the change can affect the image. About five minutes on every pull request is a poor trade for one that cannot move what it tests. -The hook decides for itself whether to compile. A run of the publisher, a dispatch, and the first push of `main` or `develop` always compile. A push run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs carrying the hub pin, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new tasks before it auto-merges. A feature branch is diffed against its merge-base with `develop`, so a later docs-only push cannot retire a compile test the branch earned. A push to `main` or `develop` is diffed against its before-commit. A diff it cannot compute compiles rather than guesses. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. +The hook decides for itself whether to compile. A run of the publisher and a dispatch always compile. A pull request run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs carrying the hub pin, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new tasks before it auto-merges. The run validates the pull request's test merge commit, which is diffed against its first parent, the base branch tip, so the diff is the whole pull request and a later docs-only push cannot retire a compile test the branch earned. A diff it cannot compute compiles rather than guesses. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. A composite action cannot read secrets, so the compile test pulls the public base image and reads the shared buildcache without a Docker Hub login, where the hub's Docker task logs in on every build. @@ -364,9 +361,9 @@ They are hand-authored and checked in, each naming the upstream project it is mo ### D10 - Project-Specific Guarantees -- **D10.1 Docker publishing authenticates with Docker Hub credentials.** Output: `publish-release.yml` and `test-pull-request.yml` map `DOCKER_HUB_USERNAME` and `DOCKER_HUB_ACCESS_TOKEN` by name into `build-release-task.yml`. Its Docker task logs in on every build, smoke included, for the higher pull and cache-read rate limits. The publisher maps the same pair into `publish-docker-readme-task.yml` for the overview. Both live in the Actions and Dependabot secret stores, since a Dependabot-triggered push runs a smoke build that logs in too. There is no NuGet or OIDC publishing. *Prevents: a missing-credential publish or a rate-limited cache read.* +- **D10.1 Docker publishing authenticates with Docker Hub credentials.** Output: `publish-release.yml` and `test-pull-request.yml` map `DOCKER_HUB_USERNAME` and `DOCKER_HUB_ACCESS_TOKEN` by name into `build-release-task.yml`. Its Docker task logs in on every build, smoke included, for the higher pull and cache-read rate limits. The publisher maps the same pair into `publish-docker-readme-task.yml` for the overview. Both live in the Actions and Dependabot secret stores, since a Dependabot pull request runs a smoke build that logs in too. There is no NuGet or OIDC publishing. *Prevents: a missing-credential publish or a rate-limited cache read.* - **D10.2 The upstream pins drive the image.** Output: the `docker-prepare` hook reads `.esphome` and `.device_builder` from `upstream-version.json`, failing with `::error::` when either is missing, passes them as `ESPHOME_VERSION` and `DEVICE_BUILDER_VERSION`, and adds the `:` tag on a `main` build only. *Prevents: an image built from a pin other than the committed one, or a version tag on a develop image.* -- **D10.3 The image compiles firmware before it ships.** Output: the `validate` hook compiles on every publisher run, and on a push CI run when its change-gate fires. It builds the validated commit (amd64, `load: true`, `push: false`, cache read-only) and runs `esphome compile` inside it, and the publisher's `publish` job needs `validate`. *Prevents: a runtime dependency missing from the final stage reaching Docker Hub, which a build-only smoke cannot see, because the toolchains that link against it are downloaded on first compile.* +- **D10.3 The image compiles firmware before it ships.** Output: the `validate` hook compiles on every publisher run, and on a pull request CI run when its change-gate fires. It builds the validated commit (amd64, `load: true`, `push: false`, cache read-only) and runs `esphome compile` inside it, and the publisher's `publish` job needs `validate`. *Prevents: a runtime dependency missing from the final stage reaching Docker Hub, which a build-only smoke cannot see, because the toolchains that link against it are downloaded on first compile.* - **D10.4 Configurations are checked in and validated before compiling.** Output: each fixture lives in `.github/compile-test/`, is hand-authored rather than fetched or generated at run time, names the upstream project it is modeled on, and passes `esphome config` before `esphome compile` runs. *Prevents: a daily monitor failing on someone else's change, and separates a configuration break from a toolchain break.* - **D10.5 Every execution environment and the configure-time `patch` step, non-root.** Output: the fixtures cover Xtensa ESP-IDF, RISC-V ESP-IDF, wired Ethernet, PlatformIO/Arduino, and the `patch` step an IDF component runs at configure time. The container runs as uid 1000. *Prevents: a break confined to one toolchain, build system, network stack, or that `patch` step passing as green, and likewise a root-only regression.* - **D10.6 Upstream-dependency watcher.** Output: the watcher runs daily, snapshots the `base`-stage apt package names from `esphome/docker-base` into `upstream-dependency.json` (sorted, LF, names only), and opens an App-signed PR on `upstream-dependency-develop` when the set moves. Its head ref matches no merge-bot rule, so it does **not** auto-merge, and the file is not a shipped input, so committing it does not fire the publisher. *Prevents: an upstream runtime dependency being noticed only through a user bug report.* @@ -377,14 +374,14 @@ They are hand-authored and checked in, each naming the upstream project it is mo - **D10.1:** each `build-release-task.yml` and `publish-docker-readme-task.yml` call maps both `DOCKER_HUB_*` secrets by name. - **D10.2:** the `docker-prepare` hook reads both pins, fails on an empty one, and adds the version tag only where `branch` is `main`. -- **D10.3 to D10.5:** the `validate` hook's decide step compiles on every non-push event and every workflow but `test-pull-request.yml`, and its path set names `Docker/`, `.github/compile-test/`, the `validate` and `docker-prepare` hooks, the two hub-pinned stubs, and `upstream-version.json`. The build reads its context, Dockerfile, cache repository, and build-args from the `docker-prepare` hook's matrix entry. The build step sets `load: true` and `push: false` with no `cache-to`, the fixtures are compiled with `esphome config` before `esphome compile`, nothing fetches a configuration at run time, and the container runs `--user 1000:1000`. +- **D10.3 to D10.5:** the `validate` hook's decide step compiles on every event but `pull_request` and every workflow but `test-pull-request.yml`, diffs a pull request's test merge commit against its first parent, and its path set names `Docker/`, `.github/compile-test/`, the `validate` and `docker-prepare` hooks, the two hub-pinned stubs, and `upstream-version.json`. The build reads its context, Dockerfile, cache repository, and build-args from the `docker-prepare` hook's matrix entry. The build step sets `load: true` and `push: false` with no `cache-to`, the fixtures are compiled with `esphome config` before `esphome compile`, nothing fetches a configuration at run time, and the container runs `--user 1000:1000`. - **D10.6:** the watcher is daily, App-signed, targets `develop` on a head ref no merge-bot rule matches, and writes a file no build step reads. | # | Input | Expected output | Exercises | | --- | --- | --- | --- | -| S15 | push touching `Docker/Dockerfile` | `validate` compiles every fixture, `smoke-build` builds the image, nothing is pushed or released, aggregator success | D10.3 | -| S16 | docs-only push on a branch that earlier changed `Docker/**` | the merge-base diff still sees the image change, so the compile test runs and the branch cannot pass ungated | D10.3 | -| S17 | docs-only push on a branch that changed nothing else | the decide step reports the compile inputs unchanged, `validate` runs the lint block only, `smoke-build` still runs | D10.3 | +| S15 | pull request touching `Docker/Dockerfile` | `validate` compiles every fixture, `smoke-build` builds the image, nothing is pushed or released, aggregator success | D10.3 | +| S16 | docs-only push to a pull request whose branch earlier changed `Docker/**` | the test merge commit's diff still sees the image change, so the compile test runs and the branch cannot pass ungated | D10.3 | +| S17 | docs-only pull request | the decide step reports the compile inputs unchanged, `validate` runs the lint and prose gates only, `smoke-build` skips, aggregator success | D1.1, D10.3 | | S18 | upstream adds an apt package to its base image | the watcher opens a PR against `develop` naming the added package, which does **not** auto-merge and does **not** publish | D10.6 | | S19 | a runtime library the toolchain links against is dropped from the Dockerfile | the compile test fails on the ESP-IDF fixtures, the aggregator blocks the merge, and a publish of such a tree pushes nothing | D10.3, D10.5 | | S20 | an ESPHome release changes a schema a fixture uses | `esphome config` fails before `esphome compile`, naming the fixture to update | D10.4 | From 87caba0a41210dd898724d645f893df4967e3e11 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:08:05 -0700 Subject: [PATCH 02/12] Correct the hub pin bump coverage claim and drop a dead guard The compile test runs the docker-prepare hook under a bumped validate task, but the bumped build-release task first calls it at the next publish, which is the cost D1.4 accepts. The merge-commit guard in the compile gate checked a shape a pull_request run cannot produce. Split the long sentences this change wrote. Co-Authored-By: Claude Opus 5.5 --- .github/actions/validate/action.yml | 8 +++----- OPERATIONS.md | 2 +- WORKFLOW.md | 8 ++++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml index 01e3c29..70863e7 100644 --- a/.github/actions/validate/action.yml +++ b/.github/actions/validate/action.yml @@ -1,7 +1,7 @@ # The validate hook the hub's validate-task.yml runs in place of its no-op default, this repo's own domain check. # It builds the image under test and compiles firmware in it, since the toolchains ESPHome downloads on first compile link against system libraries. # A missing runtime package fails here and nowhere else, so lint and a build-only smoke cannot see it. -# The publisher always compiles, and pull request CI compiles only when the image, what is compiled in it, or the hub pin that runs it changed. +# The publisher always compiles, and pull request CI only when the image, what is compiled in it, or the hub pin that runs it changed. # A composite action cannot read secrets, so the build reads the public base image and the shared cache without a Docker Hub login. name: ESPHome-NonRoot validate hook description: Compile every .github/compile-test configuration in the built image as a non-root user. @@ -11,7 +11,8 @@ runs: steps: # Only a pull request run of the pull request workflow is gated, and the publisher and a dispatch always compile. - # The diff runs from the test merge commit's first parent, the base tip, so it is the whole pull request and a later docs-only push cannot retire a compile test. + # The diff runs from the test merge commit's first parent, the base tip, so it covers the whole pull request. + # A later docs-only push therefore cannot retire a compile test. - name: Decide compile test step id: decide shell: bash @@ -34,9 +35,6 @@ runs: if ! git fetch --quiet --no-tags --depth=2 origin "$AFTER"; then compile true "history fetch failed" fi - if ! git rev-parse --verify --quiet "$AFTER^2^{commit}" > /dev/null; then - compile true "not a test merge commit" - fi if ! diff="$(git diff --name-only "$AFTER^1" "$AFTER")"; then compile true "diff base not in history" fi diff --git a/OPERATIONS.md b/OPERATIONS.md index aa86ac3..f65fc12 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -6,7 +6,7 @@ How this repo is run: what verifying a change requires before it is pushed, how Verifying a change here means running the gates, then running by hand the parts of the contract the pull request pipeline never reaches. -The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cspell` (scoped to `README.md` and `HISTORY.md`), `actionlint`, `editorconfig-checker`, and shellcheck and shfmt over `Docker/entrypoint/*.sh`, plus its repo gate, which checks action pins, line-ending coverage, and the composite-action hooks under `.github/actions/`. CI runs all of them, so run all of them before every push rather than the ones that look relevant. From a hub checkout, `python3 scripts/docker_lint.py --root ` runs the linters through Docker with no local toolchain, and `python3 scripts/repo_gate.py --root ` runs the repo gate. The hub task's prose gate runs on every pull request, and `python3 /scripts/prose_lint.py --diff ` runs it locally from this repo's root, since it diffs the repository it runs in. A change to `Docker/` is also smoke-built locally with the `docker buildx build` command in the runbook below before it is pushed, the same amd64 build CI runs. +The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cspell` (scoped to `README.md` and `HISTORY.md`), `actionlint`, `editorconfig-checker`, and shellcheck and shfmt over `Docker/entrypoint/*.sh`, plus its repo gate, which checks action pins, line-ending coverage, and the composite-action hooks under `.github/actions/`. CI runs all of them, so run all of them before every push rather than the ones that look relevant. From a hub checkout, `python3 scripts/docker_lint.py --root ` runs the linters through Docker with no local toolchain, and `python3 scripts/repo_gate.py --root ` runs the repo gate. The hub task's prose gate runs on every pull request. Run it locally from this repo's root with `python3 /scripts/prose_lint.py --diff `, since it diffs the repository it runs in. A change to `Docker/` is also smoke-built locally with the `docker buildx build` command in the runbook below before it is pushed, the same amd64 build CI runs. **What pull request CI structurally cannot exercise:** diff --git a/WORKFLOW.md b/WORKFLOW.md index 2f0cc62..42d458f 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -312,7 +312,7 @@ Sections 1 to 6 are the fleet contract. This section holds what is particular to The repository builds one multi-arch Docker image and declares the `docker` and `upstream-wrapper` types on the `release` workflow model. Every standard job graph is a hub task reached by a pinned `uses:`, and the repository carries only its caller stubs and three composite-action hooks: -- **`test-pull-request.yml`** is CI for every pull request into `main` or `develop`, in the shape section 3 describes. It calls `validate-task.yml` on every pull request and, with `smoke: true`, `build-release-task.yml` when its paths filter marks the image changed, and its aggregator is the ruleset-bound required check. +- **`test-pull-request.yml`** is CI for every pull request into `main` or `develop`, in the shape section 3 describes. It calls `validate-task.yml` on every pull request. It calls `build-release-task.yml` with `smoke: true` only when its paths filter marks the image changed. Its aggregator is the ruleset-bound required check. - **`publish-release.yml`** is the publisher. Its `plan`, `validate`, `publish`, and `publish-docker-readme` jobs call `publish-plan-task.yml`, `validate-task.yml`, `build-release-task.yml`, and `publish-docker-readme-task.yml`. It runs on a weekly schedule, which rebuilds `main` to pick up base-image updates, on a manual dispatch of `main` or `develop`, and on a push to `main` that changes `upstream-version.json`, which the plan task publishes only when the tracker's App made it. - **`check-upstream-version.yml`** is the upstream-version tracker, calling `check-upstream-version-task.yml`. - **`merge-bot-pull-request.yml`** calls `merge-bot-task.yml` with `delete-branch: true`, since the repository-wide auto-delete is off so that `main` and `develop` survive a promotion. @@ -321,7 +321,7 @@ The repository builds one multi-arch Docker image and declares the `docker` and - **`.github/actions/validate/action.yml`** is the image compile test, below. - **`.github/actions/resolve-upstream/action.yml`** resolves the latest `esphome` and `esphome-device-builder` releases from PyPI for the tracker. -The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`, so a docs-only or workflow-only pull request skips the smoke build per D1.1 and D1.4. A hub pin bump is such a workflow-only change. Its pre-merge check of the `docker-prepare` hook is the compile test, which runs that hook and builds the image when either hub-pinned stub changes, rather than the smoke build. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build therefore fails at the Docker Hub login when it touches the image, so a maintainer lands such a contribution on an in-repo branch before merging. +The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump is such a workflow-only change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names both hub-pinned stubs. The bumped `build-release-task.yml` first calls that hook at the next publish, which is the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. ### The Upstream-Version Tracker @@ -341,7 +341,7 @@ The [`validate`][validate-hook] hook, which the hub's `validate-task.yml` runs i It is deliberately not a standalone daily job. The image only changes when a build fires, on a weekly rebuild, a pin push, or a dispatch. Testing on that trigger covers every distinct image, where a blind daily schedule would mostly recompile yesterday's bits. The tracker's daily pin bump is what makes the upper bound roughly once a day. Pull request CI runs it too, but only when the change can affect the image. About five minutes on every pull request is a poor trade for one that cannot move what it tests. -The hook decides for itself whether to compile. A run of the publisher and a dispatch always compile. A pull request run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs carrying the hub pin, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new tasks before it auto-merges. The run validates the pull request's test merge commit, which is diffed against its first parent, the base branch tip, so the diff is the whole pull request and a later docs-only push cannot retire a compile test the branch earned. A diff it cannot compute compiles rather than guesses. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. +The hook decides for itself whether to compile. A run of the publisher and a dispatch always compile. A pull request run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs carrying the hub pin, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new tasks before it auto-merges. The run validates the pull request's test merge commit and diffs it against its first parent, the base branch tip. The diff is therefore the whole pull request, so a later docs-only push cannot retire a compile test the branch earned. A diff it cannot compute compiles rather than guesses. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. A composite action cannot read secrets, so the compile test pulls the public base image and reads the shared buildcache without a Docker Hub login, where the hub's Docker task logs in on every build. @@ -374,7 +374,7 @@ They are hand-authored and checked in, each naming the upstream project it is mo - **D10.1:** each `build-release-task.yml` and `publish-docker-readme-task.yml` call maps both `DOCKER_HUB_*` secrets by name. - **D10.2:** the `docker-prepare` hook reads both pins, fails on an empty one, and adds the version tag only where `branch` is `main`. -- **D10.3 to D10.5:** the `validate` hook's decide step compiles on every event but `pull_request` and every workflow but `test-pull-request.yml`, diffs a pull request's test merge commit against its first parent, and its path set names `Docker/`, `.github/compile-test/`, the `validate` and `docker-prepare` hooks, the two hub-pinned stubs, and `upstream-version.json`. The build reads its context, Dockerfile, cache repository, and build-args from the `docker-prepare` hook's matrix entry. The build step sets `load: true` and `push: false` with no `cache-to`, the fixtures are compiled with `esphome config` before `esphome compile`, nothing fetches a configuration at run time, and the container runs `--user 1000:1000`. +- **D10.3 to D10.5:** the `validate` hook's decide step compiles on every event but `pull_request` and every workflow but `test-pull-request.yml`. On a pull request it diffs the test merge commit against its first parent. Its path set names `Docker/`, `.github/compile-test/`, the `validate` and `docker-prepare` hooks, the two hub-pinned stubs, and `upstream-version.json`. The build reads its context, Dockerfile, cache repository, and build-args from the `docker-prepare` hook's matrix entry. The build step sets `load: true` and `push: false` with no `cache-to`, the fixtures are compiled with `esphome config` before `esphome compile`, nothing fetches a configuration at run time, and the container runs `--user 1000:1000`. - **D10.6:** the watcher is daily, App-signed, targets `develop` on a head ref no merge-bot rule matches, and writes a file no build step reads. | # | Input | Expected output | Exercises | From 1333a3fa0fcba656677409bc9015da87a84a0b5f Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:13:24 -0700 Subject: [PATCH 03/12] Name the one bumped task a pin bump exercises before merge The compile test runs under the bumped validate task only, so the two remaining "new tasks" claims now say so, and OPERATIONS.md lists the bumped release task among what pull request CI cannot reach, with the dispatch that forces the smoke build. The diff fallback after a successful depth-2 fetch was unreachable and is gone. Co-Authored-By: Claude Opus 5.5 --- .github/actions/validate/action.yml | 6 ++---- OPERATIONS.md | 1 + WORKFLOW.md | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml index 70863e7..86c3972 100644 --- a/.github/actions/validate/action.yml +++ b/.github/actions/validate/action.yml @@ -35,10 +35,8 @@ runs: if ! git fetch --quiet --no-tags --depth=2 origin "$AFTER"; then compile true "history fetch failed" fi - if ! diff="$(git diff --name-only "$AFTER^1" "$AFTER")"; then - compile true "diff base not in history" - fi - # The two stubs carry the hub pin, so a hub release bump compile-tests the hooks under the new tasks before it auto-merges. + diff="$(git diff --name-only "$AFTER^1" "$AFTER")" + # The two stubs carry the hub pin, so a hub release bump compile-tests the hooks under the new validate task before it auto-merges. if grep -qE '^(Docker/|\.github/compile-test/|\.github/actions/(validate|docker-prepare)/|\.github/workflows/(test-pull-request|publish-release)\.yml$|upstream-version\.json$)' <<<"$diff"; then compile true "image or compile inputs changed" fi diff --git a/OPERATIONS.md b/OPERATIONS.md index f65fc12..2a60ac5 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -12,6 +12,7 @@ The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cs - **The arm64 image.** The pull request smoke build and every `develop` publish build `linux/amd64` only. Only a full `main` publish builds `linux/amd64,linux/arm64`, so an arm64-only break first surfaces on `main`. - **The firmware compile test, unless the change touches the image.** On a pull request run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. +- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build. The bumped `build-release-task.yml` therefore first calls the `docker-prepare` hook at the next publish. A manual dispatch of `test-pull-request.yml` on the bump's branch forces the smoke build before it merges. - **A running dashboard.** No workflow starts the container and talks to the dashboard. A change that can affect the entrypoint, the dashboard, or file permissions is verified by building and running the image locally, per the runbook below. Two traps make a headless test of the running container pass while proving nothing: diff --git a/WORKFLOW.md b/WORKFLOW.md index 42d458f..346ceaa 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -341,7 +341,7 @@ The [`validate`][validate-hook] hook, which the hub's `validate-task.yml` runs i It is deliberately not a standalone daily job. The image only changes when a build fires, on a weekly rebuild, a pin push, or a dispatch. Testing on that trigger covers every distinct image, where a blind daily schedule would mostly recompile yesterday's bits. The tracker's daily pin bump is what makes the upper bound roughly once a day. Pull request CI runs it too, but only when the change can affect the image. About five minutes on every pull request is a poor trade for one that cannot move what it tests. -The hook decides for itself whether to compile. A run of the publisher and a dispatch always compile. A pull request run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs carrying the hub pin, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new tasks before it auto-merges. The run validates the pull request's test merge commit and diffs it against its first parent, the base branch tip. The diff is therefore the whole pull request, so a later docs-only push cannot retire a compile test the branch earned. A diff it cannot compute compiles rather than guesses. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. +The hook decides for itself whether to compile. A run of the publisher and a dispatch always compile. A pull request run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs carrying the hub pin, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new `validate-task.yml` before it auto-merges. The run validates the pull request's test merge commit and diffs it against its first parent, the base branch tip. The diff is therefore the whole pull request, so a later docs-only push cannot retire a compile test the branch earned. A diff it cannot compute compiles rather than guesses. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. A composite action cannot read secrets, so the compile test pulls the public base image and reads the shared buildcache without a Docker Hub login, where the hub's Docker task logs in on every build. From ce9812d2a9dafb4660cb23fe9bf7d77ea8495dba Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:27:32 -0700 Subject: [PATCH 04/12] Count both sides of a rename in the compile gate git diff detects renames by default and names only the destination, so moving a compile input out of a gated path skipped the compile test. Pass --no-renames, and say that only a failed history fetch compiles unconditionally. The dispatch that forces a smoke build on a hub pin bump now disables the merge-bot's auto-merge first, and the hook's header comment gets its verb back. Co-Authored-By: Claude Opus 5.5 --- .github/actions/validate/action.yml | 4 ++-- OPERATIONS.md | 2 +- WORKFLOW.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml index 86c3972..da4923f 100644 --- a/.github/actions/validate/action.yml +++ b/.github/actions/validate/action.yml @@ -1,7 +1,7 @@ # The validate hook the hub's validate-task.yml runs in place of its no-op default, this repo's own domain check. # It builds the image under test and compiles firmware in it, since the toolchains ESPHome downloads on first compile link against system libraries. # A missing runtime package fails here and nowhere else, so lint and a build-only smoke cannot see it. -# The publisher always compiles, and pull request CI only when the image, what is compiled in it, or the hub pin that runs it changed. +# The publisher always compiles, and pull request CI compiles when the image, what is compiled in it, or its hub pin changed. # A composite action cannot read secrets, so the build reads the public base image and the shared cache without a Docker Hub login. name: ESPHome-NonRoot validate hook description: Compile every .github/compile-test configuration in the built image as a non-root user. @@ -35,7 +35,7 @@ runs: if ! git fetch --quiet --no-tags --depth=2 origin "$AFTER"; then compile true "history fetch failed" fi - diff="$(git diff --name-only "$AFTER^1" "$AFTER")" + diff="$(git diff --no-renames --name-only "$AFTER^1" "$AFTER")" # The two stubs carry the hub pin, so a hub release bump compile-tests the hooks under the new validate task before it auto-merges. if grep -qE '^(Docker/|\.github/compile-test/|\.github/actions/(validate|docker-prepare)/|\.github/workflows/(test-pull-request|publish-release)\.yml$|upstream-version\.json$)' <<<"$diff"; then compile true "image or compile inputs changed" diff --git a/OPERATIONS.md b/OPERATIONS.md index 2a60ac5..96bc08c 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -12,7 +12,7 @@ The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cs - **The arm64 image.** The pull request smoke build and every `develop` publish build `linux/amd64` only. Only a full `main` publish builds `linux/amd64,linux/arm64`, so an arm64-only break first surfaces on `main`. - **The firmware compile test, unless the change touches the image.** On a pull request run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. -- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build. The bumped `build-release-task.yml` therefore first calls the `docker-prepare` hook at the next publish. A manual dispatch of `test-pull-request.yml` on the bump's branch forces the smoke build before it merges. +- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build. The bumped `build-release-task.yml` therefore first calls the `docker-prepare` hook at the next publish. The merge-bot enables auto-merge on the bump, so disable it first, then dispatch `test-pull-request.yml` on the bump's branch to force the smoke build. - **A running dashboard.** No workflow starts the container and talks to the dashboard. A change that can affect the entrypoint, the dashboard, or file permissions is verified by building and running the image locally, per the runbook below. Two traps make a headless test of the running container pass while proving nothing: diff --git a/WORKFLOW.md b/WORKFLOW.md index 346ceaa..7b06c0f 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -341,7 +341,7 @@ The [`validate`][validate-hook] hook, which the hub's `validate-task.yml` runs i It is deliberately not a standalone daily job. The image only changes when a build fires, on a weekly rebuild, a pin push, or a dispatch. Testing on that trigger covers every distinct image, where a blind daily schedule would mostly recompile yesterday's bits. The tracker's daily pin bump is what makes the upper bound roughly once a day. Pull request CI runs it too, but only when the change can affect the image. About five minutes on every pull request is a poor trade for one that cannot move what it tests. -The hook decides for itself whether to compile. A run of the publisher and a dispatch always compile. A pull request run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs carrying the hub pin, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new `validate-task.yml` before it auto-merges. The run validates the pull request's test merge commit and diffs it against its first parent, the base branch tip. The diff is therefore the whole pull request, so a later docs-only push cannot retire a compile test the branch earned. A diff it cannot compute compiles rather than guesses. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. +The hook decides for itself whether to compile. A run of the publisher and a dispatch always compile. A pull request run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs carrying the hub pin, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new `validate-task.yml` before it auto-merges. The run validates the pull request's test merge commit and diffs it against its first parent, the base branch tip. The diff is therefore the whole pull request, so a later docs-only push cannot retire a compile test the branch earned. A history fetch that fails compiles rather than guesses, and a rename counts both its paths. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. A composite action cannot read secrets, so the compile test pulls the public base image and reads the shared buildcache without a Docker Hub login, where the hub's Docker task logs in on every build. From 6e449262d2c83066f0391453768bc87a8851a423 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:32:05 -0700 Subject: [PATCH 05/12] Dispatch on the merged branch to smoke-build a hub pin bump The merge-bot auto-merges a Dependabot pin bump and deletes its branch, so a dispatch on the bump's branch usually comes too late. A dispatch on the branch it merged into always smoke-builds instead. Co-Authored-By: Claude Opus 5.5 --- OPERATIONS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OPERATIONS.md b/OPERATIONS.md index 96bc08c..b13dcad 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -12,7 +12,7 @@ The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cs - **The arm64 image.** The pull request smoke build and every `develop` publish build `linux/amd64` only. Only a full `main` publish builds `linux/amd64,linux/arm64`, so an arm64-only break first surfaces on `main`. - **The firmware compile test, unless the change touches the image.** On a pull request run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. -- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build. The bumped `build-release-task.yml` therefore first calls the `docker-prepare` hook at the next publish. The merge-bot enables auto-merge on the bump, so disable it first, then dispatch `test-pull-request.yml` on the bump's branch to force the smoke build. +- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build. The bumped `build-release-task.yml` therefore first calls the `docker-prepare` hook at the next publish. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds, so it reaches the hook before the next publish. - **A running dashboard.** No workflow starts the container and talks to the dashboard. A change that can affect the entrypoint, the dashboard, or file permissions is verified by building and running the image locally, per the runbook below. Two traps make a headless test of the running container pass while proving nothing: From 855dd91189270863c19dfabe107cf3478b1fa1fd Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:37:48 -0700 Subject: [PATCH 06/12] Bound the bumped release task's first hook run by the next publish An image-touching pull request between a hub pin bump and the next publish, such as the tracker's upstream-version bump, smoke-builds under the bumped pin first, so the next publish is the upper bound rather than the first run. Co-Authored-By: Claude Opus 5.5 --- OPERATIONS.md | 2 +- WORKFLOW.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPERATIONS.md b/OPERATIONS.md index b13dcad..2c8ec18 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -12,7 +12,7 @@ The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cs - **The arm64 image.** The pull request smoke build and every `develop` publish build `linux/amd64` only. Only a full `main` publish builds `linux/amd64,linux/arm64`, so an arm64-only break first surfaces on `main`. - **The firmware compile test, unless the change touches the image.** On a pull request run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. -- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build. The bumped `build-release-task.yml` therefore first calls the `docker-prepare` hook at the next publish. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds, so it reaches the hook before the next publish. +- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build. The bumped `build-release-task.yml` therefore first calls the `docker-prepare` hook on the next image-touching pull request or publish. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds, so it reaches the hook before the next publish. - **A running dashboard.** No workflow starts the container and talks to the dashboard. A change that can affect the entrypoint, the dashboard, or file permissions is verified by building and running the image locally, per the runbook below. Two traps make a headless test of the running container pass while proving nothing: diff --git a/WORKFLOW.md b/WORKFLOW.md index 7b06c0f..fb27b36 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -321,7 +321,7 @@ The repository builds one multi-arch Docker image and declares the `docker` and - **`.github/actions/validate/action.yml`** is the image compile test, below. - **`.github/actions/resolve-upstream/action.yml`** resolves the latest `esphome` and `esphome-device-builder` releases from PyPI for the tracker. -The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump is such a workflow-only change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names both hub-pinned stubs. The bumped `build-release-task.yml` first calls that hook at the next publish, which is the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. +The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump is such a workflow-only change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names both hub-pinned stubs. The bumped `build-release-task.yml` calls that hook no later than the next publish, or sooner on an image-touching pull request, the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. ### The Upstream-Version Tracker From 3469383b47a226e6ffecaf79d1028330f15cc833 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:42:47 -0700 Subject: [PATCH 07/12] State only what a workflow-only pin bump skips The timing bounds for the bumped release task's first run kept depending on which branch and which pull request came next. Say what holds regardless: a workflow-only bump's own pull request never runs the bumped build-release-task.yml, and a dispatch on the branch it merged into does. Co-Authored-By: Claude Opus 5.5 --- OPERATIONS.md | 2 +- WORKFLOW.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPERATIONS.md b/OPERATIONS.md index 2c8ec18..06ea1e9 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -12,7 +12,7 @@ The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cs - **The arm64 image.** The pull request smoke build and every `develop` publish build `linux/amd64` only. Only a full `main` publish builds `linux/amd64,linux/arm64`, so an arm64-only break first surfaces on `main`. - **The firmware compile test, unless the change touches the image.** On a pull request run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. -- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build. The bumped `build-release-task.yml` therefore first calls the `docker-prepare` hook on the next image-touching pull request or publish. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds, so it reaches the hook before the next publish. +- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build, so a bump touching only workflow files never runs the bumped `build-release-task.yml` on its own pull request. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds under it. - **A running dashboard.** No workflow starts the container and talks to the dashboard. A change that can affect the entrypoint, the dashboard, or file permissions is verified by building and running the image locally, per the runbook below. Two traps make a headless test of the running container pass while proving nothing: diff --git a/WORKFLOW.md b/WORKFLOW.md index fb27b36..1cdb51b 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -321,7 +321,7 @@ The repository builds one multi-arch Docker image and declares the `docker` and - **`.github/actions/validate/action.yml`** is the image compile test, below. - **`.github/actions/resolve-upstream/action.yml`** resolves the latest `esphome` and `esphome-device-builder` releases from PyPI for the tracker. -The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump is such a workflow-only change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names both hub-pinned stubs. The bumped `build-release-task.yml` calls that hook no later than the next publish, or sooner on an image-touching pull request, the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. +The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump is such a workflow-only change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names both hub-pinned stubs. Such a bump's own pull request never runs the bumped `build-release-task.yml`, which is the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. ### The Upstream-Version Tracker From 0fd329b9d5d0b9802c7b93dbd2224849f6d1a2c8 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:48:00 -0700 Subject: [PATCH 08/12] Scope the workflow-only pin bump sentence to workflow files Dependabot's actions-deps group can carry a pin bump inside a composite action beside the hub pin, which the paths filter marks, so only a bump touching workflow files alone skips the smoke build. Co-Authored-By: Claude Opus 5.5 --- WORKFLOW.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WORKFLOW.md b/WORKFLOW.md index 1cdb51b..5d740f9 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -321,7 +321,7 @@ The repository builds one multi-arch Docker image and declares the `docker` and - **`.github/actions/validate/action.yml`** is the image compile test, below. - **`.github/actions/resolve-upstream/action.yml`** resolves the latest `esphome` and `esphome-device-builder` releases from PyPI for the tracker. -The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump is such a workflow-only change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names both hub-pinned stubs. Such a bump's own pull request never runs the bumped `build-release-task.yml`, which is the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. +The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump touching only workflow files is such a change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names both hub-pinned stubs. Such a bump's own pull request never runs the bumped `build-release-task.yml`, which is the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. ### The Upstream-Version Tracker From 092c7b5a23fd0d096070c966a45198f7864defac Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:52:35 -0700 Subject: [PATCH 09/12] Name the gated stubs by the tasks they pin Four stubs carry the hub pin, and the compile gate names the two that pin the validate and release tasks, so "both hub-pinned stubs" and "the two stubs carrying the hub pin" miscounted. The smoke build also runs on every dispatch, which the section 7 workflow bullet now says. Co-Authored-By: Claude Opus 5.5 --- .github/actions/validate/action.yml | 2 +- WORKFLOW.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml index da4923f..1adc871 100644 --- a/.github/actions/validate/action.yml +++ b/.github/actions/validate/action.yml @@ -36,7 +36,7 @@ runs: compile true "history fetch failed" fi diff="$(git diff --no-renames --name-only "$AFTER^1" "$AFTER")" - # The two stubs carry the hub pin, so a hub release bump compile-tests the hooks under the new validate task before it auto-merges. + # The stubs pinning the validate and release tasks are gated, so a hub bump compile-tests the hooks under the new validate task. if grep -qE '^(Docker/|\.github/compile-test/|\.github/actions/(validate|docker-prepare)/|\.github/workflows/(test-pull-request|publish-release)\.yml$|upstream-version\.json$)' <<<"$diff"; then compile true "image or compile inputs changed" fi diff --git a/WORKFLOW.md b/WORKFLOW.md index 5d740f9..04b7597 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -312,7 +312,7 @@ Sections 1 to 6 are the fleet contract. This section holds what is particular to The repository builds one multi-arch Docker image and declares the `docker` and `upstream-wrapper` types on the `release` workflow model. Every standard job graph is a hub task reached by a pinned `uses:`, and the repository carries only its caller stubs and three composite-action hooks: -- **`test-pull-request.yml`** is CI for every pull request into `main` or `develop`, in the shape section 3 describes. It calls `validate-task.yml` on every pull request. It calls `build-release-task.yml` with `smoke: true` only when its paths filter marks the image changed. Its aggregator is the ruleset-bound required check. +- **`test-pull-request.yml`** is CI for every pull request into `main` or `develop`, in the shape section 3 describes. It calls `validate-task.yml` on every pull request. It calls `build-release-task.yml` with `smoke: true` on a dispatch, or when its paths filter marks the image changed. Its aggregator is the ruleset-bound required check. - **`publish-release.yml`** is the publisher. Its `plan`, `validate`, `publish`, and `publish-docker-readme` jobs call `publish-plan-task.yml`, `validate-task.yml`, `build-release-task.yml`, and `publish-docker-readme-task.yml`. It runs on a weekly schedule, which rebuilds `main` to pick up base-image updates, on a manual dispatch of `main` or `develop`, and on a push to `main` that changes `upstream-version.json`, which the plan task publishes only when the tracker's App made it. - **`check-upstream-version.yml`** is the upstream-version tracker, calling `check-upstream-version-task.yml`. - **`merge-bot-pull-request.yml`** calls `merge-bot-task.yml` with `delete-branch: true`, since the repository-wide auto-delete is off so that `main` and `develop` survive a promotion. @@ -321,7 +321,7 @@ The repository builds one multi-arch Docker image and declares the `docker` and - **`.github/actions/validate/action.yml`** is the image compile test, below. - **`.github/actions/resolve-upstream/action.yml`** resolves the latest `esphome` and `esphome-device-builder` releases from PyPI for the tracker. -The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump touching only workflow files is such a change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names both hub-pinned stubs. Such a bump's own pull request never runs the bumped `build-release-task.yml`, which is the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. +The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump touching only workflow files is such a change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names the two stubs pinning the validate and release tasks. Such a bump's own pull request never runs the bumped `build-release-task.yml`, which is the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. ### The Upstream-Version Tracker @@ -341,7 +341,7 @@ The [`validate`][validate-hook] hook, which the hub's `validate-task.yml` runs i It is deliberately not a standalone daily job. The image only changes when a build fires, on a weekly rebuild, a pin push, or a dispatch. Testing on that trigger covers every distinct image, where a blind daily schedule would mostly recompile yesterday's bits. The tracker's daily pin bump is what makes the upper bound roughly once a day. Pull request CI runs it too, but only when the change can affect the image. About five minutes on every pull request is a poor trade for one that cannot move what it tests. -The hook decides for itself whether to compile. A run of the publisher and a dispatch always compile. A pull request run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs carrying the hub pin, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new `validate-task.yml` before it auto-merges. The run validates the pull request's test merge commit and diffs it against its first parent, the base branch tip. The diff is therefore the whole pull request, so a later docs-only push cannot retire a compile test the branch earned. A history fetch that fails compiles rather than guesses, and a rename counts both its paths. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. +The hook decides for itself whether to compile. A run of the publisher and a dispatch always compile. A pull request run of `test-pull-request.yml` compiles only when the change touches `Docker/`, `.github/compile-test/`, the `validate` or `docker-prepare` hook, `upstream-version.json`, or one of the two stubs pinning the validate and release tasks, `test-pull-request.yml` and `publish-release.yml`. A hub release bump is therefore compile-tested under the new `validate-task.yml` before it auto-merges. The run validates the pull request's test merge commit and diffs it against its first parent, the base branch tip. The diff is therefore the whole pull request, so a later docs-only push cannot retire a compile test the branch earned. A history fetch that fails compiles rather than guesses, and a rename counts both its paths. The pin path is in the set, so a tracker bump is compile-tested before it auto-merges. A composite action cannot read secrets, so the compile test pulls the public base image and reads the shared buildcache without a Docker Hub login, where the hub's Docker task logs in on every build. @@ -374,7 +374,7 @@ They are hand-authored and checked in, each naming the upstream project it is mo - **D10.1:** each `build-release-task.yml` and `publish-docker-readme-task.yml` call maps both `DOCKER_HUB_*` secrets by name. - **D10.2:** the `docker-prepare` hook reads both pins, fails on an empty one, and adds the version tag only where `branch` is `main`. -- **D10.3 to D10.5:** the `validate` hook's decide step compiles on every event but `pull_request` and every workflow but `test-pull-request.yml`. On a pull request it diffs the test merge commit against its first parent. Its path set names `Docker/`, `.github/compile-test/`, the `validate` and `docker-prepare` hooks, the two hub-pinned stubs, and `upstream-version.json`. The build reads its context, Dockerfile, cache repository, and build-args from the `docker-prepare` hook's matrix entry. The build step sets `load: true` and `push: false` with no `cache-to`, the fixtures are compiled with `esphome config` before `esphome compile`, nothing fetches a configuration at run time, and the container runs `--user 1000:1000`. +- **D10.3 to D10.5:** the `validate` hook's decide step compiles on every event but `pull_request` and every workflow but `test-pull-request.yml`. On a pull request it diffs the test merge commit against its first parent. Its path set names `Docker/`, `.github/compile-test/`, the `validate` and `docker-prepare` hooks, the two stubs pinning the validate and release tasks, and `upstream-version.json`. The build reads its context, Dockerfile, cache repository, and build-args from the `docker-prepare` hook's matrix entry. The build step sets `load: true` and `push: false` with no `cache-to`, the fixtures are compiled with `esphome config` before `esphome compile`, nothing fetches a configuration at run time, and the container runs `--user 1000:1000`. - **D10.6:** the watcher is daily, App-signed, targets `develop` on a head ref no merge-bot rule matches, and writes a file no build step reads. | # | Input | Expected output | Exercises | From 8c1d9a208723db226397476003c0683d284a64dc Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:58:37 -0700 Subject: [PATCH 10/12] Warn that a dispatch lands on an open pull request's check A dispatch posts the required check on the branch head without the prose gate, so it also answers any open pull request headed by that branch. Name the hub issue tracking it, and list the repo gate in the docs-only scenario's expected output. Co-Authored-By: Claude Opus 5.5 --- OPERATIONS.md | 2 +- WORKFLOW.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPERATIONS.md b/OPERATIONS.md index 06ea1e9..c866fce 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -12,7 +12,7 @@ The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cs - **The arm64 image.** The pull request smoke build and every `develop` publish build `linux/amd64` only. Only a full `main` publish builds `linux/amd64,linux/arm64`, so an arm64-only break first surfaces on `main`. - **The firmware compile test, unless the change touches the image.** On a pull request run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. -- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build, so a bump touching only workflow files never runs the bumped `build-release-task.yml` on its own pull request. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds under it. +- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build, so a bump touching only workflow files never runs the bumped `build-release-task.yml` on its own pull request. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds under it. Its check also lands on any open pull request headed by that branch, without the prose gate, per ptr727/ProjectTemplate#3334. - **A running dashboard.** No workflow starts the container and talks to the dashboard. A change that can affect the entrypoint, the dashboard, or file permissions is verified by building and running the image locally, per the runbook below. Two traps make a headless test of the running container pass while proving nothing: diff --git a/WORKFLOW.md b/WORKFLOW.md index 04b7597..2755638 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -381,7 +381,7 @@ They are hand-authored and checked in, each naming the upstream project it is mo | --- | --- | --- | --- | | S15 | pull request touching `Docker/Dockerfile` | `validate` compiles every fixture, `smoke-build` builds the image, nothing is pushed or released, aggregator success | D10.3 | | S16 | docs-only push to a pull request whose branch earlier changed `Docker/**` | the test merge commit's diff still sees the image change, so the compile test runs and the branch cannot pass ungated | D10.3 | -| S17 | docs-only pull request | the decide step reports the compile inputs unchanged, `validate` runs the lint and prose gates only, `smoke-build` skips, aggregator success | D1.1, D10.3 | +| S17 | docs-only pull request | the decide step reports the compile inputs unchanged, `validate` runs its lint, repo, and prose gates without compiling, `smoke-build` skips, aggregator success | D1.1, D10.3 | | S18 | upstream adds an apt package to its base image | the watcher opens a PR against `develop` naming the added package, which does **not** auto-merge and does **not** publish | D10.6 | | S19 | a runtime library the toolchain links against is dropped from the Dockerfile | the compile test fails on the ESP-IDF fixtures, the aggregator blocks the merge, and a publish of such a tree pushes nothing | D10.3, D10.5 | | S20 | an ESPHome release changes a schema a fixture uses | `esphome config` fails before `esphome compile`, naming the fixture to update | D10.4 | From 45d46e92e20ae6cbad9334a16351793b69e2f04c Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 19:59:04 -0700 Subject: [PATCH 11/12] State the dispatch constraint instead of citing an issue The prose gate refuses an issue reference in docs, so say what the dispatch does to an open pull request's check in place of the link. Co-Authored-By: Claude Opus 5.5 --- OPERATIONS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OPERATIONS.md b/OPERATIONS.md index c866fce..0476f26 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -12,7 +12,7 @@ The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cs - **The arm64 image.** The pull request smoke build and every `develop` publish build `linux/amd64` only. Only a full `main` publish builds `linux/amd64,linux/arm64`, so an arm64-only break first surfaces on `main`. - **The firmware compile test, unless the change touches the image.** On a pull request run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. -- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build, so a bump touching only workflow files never runs the bumped `build-release-task.yml` on its own pull request. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds under it. Its check also lands on any open pull request headed by that branch, without the prose gate, per ptr727/ProjectTemplate#3334. +- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build, so a bump touching only workflow files never runs the bumped `build-release-task.yml` on its own pull request. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds under it. Its check also lands on any open pull request headed by that branch, standing in for that pull request's own run without the prose gate. - **A running dashboard.** No workflow starts the container and talks to the dashboard. A change that can affect the entrypoint, the dashboard, or file permissions is verified by building and running the image locally, per the runbook below. Two traps make a headless test of the running container pass while proving nothing: From d08f8e94988200d991b9246474f8dad98425ece8 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 21 Oct 2026 20:05:30 -0700 Subject: [PATCH 12/12] Correct three claims about the gates each run carries The pull request leg adds the prose gate and change-gates the compile test, so it is not identical to the publish gate. A dispatch and a pull request run share one required check, and the last to finish decides it. A fork smoke build fails on missing credentials wherever the paths filter marks the image, not only on image paths. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/test-pull-request.yml | 2 +- OPERATIONS.md | 2 +- WORKFLOW.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index ab00139..b7c8d1f 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -39,7 +39,7 @@ jobs: - 'upstream-version.json' - '.github/actions/**' - # The same reusable gate the publisher runs, so the pull request gate and the publish gate are identical. + # The same reusable gate the publisher runs, which adds the prose gate on a pull request and change-gates the compile test. validate: name: Validate job uses: ptr727/ProjectTemplate/.github/workflows/validate-task.yml@fb7f02b24d6282f943ecb2ded1b206326d3f4610 # 2.0.1122 diff --git a/OPERATIONS.md b/OPERATIONS.md index 0476f26..1c72738 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -12,7 +12,7 @@ The gates are the hub's `validate-task.yml` lint block, `markdownlint-cli2`, `cs - **The arm64 image.** The pull request smoke build and every `develop` publish build `linux/amd64` only. Only a full `main` publish builds `linux/amd64,linux/arm64`, so an arm64-only break first surfaces on `main`. - **The firmware compile test, unless the change touches the image.** On a pull request run of `test-pull-request.yml`, the `validate` hook compiles only on a change to the image, to what is compiled in it, or to the hub pin. A change outside those paths merges without anything compiling firmware in the image. -- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build, so a bump touching only workflow files never runs the bumped `build-release-task.yml` on its own pull request. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds under it. Its check also lands on any open pull request headed by that branch, standing in for that pull request's own run without the prose gate. +- **The bumped release task, on a hub pin bump.** A workflow-only pull request skips the smoke build, so a bump touching only workflow files never runs the bumped `build-release-task.yml` on its own pull request. A dispatch of `test-pull-request.yml` on the branch the bump merged into always smoke-builds under it. Its check also lands on any open pull request headed by that branch. Whichever run finishes last decides that pull request's required check, and only the pull request's own run checks prose. - **A running dashboard.** No workflow starts the container and talks to the dashboard. A change that can affect the entrypoint, the dashboard, or file permissions is verified by building and running the image locally, per the runbook below. Two traps make a headless test of the running container pass while proving nothing: diff --git a/WORKFLOW.md b/WORKFLOW.md index 2755638..a6bca84 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -321,7 +321,7 @@ The repository builds one multi-arch Docker image and declares the `docker` and - **`.github/actions/validate/action.yml`** is the image compile test, below. - **`.github/actions/resolve-upstream/action.yml`** resolves the latest `esphome` and `esphome-device-builder` releases from PyPI for the tracker. -The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump touching only workflow files is such a change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names the two stubs pinning the validate and release tasks. Such a bump's own pull request never runs the bumped `build-release-task.yml`, which is the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails at the Docker Hub login when it touches the image. A maintainer therefore lands such a contribution on an in-repo branch before merging. +The paths filter lists `Docker/**`, `version.json`, `upstream-version.json`, and `.github/actions/**`. A docs-only or workflow-only pull request therefore skips the smoke build, per D1.1 and D1.4. A hub pin bump touching only workflow files is such a change. The compile test still runs the `docker-prepare` hook under the bumped `validate-task.yml`, since its gate names the two stubs pinning the validate and release tasks. Such a bump's own pull request never runs the bumped `build-release-task.yml`, which is the cost D1.4 accepts. A fork pull request runs CI like any other, without the repository's secrets. Its smoke build fails on the missing Docker Hub credentials whenever the paths filter marks the image changed. A maintainer therefore lands such a contribution on an in-repo branch before merging. ### The Upstream-Version Tracker