generated from OpsDeck/module_template
Follow-ups from PR #1 review: pin the simulation's locale, and correct the Error-Mode=any rationale #2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Both items are from the approving review on #1 (review), explicitly not merge blockers. Filed so they are not lost.
1. The locale pin skips the simulation — the one apt run whose output feeds every number on the page
backend/apt.ts:195-196states that "everyapt-getthis module runs is pinned toLC_ALL=C.UTF-8(seeapt()in mod.ts)". That is not true ofloadPackagesin backend/state.ts:103, which callsdeps.host.run("apt-get", ["-s", ...])directly and so inherits whatever locale the OpsDeck process runs under.Measured on the rig with the server started under
LC_ALL=de_DE.UTF-8and a broken sources file:Two consequences:
statusTextis the module's only user-facing error string, and it currently depends on the server's environment.parseSimulationsurvives today only because apt does not translateInst/Conf— verified, 42Instlines under bothC.UTF-8andde_DE.UTF-8. That is luck, and it is exactly the assumption the refresh scanner (parseRefreshFailures) was just written to stop relying on.Fix:
and widen the
apt.tscomment to "everyapt-getwhose output is parsed", so it is true of both parsers. (uname -rat backend/state.ts:146 is in the same position but its output is not locale-dependent in any way that matters.)2.
APT::Update::Error-Mode=anydoes not promote warnings — the comment says it doesThe comment at backend/apt.ts:183 justifies scanning apt's output instead of using the option on the grounds that it "promotes any WARNING to a failure, so a duplicated-source or deprecated-key warning would fail an otherwise complete refresh". Measured, including in the rootfs whose warnings the argument rests on:
Error-Mode=anyW: GPG error+E: gpgv … requiredW: Target Packages … configured multiple times)Signed-By: /dev/nullkeyring warningIt promotes acquire failures and nothing else that reproduces. The premise is right — a healthy refresh on that rootfs really does print warnings — but the conclusion drawn from it does not hold, and it is now recorded in the code as fact.
The scanner stays either way: it names the failing sources, which is what makes the notification worth reading, and it is testable in a way an apt option is not. Two changes: