Files
computer-playbook/scripts/tests/deploy/utils/filesystem/report.sh
T
kevinveenbirkenbachandClaude Opus 5 b7c28e5b5c feat(ci): warn when a job applied the requested filesystem nowhere
A job whose nodes all declined the filesystem tested none of it, and the table
row saying so reads like an ordinary result. That is how the debian arm lost its
zfs coverage without anyone noticing: docker_dataroot.sh exists to exercise the
snapshot mode of svc-bkp-volume-2-local, which engages only on btrfs and zfs,
and on that arm it has been engaging on neither.

The summary now carries an explicit warning when no node applied the requested
filesystem and at least one declined it. Partial coverage is coverage and stays
unflagged; a job with no verdicts at all still exits early.

Deliberately a finding, not a failure. Stating a filesystem instead of `auto`
would set REQUIRED=true in resolve.sh and turn a decline into a hard error, but
that would paint the debian arm red for a cause that is understood and not yet
fixed - the node image has no zfsutils candidate without the package cache. The
goal was never to enforce the pick, only to stop losing it silently.

Exercised against three real job logs from run 30781723102: the debian arm
(5 nodes, all declined) produces the warning; the ubuntu arm (10 nodes, zfs
applied) and an ext4 job do not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-03 18:00:43 +02:00

43 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Lift the per-node data-root verdicts out of a deploy log into the job summary.
#
# Arguments:
# $1 LOG deploy log to read; a missing log is not an error
set -euo pipefail
LOG="${1:?usage: report.sh LOG}"
PATTERN='status=[a-z-]+ requested=[a-z0-9]+ effective=[A-Za-z0-9_./-]+'
REASON_PATTERN="${PATTERN} reason=[^']*"
[ -f "${LOG}" ] || exit 0
[ -n "${GITHUB_STEP_SUMMARY:-}" ] || exit 0
if ! VERDICTS="$(grep -ohE "${PATTERN}" "${LOG}" | sort | uniq -c | sort -rn)"; then
exit 0
fi
[ -n "${VERDICTS}" ] || exit 0
REASONS="$(grep -ohE "${REASON_PATTERN}" "${LOG}" | sed -E 's/.* reason=//' | tr '|' '/' | sort -u)" ||
REASONS=""
APPLIED="$(printf '%s\n' "${VERDICTS}" | grep -c 'status=applied')" || APPLIED=0
DECLINED="$(printf '%s\n' "${VERDICTS}" | grep -c 'status=declined')" || DECLINED=0
LOST=""
if [ "${APPLIED}" -eq 0 ] && [ "${DECLINED}" -gt 0 ]; then
LOST="$(printf '%s\n' "${VERDICTS}" | sed -E 's/.*requested=([a-z0-9]+).*/\1/' | sort -u | paste -sd' ')"
fi
{
echo "#### Docker data root, as actually used"
echo
echo "| Nodes | Effective | Requested | Status |"
echo "|---:|---|---|---|"
# shellcheck disable=SC2016
echo "${VERDICTS}" | sed -E \
's/^ *([0-9]+) status=([a-z-]+) requested=([a-z0-9]+) effective=(.+)$/| \1 | `\4` | `\3` | \2 |/'
echo
# shellcheck disable=SC2016
[ -z "${LOST}" ] || printf '> [!WARNING]\n> No node applied `%s`; this job exercised none of it.\n\n' "${LOST}"
[ -z "${REASONS}" ] || printf '%s\n\n' "$(echo "${REASONS}" | sed -E 's/^/- /')"
} >>"${GITHUB_STEP_SUMMARY}"