release 1.13.1: global progress done/total stable across phases

Phase summary no longer resets PROGRESS_TOTAL to local done (which made
bars like 34/34 then 38/47). Total is fixed at run start; only grows if
short; progress_finish snaps once at the end of the whole run.
This commit is contained in:
Hernâni Marques 2026-07-19 02:35:09 +02:00
parent 2931006e3c
commit 74e76aff2c
No known key found for this signature in database
GPG key ID: CB5738652768F7E9
5 changed files with 70 additions and 23 deletions

View file

@ -395,28 +395,34 @@ if [ "${#PHASES[@]}" -eq 0 ]; then
PHASES=(urls)
fi
# Rough expected check counts for progress % (override: PROGRESS_TOTAL=N).
# Prefer slightly high — lib.sh rebalances if still short (never shows done>total).
# Global expected check count for progress bar done/total (override: PROGRESS_TOTAL=N).
# One estimate for the whole run — phase summary() must NOT reset this mid-run.
# Prefer slightly high; lib.sh only grows if short (never shrinks until progress_finish).
if [ "${PROGRESS_TOTAL:-0}" = "0" ] || [ -z "${PROGRESS_TOTAL:-}" ]; then
_pt=0
for p in "${PHASES[@]}"; do
case "$p" in
urls) _pt=$((_pt + 95)) ;; # +qr + webui SPA fingerprints
inside) _pt=$((_pt + 30)) ;;
versions) _pt=$((_pt + 25)) ;;
versions) _pt=$((_pt + 35)) ;; # + disk probes can be many
sanity) _pt=$((_pt + 35)) ;;
server) _pt=$((_pt + 20)) ;;
# e2e: ATM ladder emits many INFO lines (coins before/after each note)
e2e) _pt=$((_pt + 240)) ;;
ladder|goa-ladder) _pt=$((_pt + 120)) ;;
auth401) _pt=$((_pt + 70)) ;;
aptdeploy) _pt=$((_pt + 20)) ;;
surface|ecosystem) _pt=$((_pt + 80)) ;;
monpages|pages) _pt=$((_pt + 30)) ;;
aptdeploy) _pt=$((_pt + 40)) ;;
surface|ecosystem) _pt=$((_pt + 120)) ;;
monpages|pages) _pt=$((_pt + 20)) ;;
mattermost) _pt=$((_pt + 25)) ;;
mail) _pt=$((_pt + 40)) ;;
devtesting|franken|fake-franken|fake_franken) _pt=$((_pt + 12)) ;;
esac
done
# monpages post-check after htmlify can add another inventory pass
case " ${PHASES[*]} " in
*" monpages "*|*" pages "*) _pt=$((_pt + 12)) ;;
esac
set_progress_total "$_pt"
unset _pt
fi
@ -503,7 +509,8 @@ if [ "${RUN_TIMEOUT:-0}" -eq 0 ]; then
else
printf ' run_timeout %ss wall clock (RUN_TIMEOUT=; 0=unlimited)\n' "$RUN_TIMEOUT"
fi
printf ' progress total≈%s (set PROGRESS_TOTAL= to override; PROGRESS_OFF=1 to hide)\n' "${PROGRESS_TOTAL:-0}"
printf ' progress %s/%s (global done/total · set PROGRESS_TOTAL= to override; PROGRESS_OFF=1 to hide)\n' \
"${PROGRESS_DONE:-0}" "${PROGRESS_TOTAL:-0}"
unset _INSIDE_ACCESS_HINT
chmod +x "$ROOT"/check_*.sh 2>/dev/null || true
@ -573,4 +580,10 @@ if [ "$RUN_TIMED_OUT" = "1" ]; then
"$RUN_TIMEOUT" "$elapsed"
fi
# Snap progress bar to real global count (done/total) once for the whole run
if type progress_finish >/dev/null 2>&1; then
printf '\n'
progress_finish
fi
exit "$ec"