Let beta testers update to a stable release in place #117

Merged
aluminum-ice merged 1 commit from feature/min-update-from into main 2026-10-31 05:39:34 +00:00
Owner

What this PR does

Stops beta testers from flashing twice in a cycle. Today a stable release's manifest is built only against the previous stable release, so if any beta in the cycle needed a reflash, the stable release is reflash for everyone, including devices that already flashed that beta. Now, when a stable release comes out reflash that way, the workflow also diffs it against each beta of its own cycle, newest first. If nothing in the build changed after some beta B, the release is app-layer with "min_update_from": "B".

  • No device change needed: the updates plugin and update-apply --verify already refuse an in-place update below min_update_from, and their gap check ignores betas for a stable target. New tests in test_updates.py and test_update_apply.py pin that down for this exact case: a reflash beta.1, an in-place beta.2, then a stable release floored at beta.1. It's offered on either beta and sends a device on the previous stable to reflash.
  • Why it's safe: a device on B or later has B's build layer. It was flashed with B, or reached it through in-place updates that changed no build input. The floor is the oldest beta from which every later beta also diffs clean, so a build change made and then reverted between betas can't slip through.
  • .forgejo/update_manifest.py: the manifest logic moves out of the workflow's inline shell and Python into a script. .forgejo/test_update_manifest.py (15 tests, now part of make test) covers it: version order, previous release, cycle betas, every decide branch, build_changed against a real throwaway git repo, the manifest shape, and fetching.
  • Release list paging: the step used to read only the first 50 releases, and there are already 30-plus. Past 50, the previous stable release could fall off the page and every release would come out "first release; flash the image". The script now reads every page and stays conservative (reflash) when the list can't be read.
  • Release notes: the install line becomes "app-layer on B or later — apply in place via the updates plugin; older devices flash the image" when there is a floor.
  • Docs: releasing.md, updates-setup.md, CLAUDE.md (beta-channel note, layout table), the README file tree, and the Makefile's test comment, which was stale: it said the tests weren't part of CI. Removes the deferred entry.

Checklist

  • Lint passes — make lint (ansible --syntax-check, yamllint, shellcheck --severity=error, and the real-data check). The Lint workflow runs this on the PR.
  • Tests pass — make test (the kestrel_pi pytest suite and the real-data check's tests). The Test workflow runs this on the PR.
  • Nothing real: no secrets, no personal information, no real data. This is a public repository. The diff contains no real account passwords or hashes, Wi-Fi passphrases, private keys, API tokens, .env files, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you.
  • Consent gates intact. Capture and network plugins still ship disabled, enabling them still takes the authorized-use acknowledgment (never pre-ticked or given by code), and the capture whitelist is still enforced.
  • Docs updated in the same PR, if this changes something an operator sees or configures: the README package table, the relevant page under docs/, and the on-device operator guide (GUIDE_MD in kestrel_pi/userguide.py) where it applies.
  • Commit messages are short and imperative.

Release impact

  • App-layer-safe — changes only files the in-place update engine carries: the kestrel_pi package, plugins/*.py, systemd units, the journald drop-in, a lib script already in the engine's LIB_SCRIPTS, or the CLI.
  • Reflash-class — touches a build input the engine does not carry onto a running device: apt or pip packages, boot options / config.txt / cmdline, kernel modules, the base image or partition size, builder/config.json, builder/config.yml, the Makefile, .forgejo/workflows/, a shipped config default (config.toml / default.conf), or a brand-new lib script.

Notes for review

  • Nothing on the device changes; the Makefile and workflow edits make auto mark the next release reflash, which 1.0.11-beta.1 is anyway.
  • Dry run on real history (read-only, against the live release list and tags): 1.0.10 → app-layer; 1.0.9 → app-layer with min_update_from: 1.0.9-beta.1 (1.0.8 → 1.0.9 changed the build, all of it in beta.1); 1.0.11 today → reflash, as no 1.0.11 beta exists yet.
  • For 1.0.11: the floor only holds if nothing in the build changes after the beta testers flash. A later config.yml, config.json, Makefile or workflow change moves the floor to the first beta after it. Forcing update_kind still overrides everything.
  • test_gps_serial_reader_recovers_from_a_stalled_link fails only on my machine (on main too) and passes in CI.

🤖 Generated with Claude Code

## What this PR does Stops beta testers from flashing twice in a cycle. Today a stable release's manifest is built only against the previous stable release, so if any beta in the cycle needed a reflash, the stable release is reflash for everyone, including devices that already flashed that beta. Now, when a stable release comes out reflash that way, the workflow also diffs it against each beta of its own cycle, newest first. If nothing in the build changed after some beta B, the release is `app-layer` with `"min_update_from": "B"`. - **No device change needed:** the `updates` plugin and `update-apply --verify` already refuse an in-place update below `min_update_from`, and their gap check ignores betas for a stable target. New tests in `test_updates.py` and `test_update_apply.py` pin that down for this exact case: a reflash beta.1, an in-place beta.2, then a stable release floored at beta.1. It's offered on either beta and sends a device on the previous stable to reflash. - **Why it's safe:** a device on B or later has B's build layer. It was flashed with B, or reached it through in-place updates that changed no build input. The floor is the oldest beta from which *every* later beta also diffs clean, so a build change made and then reverted between betas can't slip through. - **`.forgejo/update_manifest.py`:** the manifest logic moves out of the workflow's inline shell and Python into a script. `.forgejo/test_update_manifest.py` (15 tests, now part of `make test`) covers it: version order, previous release, cycle betas, every `decide` branch, `build_changed` against a real throwaway git repo, the manifest shape, and fetching. - **Release list paging:** the step used to read only the first 50 releases, and there are already 30-plus. Past 50, the previous stable release could fall off the page and every release would come out "first release; flash the image". The script now reads every page and stays conservative (reflash) when the list can't be read. - **Release notes:** the install line becomes "app-layer on B or later — apply in place via the updates plugin; older devices flash the image" when there is a floor. - **Docs:** `releasing.md`, `updates-setup.md`, CLAUDE.md (beta-channel note, layout table), the README file tree, and the Makefile's test comment, which was stale: it said the tests weren't part of CI. Removes the deferred entry. ## Checklist - [x] **Lint passes** — `make lint` (ansible `--syntax-check`, `yamllint`, `shellcheck --severity=error`, and the real-data check). The **Lint** workflow runs this on the PR. - [x] **Tests pass** — `make test` (the `kestrel_pi` pytest suite and the real-data check's tests). The **Test** workflow runs this on the PR. - [x] **Nothing real: no secrets, no personal information, no real data.** This is a public repository. The diff contains no real account passwords or hashes, Wi-Fi passphrases, private keys, API tokens, `.env` files, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you. - [x] **Consent gates intact.** Capture and network plugins still ship disabled, enabling them still takes the authorized-use acknowledgment (never pre-ticked or given by code), and the capture whitelist is still enforced. - [x] **Docs updated in the same PR**, if this changes something an operator sees or configures: the README package table, the relevant page under `docs/`, and the on-device operator guide (`GUIDE_MD` in `kestrel_pi/userguide.py`) where it applies. - [x] Commit messages are short and imperative. ## Release impact - [ ] **App-layer-safe** — changes only files the in-place update engine carries: the `kestrel_pi` package, `plugins/*.py`, systemd units, the journald drop-in, a lib script already in the engine's `LIB_SCRIPTS`, or the CLI. - [x] **Reflash-class** — touches a build input the engine does not carry onto a running device: apt or pip packages, boot options / `config.txt` / `cmdline`, kernel modules, the base image or partition size, `builder/config.json`, `builder/config.yml`, the `Makefile`, `.forgejo/workflows/`, a shipped config default (`config.toml` / `default.conf`), or a brand-new lib script. ## Notes for review - Nothing on the device changes; the Makefile and workflow edits make `auto` mark the next release reflash, which 1.0.11-beta.1 is anyway. - **Dry run on real history** (read-only, against the live release list and tags): 1.0.10 → `app-layer`; 1.0.9 → `app-layer` with `min_update_from: 1.0.9-beta.1` (1.0.8 → 1.0.9 changed the build, all of it in beta.1); 1.0.11 today → `reflash`, as no 1.0.11 beta exists yet. - **For 1.0.11:** the floor only holds if nothing in the build changes after the beta testers flash. A later `config.yml`, `config.json`, Makefile or workflow change moves the floor to the first beta after it. Forcing `update_kind` still overrides everything. - `test_gps_serial_reader_recovers_from_a_stalled_link` fails only on my machine (on `main` too) and passes in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Let beta testers update to a stable release in place
All checks were successful
Test / test (pull_request) Successful in 23s
Lint / lint (pull_request) Successful in 34s
Test / test (push) Successful in 21s
Lint / lint (push) Successful in 32s
73ce9bb9ef
When a stable release needs a reflash from the previous stable one, also
diff it against the betas of its cycle and, if nothing in the build changed
after one of them, mark it app-layer with min_update_from set to that beta.
Move the manifest logic into .forgejo/update_manifest.py with tests, read
every page of the release list, and name the floor in the release notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch feature/min-update-from 2026-10-31 05:39:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aluminum-ice/kestrel!117
No description provided.