Nothing runs weblib-ci's own tests #9
Reference in New Issue
Block a user
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?
weblib-ci has no
.gitea/workflowsat all, so nothing here is ever run bythe runner. That was harmless while the repo held three scripts that were only
executed by other repos' jobs; #8 adds
test_report_job_log.py, 21 tests thatcurrently only run if someone remembers to run them by hand.
The failure mode is quiet and specific: a broken
report_job_log.pyonmainis consumed immediately by cfbypass, weblib-archive, weblib-fs and
weblib-viewer, and the thing it breaks is the mechanism those repos use to
report breakage. A reporter that crashes reports nothing, so the symptom is
four repos going silent rather than four repos going red.
What makes it non-obvious
with-nixpkgs.sh— the pinning wrapper this org uses to getpython3on arunner that has none — reads the consuming repo's
flake.lockrelative tothe working directory. weblib-ci has no
flake.lock, so it cannot pinagainst itself, and a workflow here would have to fall back to
nix shell nixpkgs#python3, which re-resolves the registry and refetches achannel tarball whenever the branch moves. That is the exact cost
with-nixpkgs.shexists to avoid, which is why this is worth a decision ratherthan a quick commit:
flake.lock(and theflake.nixto justify it) purely so therepo can pin its own tooling — the README currently says, deliberately, that
this repo has no flake; or
nix shell nixpkgs#python3for a suite that takes 1.2sand imports nothing outside the standard library; or
with-nixpkgs.sha documented fallback when noflake.lockis found,which would also cover any future consumer in the same position.
Whichever way it goes, the workflow needs
runs-on: nixand, for the reporterto comment on failures, the
if: failure()step the other four already carry.Priority/Mediumrather thanPriority/Low, on this issue's own argument: the thing an unrun change breaks is the mechanism the other four repos use to report breakage, so the symptom is four repos going quiet rather than four repos going red. That is worth more than a low.Count correction: the suite is 22 tests, not 21 — the cold re-read of #10 added one for a backtick escaping its code span in the verbatim-status path.
Which of the three options do you recommend?
The third, but not quite as this issue words it — and the reason is something I only saw after re-reading
with-nixpkgs.shrather than my own summary of it.What the script actually needs
It never evaluates a flake. The whole of its use of
flake.lockis one string:and then
nix shell github:nixos/nixpkgs/${rev}#${attr}. So option 1 would add aflake.nixthat builds nothing, and aflake.lockto maintain, in order to hold a single 40-character rev — and it would contradict the README's deliberate "they are run, not built, so this repo has no flake". That is a lot of structure for one string.Verified the rev is genuinely all it takes:
Why not option 2
It pays exactly the cost this script exists to avoid, in the repo that owns the script. The README warns against
nix shell nixpkgs#python3and the job log caught it unpacking a channel tarball; weblib-ci's own workflow would then be the one place demonstrating the anti-pattern the repo documents.There is a second reason I did not know until measuring just now. A registry reference does not resolve the same way everywhere. On this workstation:
— a pinned system entry, and a different nixpkgs from the
56c02bcthe repos' locks use. Sonix shell nixpkgs#python3means one nixpkgs on the runner and a different, frozen one here, with nothing saying so. That is the same trapCLAUDE.mdrecords fornix develop cfbypasssilently running old code. For a suite meant to gate a shared script, "works here, different there" is the wrong property to design in.Option 3, with one change to what the fallback is
As worded, the fallback is "when no
flake.lockis found" — but if the fallback then degrades to the registry, it is option 2 wrapped in a function: same cost, now centralised and harder to notice. The fallback should still pin:./flake.lockpresent → today's behaviour, byte-identical for all four consumers../nixpkgs-pinpresent (one line, a rev) → use that rev.Step 3 is the load-bearing one. A shared tool that silently degrades is how the channel-refetch cost comes back without anyone seeing it; better to refuse and say so.
weblib-ci then commits a one-line
nixpkgs-pin, stays flake-free, and any future consumer in the same position is covered — which is the part of option 3 that made it attractive to begin with.The cost, stated plainly
A
nixpkgs-pinfile has nonix flake update. Aflake.lockcan be refreshed by a standard command; a bare rev is bumped by hand and will go stale. I think that is acceptable here and not elsewhere: the pin exists to run a stdlib-only suite in 1.2 s, so a stale nixpkgs costs an older CPython and nothing else, and the suite would notice a genuinely broken interpreter immediately. If you would rather not carry a hand-bumped pin at all, that is the honest argument for option 1 and I would not object to it — it buysnix flake updateat the price of a flake that builds nothing.If you take this
It is a change to a script four repos consume, so it wants the same treatment #10 just got: prove the existing call shape is byte-for-byte unchanged for a caller that has a
flake.lock, rather than assuming an addedelifis inert. That check is what made #10 safe to land and it is cheap to repeat.Sequencing: #10 is still open and touches this repo, so this should follow it rather than race it.