Show the device's release version on the dashboard #123

Merged
aluminum-ice merged 1 commit from fix/show-release-version into main 2026-10-31 07:31:42 +00:00
Owner

What this PR does

Makes the dashboard show the device's release version. Before, it showed "plugin host · v0.3.0" on every release.

The header and /status.json's version came from kestrel_pi.__version__, a hard-coded "0.3.0" that nothing updates. (The Release workflow syncs pyproject.toml to the release for the image and PyPI, but not that string, and an in-place update reinstalls the package from the tagged commit, where pyproject.toml still holds its dev value.)

  • kestrel_pi.device_version() reads /etc/kestrel/version (VERSION_FILE, patchable as the eink-ws27 info screen's already is). The image build stamps that file and every in-place update rewrites it. It's a read-only device fact, in core like webtls.fingerprint().
  • The daemon: /status.json version is that release version (falling back to the package version off a device), with a new package_version beside it. The start-up log line names both.
  • The dashboard header: reads v1.0.11-beta.2 for a release and dev build (master) for a build with no release version.
  • kestrel_pi.__version__: now comes from the installed package's metadata (importlib.metadata), so it's the release on an imaged device, with 0.0.0+dev for a source checkout that was never installed.
  • Ghost-guide fixture: points VERSION_FILE at the tag it renders, so guide screenshots show the documented release. Older releases without VERSION_FILE render as before.
  • Tests: device_version(), the status fields, and the header for a release and a dev build.

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

  • For 1.0.11-beta.2, beside #120, #121 and #122.
  • Readers of version: the dashboard header, and the beta-check and diagnostics scripts, which only print it. The updates plugin reads /etc/kestrel/version itself, unchanged.
  • make lint is clean; 1460 tests pass (the GPS stalled-link test fails only on my machine, on main too); the ghost-guide tests pass.

🤖 Generated with Claude Code

## What this PR does Makes the dashboard show the device's release version. Before, it showed "plugin host · v0.3.0" on every release. The header and `/status.json`'s `version` came from `kestrel_pi.__version__`, a hard-coded `"0.3.0"` that nothing updates. (The Release workflow syncs `pyproject.toml` to the release for the image and PyPI, but not that string, and an in-place update reinstalls the package from the tagged commit, where `pyproject.toml` still holds its dev value.) - **`kestrel_pi.device_version()`** reads `/etc/kestrel/version` (`VERSION_FILE`, patchable as the `eink-ws27` info screen's already is). The image build stamps that file and every in-place update rewrites it. It's a read-only device fact, in core like `webtls.fingerprint()`. - **The daemon:** `/status.json` `version` is that release version (falling back to the package version off a device), with a new `package_version` beside it. The start-up log line names both. - **The dashboard header:** reads `v1.0.11-beta.2` for a release and `dev build (master)` for a build with no release version. - **`kestrel_pi.__version__`:** now comes from the installed package's metadata (`importlib.metadata`), so it's the release on an imaged device, with `0.0.0+dev` for a source checkout that was never installed. - **Ghost-guide fixture:** points `VERSION_FILE` at the tag it renders, so guide screenshots show the documented release. Older releases without `VERSION_FILE` render as before. - **Tests:** `device_version()`, the status fields, and the header for a release and a dev build. ## 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 - [x] **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 - For 1.0.11-beta.2, beside #120, #121 and #122. - **Readers of `version`:** the dashboard header, and the beta-check and diagnostics scripts, which only print it. The `updates` plugin reads `/etc/kestrel/version` itself, unchanged. - `make lint` is clean; 1460 tests pass (the GPS stalled-link test fails only on my machine, on `main` too); the ghost-guide tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Show the device's release version on the dashboard
All checks were successful
Test / test (push) Successful in 28s
Lint / lint (push) Successful in 33s
Test / test (pull_request) Successful in 24s
Lint / lint (pull_request) Successful in 32s
d2ba4b08d6
The dashboard header and /status.json reported kestrel_pi.__version__, a
hard-coded 0.3.0 never updated at release. Report the device's release
version from /etc/kestrel/version instead (stamped by the build and by
in-place updates), with the package version beside it, read from the
installed package's metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch fix/show-release-version 2026-10-31 07:31:42 +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!123
No description provided.