Repository navigation
Adopt ProjectTemplate Docker release pipeline and conventions - #61
Conversation
Bring ESPHome-NonRoot in-line with ptr727/ProjectTemplate (develop) as a Docker-only derived repo: carry the cross-cutting contract verbatim and re-sync it going forward, while preserving the three ESPHome-specific behaviors the template has no equivalent for. Pipeline: replace the monolithic BuildDockerPush.yml with the template's two-layer model. Orchestration is carried verbatim (get-version-task, build-datebadge-task, publish-release, and the get-version + github-release jobs in build-release-task); the build layer is the owned build-docker-task leaf. Drop the nuget/pypi/executable targets and the publish-pypi job, and the .NET unit-test job from test-pull-request, keeping the ruleset-bound "Check pull request workflow status" aggregator. Two-phase model (PUBLISH_ON_MERGE unset): PRs smoke-test amd64 only; the weekly schedule and manual dispatch publish both branches. ESPHome-specific behavior, aligned with sibling downstreams: - build-docker-task tags :latest/:develop plus the pinned upstream ESPHome version and passes it as the ESPHOME_VERSION build-arg, read from the committed .github/esphome-version.json state file. - check-esphome-version replaces CheckUpstreamRelease, mirroring homeassistant-purpleair's check-ha-version: it resolves the latest ESPHome from PyPI and opens a rolling, App-authored, signed bump PR (dual-targeted across main and develop since the version is shipped content) that merge-bot auto-merges and the next publish ships. - publish-docker-readme-task mirrors NxWitness: it pushes a static Docker/README.md via DOCKER_HUB_ACCESS_TOKEN, replacing the m4/toolversions machinery and the DOCKER_HUB_PASSWORD secret. Carry verbatim: AGENTS.md (Docker-only adaptation), copilot-instructions.md, .markdownlint-cli2.jsonc, .editorconfig (C# block trimmed, deviation noted), .gitattributes. Add a dual-target docker Dependabot ecosystem and point the README build badge at publish-release.yml.
Maintainer GitHub-side setup runbookI automated what was safe; the rest needs you. Summary of what I checked:
1. Rulesets - NOT auto-imported (brownfield, maintainer-only)
To bring them up to the template (your call): # Export the template's two rulesets (writable fields only)
for name in develop main; do
id=$(gh api repos/ptr727/ProjectTemplate/rulesets --jq ".[] | select(.name==\"$name\") | .id")
gh api "repos/ptr727/ProjectTemplate/rulesets/$id" \
--jq '{name, target, enforcement, bypass_actors, conditions, rules}' > "$name-ruleset.json"
done
# Either delete the two minimal same-named rulesets and re-create,
# or full-payload PUT them (rename not needed - names already match).
# Existing ids: develop=918710 main=918708
# gh api -X DELETE repos/ptr727/ESPHome-NonRoot/rulesets/918710
# gh api -X DELETE repos/ptr727/ESPHome-NonRoot/rulesets/918708
for name in develop main; do
gh api -X POST repos/ptr727/ESPHome-NonRoot/rulesets --input "$name-ruleset.json"
doneBecause of the unsigned history, before/after enabling 2. Secrets
3. Verify after merge
|
There was a problem hiding this comment.
Pull request overview
Aligns ESPHome-NonRoot with the ptr727/ProjectTemplate “Docker-only derived repo” conventions by replacing the legacy single-workflow build/push model with a two-layer reusable-workflow release pipeline, and by adopting the sibling-style upstream ESPHome version tracker + Docker Hub README publishing.
Changes:
- Replaced the legacy
BuildDockerPush.yml/CheckUpstreamRelease.ymlworkflows with a reusable-workflow orchestration model (publish-release.yml,test-pull-request.yml, and shared*-task.ymlbuilding blocks). - Added an ESPHome upstream version tracker (
check-esphome-version.yml) that bumps.github/esphome-version.jsonvia an App-authored PR flow. - Switched Docker Hub README publishing to a static
Docker/README.mdpushed viapublish-docker-readme-task.yml, and updated repo linting/line-ending governance files (.editorconfig,.markdownlint-cli2.jsonc,.gitattributes).
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates pipeline references and workflow badge to the new release workflow. |
| Docker/README.md | Adds a static Docker Hub README source file. |
| Docker/README.m4 | Removes m4-based README generation source. |
| AGENTS.md | Adds template-derived repo conventions and workflow contracts. |
| .markdownlint-cli2.jsonc | Adds markdownlint-cli2 configuration aligned to the template. |
| .github/workflows/test-pull-request.yml | Adds PR smoke-test workflow using reusable tasks and an aggregator check. |
| .github/workflows/publish-release.yml | Adds orchestrator workflow for scheduled/dispatch publishing and optional publish-on-merge. |
| .github/workflows/publish-docker-readme-task.yml | Adds reusable task to publish Docker Hub README from Docker/README.md. |
| .github/workflows/merge-bot-pull-request.yml | Adds/updates merge-bot workflow for Dependabot and ESPHome bump PRs. |
| .github/workflows/get-version-task.yml | Adds reusable NBGV versioning task for consistent tagging. |
| .github/workflows/check-esphome-version.yml | Adds daily upstream tracker that opens rolling bump PRs for both branches. |
| .github/workflows/build-release-task.yml | Adds reusable “build release” task that composes versioning + Docker build + GitHub release. |
| .github/workflows/build-docker-task.yml | Adds the Docker build/push task (repo-owned build layer). |
| .github/workflows/build-datebadge-task.yml | Adds reusable task for updating the BYOB date badge. |
| .github/esphome-version.json | Adds committed ESPHome version state used for image tags and build args. |
| .github/dependabot.yml | Adds dual-target Dependabot updates and docker ecosystem entries. |
| .github/copilot-instructions.md | Adds Copilot runbook and repo-specific review mechanics pointering to AGENTS.md. |
| .gitattributes | Normalizes/updates EOL governance header while keeping * -text. |
| .editorconfig | Adds per-extension EOL and formatting rules aligned with the template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Filed the template-gap issues upstream: ptr727/ProjectTemplate#157 (upstream-version tracker pattern), ptr727/ProjectTemplate#158 (docker tag from external version), ptr727/ProjectTemplate#159 (unit-test .NET coupling in test-pull-request), ptr727/ProjectTemplate#160 (.editorconfig C# block in a verbatim carry), ptr727/ProjectTemplate#161 (Docker Hub README task). |
The pinned upstream version is a build-input version source, not GitHub platform config, so it belongs beside version.json at the repo root rather than under .github/. Update build-docker-task, check-esphome-version, test-pull-request, and AGENTS.md references.
Forces a fresh pull_request merge-ref so reusable workflows resolve from the current head (the prior run executed a stale merge-ref after a close/reopen). No content change; squashed away on merge to develop.
…and doc cadence - build-docker-task: self-gate push and cache-to on !smoke (defense-in-depth) - check-esphome-version: ref-independent concurrency group so the scheduled run and a manual dispatch can't race the esphome-version-bump/* branches - Docker/README.md: describe the two-phase publish cadence accurately - publish-release.yml: base-image example matches python:3.13-slim
jq emits LF; .editorconfig requires CRLF for *.json and .gitattributes disables EOL normalization, so convert the rewritten file to CRLF before committing or every bump PR would flip it to LF.
…ules - Drop sibling-repo references (other repos are not relevant to a reviewer) - Drop AGENTS.md/ruleset rule-citations from authored comments; state the intrinsic reason instead - Correct the Docker Hub login comment: this is a public repo, so describe the authenticated-pull logic and its real fork-PR consequence rather than a false private-repo justification
- Login only when publishing so fork PR smoke builds (no secret access) can run - Rephrase the no-op-republish comment to describe the skip behavior without comparing to NuGet/PyPI registries this repo does not ship
Make comments short and reviewer-focused: describe what the code does, drop historic/design background, cross-project references, and rule citations. Remove the dead semver-major NuGet auto-merge guard and its metadata step (no NuGet ecosystem here; behavior unchanged).
|
Trimmed all workflow comments to concise current-state context (no cross-project refs, historic/design background, or rule citations; non-obvious-only). Net ~240 fewer comment lines; removed the dead semver-major NuGet auto-merge guard (no NuGet ecosystem here). Filed the comment-style observation upstream as ptr727/ProjectTemplate#162. |
Brings ESPHome-NonRoot in-line with
ptr727/ProjectTemplate(develop) as a Docker-only derived repo, and keeps it consistent with the sibling downstreamshomeassistant-purpleairandNxWitness.Pipeline (template two-layer model)
get-version-task.yml,build-datebadge-task.yml,publish-release.yml, and theget-version+github-releasejobs inbuild-release-task.yml.build-docker-task.yml. Dropped the nuget/pypi/executable targets, thepublish-pypijob, and the .NETunit-testjob fromtest-pull-request.yml(the ruleset-boundCheck pull request workflow statusaggregator is preserved).PUBLISH_ON_MERGEunset): PRs smoke-testlinux/amd64only; the weekly schedule + manual dispatch publish both branches.ESPHome-specific behavior (preserved, sibling-aligned)
:latest/:develop+ the pinned upstream ESPHome version, also passed as theESPHOME_VERSIONbuild-arg, read from the committed.github/esphome-version.json.check-esphome-version.ymlreplacesCheckUpstreamRelease.yml, mirroring purpleair'scheck-ha-version.yml: resolves the latest ESPHome from PyPI and opens a rolling, App-authored, signed bump PR (dual-targeted over main + develop, since the version is shipped content) that merge-bot auto-merges; the next publish ships it.publish-docker-readme-task.ymlmirrors NxWitness: pushes a staticDocker/README.mdviaDOCKER_HUB_ACCESS_TOKEN, replacing the m4/toolversionsmachinery and theDOCKER_HUB_PASSWORDsecret.Verbatim carries / config
AGENTS.md(Docker-only adaptation),.github/copilot-instructions.md,.markdownlint-cli2.jsonc,.editorconfig(C# block trimmed, deviation noted inline),.gitattributes. Added a dual-targetdockerDependabot ecosystem; pointed the README build badge atpublish-release.yml.Local verification
actionlint(with shellcheck) andmarkdownlint-cli2both clean.docker buildx build --platform linux/amd64 --build-arg ESPHOME_VERSION=2026.6.2succeeds;esphome versionin the image reports2026.6.2, matching the state file.Two-phase latency note
In the two-phase model, a merged ESPHome-version bump ships on the next weekly/dispatch publish rather than within ~24h (matching NxWitness). Flip
PUBLISH_ON_MERGE=trueor add a post-merge dispatch if prompt rebuilds are wanted.Follow-up (maintainer / GitHub-side)
develop/mainrulesets; setPUBLISH_ON_MERGEunset; enable "Allow GitHub Actions to create and approve pull requests".DOCKER_HUB_USERNAME,DOCKER_HUB_ACCESS_TOKEN(no moreDOCKER_HUB_PASSWORD); create/install theptr727-codegenGitHub App and addCODEGEN_APP_CLIENT_ID+CODEGEN_APP_PRIVATE_KEYto the Actions and Dependabot secret stores (powers merge-bot and the version tracker).ptr727/ProjectTemplate(no upstream-rebuild pattern, external-version docker tag, unit-test .NET coupling,.editorconfigC# block, no Docker Hub README task).🤖 Generated with Claude Code