Round B wires the already-complete SupportsTimezoneConfig / ChangePassword /
FactoryReset backends to the toolkit. Part 1 adds the committed CLI surface
(GUI dialogs follow in part 2):
- `timezone <ip> [<IANA>]` - read (no arg) or set the timezone (gated on
supports_timezone_config: Braiins/VNish/ePIC).
- `passwd <ip> <newpass>` - change the web/API password (gated).
- `factoryreset <ip>` - factory reset (gated).
Each is capability-gated and the usage banner marks passwd/factoryreset DANGEROUS.
Verified live: timezone set/read/restore end-to-end on Braiins 10.4.1.83
(set America/Edmonton -> read back -> restore Etc/GMT, all Ok). change-password
and factory-reset are implemented + gated but NOT live-run: both are destructive
on the shared corpus (change-password breaks the default auth every other test
relies on; factory-reset can reset a unit to DHCP and lose its IP) -- they need a
dedicated sacrificial/console-attached unit to verify live.
Also: ci/compute-version.sh now treats crates/alkane-gui/src/bin/* as a UI change
so CLI-tool changes trigger a release.
Note: the VNish timezone READ errors ("Unrecognised VNish timezone GMT, expected
GMT+N/-N") is a pre-existing vnish backend parse quirk, separate from this wiring.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
64 lines
2.3 KiB
Bash
Executable File
64 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Compute the next release version for alkane-toolkit from the latest release
|
|
# tag and the paths changed since it. Version scheme X.Y.Z:
|
|
# X - major, bumped manually (ci/version-x.txt); a bump resets Y.Z to 0.0
|
|
# Y - backend-logic changes (core/discovery/access/flash/artifacts/cli,
|
|
# scan+model+main in the GUI crate, build/CI config); resets Z to 0
|
|
# Z - UI changes (the GUI view + fixtures + the wx-rs widget bridge)
|
|
# When both backend and UI changed, backend wins (bump Y). Docs-only changes
|
|
# produce no release.
|
|
#
|
|
# Emits KEY=VALUE lines on stdout (suitable for $GITHUB_OUTPUT):
|
|
# version, tag, bump, release (true/false), last_tag
|
|
set -euo pipefail
|
|
|
|
x_file="ci/version-x.txt"
|
|
X=0
|
|
[ -f "$x_file" ] && X=$(tr -dc '0-9' < "$x_file")
|
|
X=${X:-0}
|
|
|
|
last=$(git tag -l 'v*.*.*' | sort -V | tail -1 || true)
|
|
if [ -n "$last" ]; then
|
|
v=${last#v}; lx=${v%%.*}; rest=${v#*.}; ly=${rest%%.*}; lz=${rest##*.}
|
|
changed=$(git diff --name-only "$last"..HEAD)
|
|
else
|
|
lx=0; ly=0; lz=0
|
|
changed=$(git ls-files)
|
|
fi
|
|
|
|
ui=false; backend=false
|
|
while IFS= read -r f; do
|
|
[ -z "$f" ] && continue
|
|
case "$f" in
|
|
crates/alkane-gui/src/ui.rs|crates/alkane-gui/src/fixtures.rs|thirdparty/wx-rs/*|\
|
|
crates/alkane-gui/src/bin/*)
|
|
ui=true ;;
|
|
crates/alkane-core/*|crates/alkane-discovery/*|crates/alkane-access/*|\
|
|
crates/alkane-flash/*|crates/alkane-artifacts/*|crates/alkane-cli/*|\
|
|
crates/alkane-gui/src/scan.rs|crates/alkane-gui/src/model.rs|\
|
|
crates/alkane-gui/src/main.rs|Cargo.toml|Cargo.lock|.gitea/*|ci/*|scripts/*|\
|
|
vendor/*|thirdparty/asic-rs/*)
|
|
backend=true ;;
|
|
*) : ;; # docs, HANDOFF, README, thirdparty/wxwidgets tree: no bump
|
|
esac
|
|
done <<< "$changed"
|
|
|
|
if [ -z "$last" ]; then
|
|
# First release: X.1.0 (or X.0.0 if X was pre-bumped above 0).
|
|
nx=$X; if [ "$X" -gt 0 ]; then ny=0; else ny=1; fi; nz=0; bump=initial; release=true
|
|
elif [ "$X" -gt "$lx" ]; then
|
|
nx=$X; ny=0; nz=0; bump=major; release=true
|
|
elif [ "$backend" = true ]; then
|
|
nx=$lx; ny=$((ly + 1)); nz=0; bump=backend; release=true
|
|
elif [ "$ui" = true ]; then
|
|
nx=$lx; ny=$ly; nz=$((lz + 1)); bump=ui; release=true
|
|
else
|
|
nx=$lx; ny=$ly; nz=$lz; bump=none; release=false
|
|
fi
|
|
|
|
echo "version=${nx}.${ny}.${nz}"
|
|
echo "tag=v${nx}.${ny}.${nz}"
|
|
echo "bump=${bump}"
|
|
echo "release=${release}"
|
|
echo "last_tag=${last:-none}"
|