Skip to content

Simplify updates: self-updating binary, weekly betas, cut transition code #1308

Open

Description

@frahlg

Problem

The update path is now the largest piece of non-control code in Core, and it is where testers' boxes break. Measured on master on 2026-09-18:

Measure Value
Go in the update path (updater sidecar, checker, API, rollback point) ~6 000 lines
Tests for it ~4 300 lines
CI for beta, stable and assets ~2 000 lines
Install, migration and paired-upgrade scripts ~2 100 lines
Of which one-time transition code (2.x → 3.x, Python retirement, legacy Compose, forty-two-watts alias) ~2 800 lines
Commits touching the update path, last 90 days 73 of 867
Betas published 7–18 September 20
Open updater issues 10

Almost none of this is what keeps a box safe. The safety is three things: a rollback point before the update, a health check after it, and immutable tags. The rest is delivery mechanics that follow from Docker being the way in: a sidecar owns the Docker socket, replaces itself, pins tags in .env, must see the project directory at the host's own path, and must handshake with Core before Core may start. #1073, #989, #1164, #1302 and #1305 all have this shape. The SQLite → DuckDB migration then landed inside that machinery and turned the rollback point into a copy of the whole history.

Core is already a static binary (CGO_ENABLED=0), and every release already publishes ftw-linux-{amd64,arm64}.tar.gz with binary, web, drivers and the Energyplan bundle, plus a sha256. evcc ships no in-app update at all. Syncthing, Caddy and Tailscale replace their own binary. Nothing in FTW's problem needs more than that.

Proposal

ADR 0007 describes the target: #1309. Three steps, each shippable on its own.

1. Weekly beta cadence (no code)

  • Run beta.yml on a weekly schedule instead of after every Version Packages merge; hotfix betas only for release-blocker
  • Promote to stable after one week on the home box and at least one other site
  • Write the cadence into docs/self-update.md

2. Cut transition code (once every known box runs 3.5 or later)

  • Remove go/cmd/ftw-updater/retire_python.go and its test
  • Remove scripts/migrate-legacy-compose.sh, scripts/upgrade-paired-release.sh, their tests, docs/upgrade-from-legacy.md and docs/upgrade-paired-release.md
  • Drop the forty-two-watts aliases from the Dockerfile, release assets and installer
  • Remove the legacy state-schema marker path once no 3.5.x box remains (Legacy 3.x: schema-change backup cannot finish on large converted histories #1302 follow-up)

3. Self-updating binary (ADR 0007)

  • Core downloads the release tarball, verifies the sha256 and unpacks it to releases/<tag>/
  • Two slots, current and next. A launcher starts next once; the new Core commits itself after its own readiness check, otherwise the launcher falls back to current
  • Rollback from the UI is the same swap in reverse. The state rollback point (state.db + config, the Legacy 3.x: schema-change backup cannot finish on large converted histories #1302 model) stays
  • Pi image: systemd unit plus tarball, no Docker engine; Mosquitto from apt
  • history-migrate (DuckDB, CGO) ships in the tarball as a second binary or moves into Core
  • Docker: plain image, no sidecar, self-update off, docker compose pull documented as the manual path; the Home Assistant add-on stays on Supervisor
  • Delete go/cmd/ftw-updater, go/internal/updateipc, the Compose and .env pinning in selfupdate, Dockerfile.updater and the update-ipc volume
  • Existing Docker boxes: one last Docker release whose update banner points at the installer
  • The version returns to 0.x at the cutover; the first binary release is v0.131.0 (Versioning: return to 0.x, drop major bumps, owner decides minors #1314)

Not changing

Rollback point before every Core update, health check after start, immutable tags only. These stay in every step.

Evidence before step 3 is accepted

Related: #140, #989, #1140, #1159, #1164, #1223, #1234, #1254, #1302, #1305, #1313 (stable channel), #1314 (versioning).

Activity

  1. added
    enhancement
    on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions