feat: auto-sync add-on pins to upstream FTW releases and publish beta - #4
Open
HuggeK wants to merge 1 commit into
Open
feat: auto-sync add-on pins to upstream FTW releases and publish beta#4HuggeK wants to merge 1 commit into
HuggeK wants to merge 1 commit into
Conversation
Add end-to-end automation so a new upstream FTW Core/Optimizer release flows into a packaged beta add-on without hand-editing pins: - scripts/upstream_sync.py selects the highest published upstream release, resolves the multi-arch digest and source commit from the registry, verifies the version/revision image labels the release gate re-checks, and rewrites compatibility.yaml, ftw/config.yaml, ftw/CHANGELOG.md and a fresh blocked pilot record. It only moves forward and retries later when an image is not fully published (ImageNotReady). - .github/workflows/sync-upstream.yml runs hourly, on repository_dispatch (ftw-release), or manually; it validates + tests, opens a PR, runs check.yml on the branch, merges when checks pass, then nudges publication. - .github/workflows/auto-publish-beta.yml dispatches the existing signed release-beta.yml only when config.yaml carries a pending beta marker, guarding against existing tags/releases and active runs. The automation holds no packages:write and never builds, pushes, or retags images, so the fail-closed gates (human-reviewed main, cosign signing, SBOMs, pilot qualification) remain the only path to a published release. Generalizes version-coupled tests to read the pinned version, and adds unit + workflow-structure coverage for the new automation. Co-authored-by: HuggeK <48095810+HuggeK@users.noreply.github.com>
HuggeK
marked this pull request as ready for review
July 29, 2026 13:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Makes the FTW Home Assistant add-on update itself when a new FTW version is
released upstream and get packaged on the beta channel — no hand-editing of
pins. Today every release is manually dispatched and every upstream digest is
pinned by hand in
compatibility.yaml; this closes that loop while keeping theexisting fail-closed release gates as the only path to a published artifact.
The flow
Sync upstream FTW(.github/workflows/sync-upstream.yml) — runshourly, on
repository_dispatch: ftw-release, or manually. It runsscripts/upstream_sync.py, which picks the highest published upstreamCore/Optimizer release, resolves the multi-arch digest and source commit
from the registry, and rewrites
compatibility.yaml,ftw/config.yaml,ftw/CHANGELOG.md, and a fresh blocked pilot record. It then validates,runs the test suite, opens a PR, runs
check.ymlon the branch, merges whenchecks pass, and nudges publication.
Auto publish beta(.github/workflows/auto-publish-beta.yml) — on thepush to
main, dispatches the existingrelease-beta.ymlonly whenconfig.yamlstill carries the pending beta marker, guarding againstalready-existing tags/releases and active runs.
Why it's still safe
The automation holds no
packages: writeand never builds, pushes, orretags an image. It only produces a human-reviewed PR and, after merge,
dispatches the existing signed
release-beta.yml, which independentlyre-verifies the version match, publisher marker, source-on-
main, cosignsignatures, and SBOMs. The fail-closed gates remain the only way to ship.
Design details & guarantees
upstream_sync.pynever downgrades and skips upstreamreleases whose multi-arch image is not fully published yet (
ImageNotReady→ retry on the next schedule tick).
org.opencontainers.image.version/.revisionlabels match the release, soit can't pin a mislabeled or half-published image.
and resets
home_assistant_os_supervisortoblocked+promoted_from_betato nulls, so nothing is auto-promoted to stable.already exists.
Auto publish betafires on the merge push and on aschedule fallback, so a missed dispatch still self-heals.
srcfl/ftwcan sendrepository_dispatchtypeftw-releasefor instant syncs; the hourly cron is the fallback if itdoesn't.
Tests
python -m unittest discover -s tests→ 113 passing. Addstests/test_upstream_sync.py(version ordering, release selection, next-versionlogic, file rewrites, and a compose→YAML round-trip asserted against the real
validators) and
tests/test_automation_workflows.py(structure assertions thatthe workflows can't write packages or build/push images). Generalizes the
version-coupled tests in
test_validate.py/test_release_gate.pyso futureautomated bumps don't break the suite.
🤖 Generated with Claude Code