hub-db-backup: parse the snapshot time in a form BusyBox date reads (CI red since ab2b304: 9/15 on the Alpine runner)
gates / gates (push) Successful in 1m46s
gates / gates (push) Successful in 1m46s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
### CI fix red-proof: the previous ISO date form, BusyBox-only PATH (the Alpine runner's tools)
|
||||
AssertionError: 'integrity_check' not found in "date: invalid date '2026-10-05T15:18:27Z'\nfelhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:27Z\n"
|
||||
felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:27Z
|
||||
AssertionError: 'stopped snapshotting' not found in "date: invalid date '2026-10-04T12:28:28Z'\nfelhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-04T12:28:28Z\n"
|
||||
AssertionError: "bytes, the pod's file is" not found in "date: invalid date '2026-10-05T15:18:28Z'\nfelhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z\n"
|
||||
felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z
|
||||
felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z
|
||||
felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z
|
||||
felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z
|
||||
Ran 15 tests in 0.781s
|
||||
FAILED (failures=9)
|
||||
### the fix, BusyBox-only PATH
|
||||
Ran 15 tests in 3.328s
|
||||
OK
|
||||
### the fix, normal GNU PATH
|
||||
Ran 15 tests in 2.555s
|
||||
OK
|
||||
@@ -1,3 +1,12 @@
|
||||
## hub-db-backup — the snapshot time is read the BusyBox way too (2026-10-05, CI fix)
|
||||
|
||||
The new `script-tests` gate ran `test_hub_db_backup.py` on the CI runner (Alpine, BusyBox `date`) for the first time,
|
||||
and 9 of 15 failed: BusyBox `date -d` rejects `2026-10-05T12:30:37Z`. The push script now parses
|
||||
`YYYY-MM-DD hh:mm:ss` with `-u`, which GNU and BusyBox both read. Red-proof with a BusyBox-only PATH: the old form → the
|
||||
same 9 failures; the fix → 15/15 (and 15/15 on GNU) — `documentation/audits/burndown-2026-10-05/ci-busybox-fix.txt`.
|
||||
The copy installed on DooPlex (`/usr/local/sbin/felhom-hub-db-backup`) is the previous revision; on DooPlex's GNU
|
||||
`date` both behave the same, so it was not reinstalled (DooPlex: no change this session).
|
||||
|
||||
## build + gates — no `:latest`; the gate list pinned; duplicate closed ids refused (2026-10-05, burn-down)
|
||||
|
||||
- **R-345:** `build-hub.sh` no longer tags or pushes `felhom-hub:latest` (`--push`, `--multiarch`, local); nothing
|
||||
|
||||
@@ -29,8 +29,9 @@ SNAP=$(kubectl -n felhom-system exec deploy/hub -- sh -c 'ls -1 /data/snapshots/
|
||||
NAME=${SNAP##*/}
|
||||
STAMP=${NAME#hub-}; STAMP=${STAMP%.db} # 20261005T020000Z
|
||||
case "$STAMP" in [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]T[0-9][0-9][0-9][0-9][0-9][0-9]Z) ;; *) die "unexpected snapshot name $NAME" ;; esac
|
||||
ISO=$(echo "$STAMP" | sed -E 's/^(....)(..)(..)T(..)(..)(..)Z$/\1-\2-\3T\4:\5:\6Z/')
|
||||
SNAP_EPOCH=$(date -u -d "$ISO" +%s) || die "cannot parse snapshot time $ISO"
|
||||
# "YYYY-MM-DD hh:mm:ss" with -u: the one form both GNU date and BusyBox date (the CI runner, Alpine) read.
|
||||
WHEN=$(echo "$STAMP" | sed -E 's/^(....)(..)(..)T(..)(..)(..)Z$/\1-\2-\3 \4:\5:\6/')
|
||||
SNAP_EPOCH=$(date -u -d "$WHEN" +%s) || die "cannot parse snapshot time $WHEN (UTC)"
|
||||
AGE=$((NOW - SNAP_EPOCH))
|
||||
[ "$AGE" -le $((MAX_AGE_H * 3600)) ] || die "newest snapshot $NAME is $((AGE / 3600)) h old (limit ${MAX_AGE_H} h) — the hub stopped snapshotting"
|
||||
log "snapshot $NAME, $((AGE / 60)) min old"
|
||||
|
||||
Reference in New Issue
Block a user