test(verify): fail a slot whose per-minor entries are mostly source fallbacks

A Path: target returning 200 is not the same as a per-minor binary
existing. Roughly 53% of steered entries are source fallbacks: they
resolve and install correctly, but they compile on the client, which is
not the binary service we advertise.

Entries without a Built: field are source fallbacks, so this is readable
straight from the index with no downloads.
This commit is contained in:
Patrick Schratz 2026-08-31 08:44:34 +00:00
commit 93d720a9e6
No known key found for this signature in database
GPG key ID: 62050D5BC68AB6DC

View file

@ -48,6 +48,11 @@ SAMPLE=${SAMPLE:-5}
# one R minor carries fewer per-minor binaries for the others; until that gap
# closes, "full coverage for ABI-sensitive packages" is not a claim we can make.
PARITY_TOLERANCE=${PARITY_TOLERANCE:-25}
# Largest share (percent) of per-minor entries that may be source fallbacks
# rather than binaries. A source fallback resolves with HTTP 200 and installs
# correctly, but it compiles on the client: routing to it is not the binary
# service we advertise. Entries without a `Built:` field are source fallbacks.
SOURCE_FALLBACK_TOLERANCE=${SOURCE_FALLBACK_TOLERANCE:-10}
LIVE=0
for arg in "$@"; do
@ -108,6 +113,19 @@ pkg_names() {
gunzip -c "$1" 2>/dev/null | awk '/^Package:/ {print $2}' | sort -u
}
# "<steered> <source-fallbacks>" for a per-minor index: how many entries carry a
# Path: field, and how many of those lack a Built: field (i.e. are sources).
fallback_counts() {
gunzip -c "$1" 2>/dev/null | awk '
/^Package:/ { pkg = $2; path = ""; built = "" }
/^Path:/ { path = $2 }
/^Built:/ { built = $2 }
/^$/ { if (pkg != "" && path != "") { n++; if (built == "") s++ } pkg = "" }
END { if (pkg != "" && path != "") { n++; if (built == "") s++ }
printf "%d %d\n", n, s }
'
}
# "<Package> <Path>" pairs for entries that carry a Path: field.
path_entries() {
gunzip -c "$1" 2>/dev/null | awk '
@ -176,6 +194,19 @@ for arch in $ARCHES; do
ok "$slot R $minor index: $minor_count packages, union holds"
fi
# A per-minor entry that is a source fallback resolves fine but makes the
# client compile. Routing to a slot that is mostly fallbacks does not
# deliver the binaries we advertise.
read -r steered fallbacks <<< "$(fallback_counts "$minor_file")"
if [ "${steered:-0}" -gt 0 ]; then
pct=$((fallbacks * 100 / steered))
if [ "$pct" -gt "$SOURCE_FALLBACK_TOLERANCE" ]; then
bad "$slot R $minor: $fallbacks/$steered per-minor entries are source fallbacks (${pct}%), not binaries"
else
ok "$slot R $minor: $((steered - fallbacks))/$steered per-minor entries are binaries"
fi
fi
# Path: entries steer to per-minor binaries; they must resolve.
if [ "$SAMPLE" -gt 0 ]; then
path_entries "$minor_file" > "$minor_file.paths"