generated from eblume/project-template
1.2 KiB
1.2 KiB
| title | modified | tags | requires | |
|---|---|---|---|---|
| Release poll + version check | 2026-06-04 |
|
Release poll + version check
The piece that answers "is a newer release available?" — independent of any daemon wiring, so it can be unit-tested in isolation.
Deliverables
- Fetch the latest release from the forge:
GET https://forge.ops.eblu.me/api/v1/repos/eblume/hephaestus/releases/latest, readtag_name(e.g.v1.0.4). hephd already depends onureqandreqwest(crates/hephd/Cargo.toml) — reuse one (the poll loop is async, soreqwestfits;ureqwould needspawn_blocking). - Parse the running version:
heph_core::VERSIONis"1.0.3 (sha)"— take theX.Y.Zhead. Addsemver = "1"tocrates/hephd/Cargo.toml(already in the lockfile transitively) and comparetag_name(strip leadingv) against it. - A pure
is_newer(current, tag) -> boolhelper with tests covering equal / older / newer / malformed tags.
Done when
Given a fixed current version and a sample releases-API JSON body, the helper correctly reports whether an update exists. No daemon loop yet — that's self-update-poll-loop. Part of hephd-self-update.