You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(export): make re-exports idempotent and stop over-deletion
Four related defects, all in how the export pipeline mutates the
template on a second run:
- installlogs_lines() inserted a fresh 'Links for update logs:' header
on every call; individual links were de-duplicated but the header was
not, so manual/kernel re-exports stacked empty duplicate sections. An
existing header is now reused, new links are appended after the
section's links, the trailing blank is only added when missing, and
empty duplicate headers stacked by pre-fix exports are dropped so a
damaged template converges (link-bearing duplicates are never
touched). A hand-trimmed section (header directly followed by the
footer) gets its canonical blank restored so links cannot land after
the footer.
- BaseExport.install_results() inserted the 'All installation tests
done in openQA' notice unconditionally; on kernel re-export the old
and new copies are separated by the inserted blank line, so the
notice multiplied with each run. It is now inserted only when absent,
and copies stacked by pre-fix exports are reduced back to one.
- AutoExport.install_results() bounded its section replacement with
list.index('## export MTUI:'), which requires the whole line to equal
the marker -- the real footer is '## export MTUI:<version> ...', so
the fallback always raised and end ran to len(template): the
replacement deleted the footer and anything appended after the
install-tests section. The footer is now located with a substring
scan, like the two other places that test for it.
- ManualExport.install_results()'s stale-result cleanup was dead: the
host-tracking regex required two spaces after 'reference host:' (the
template emits one) and read group(0), so no stale line was ever
removed. The pattern now captures the hostname, the host header line
is kept, and -- adversarial-review catch on the revived cleanup --
c_host resets at the host block's 'comment:' boundary (the same
convention the verdict loop uses), so the deletion window cannot
bleed past the last host section and eat tester-authored notes like
'reproducer : FAILED before update' from the regression-tests
section.
Each fix and each review amendment is revert-verified by
tests/test_export_idempotency.py (10 tests).
0 commit comments