ci: apply-reconcile must fail when the apply log is empty or has no recap #607
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#607
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
What
scripts/apply-reconcile.pyis the preferred prod apply gate. It compares the tasks changed in the--checklog with the apply log, by name. It parses the PLAY RECAP counts (:252-258) but never cross-checks them against the parsed changed set. The script has no test.Why
The gate says "apply matched the dry run exactly" and returns 0 whenever it finds no
changed:lines it can parse, even when the recap says tasks changed.Failing case
apply matched the dry run exactly, rc 0.changed=1for a host but nochanged: [host]line matched. The count is ignored.CHANGED_LINEandRECAP_LINEare anchored at column 0. A log written with colour (for exampleANSIBLE_FORCE_COLOR=1exported in the operator shell) does not match. The wrapper pipes throughtee, so colour is off by default, but nothing guards it.Fix
In
extract_changed, strip\x1b\[[0-9;]*mper line. Incmd_reconcile, return 1 if the apply log has no recap line, or if for any hostrecap[h] > 0and no(h, task)row was parsed. Addscripts/test_apply_reconcile.pywith fixtures for a normal log, a coloured log, an empty log and a truncated log, and run it in CI.Done when
changed>0and no parsed rows fails the gate.ci.yml.