fix(ci): make a push to main the only buildcache writer #25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/one-buildcache-writer"
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?
Closes #18, which had sat open for a week. I missed it, which is on me: it was filed on
2026-08-26 with the decision explicitly left to me and I did not see it until listing open
issues today.
The decision
#18 offered two shapes. Taking the narrower one: guard the export on the event as well as
the ref.
GITHUB_REFdoes not identify a trigger.refs/heads/mainreads as "the main build", andscheduleandworkflow_dispatchcarry the same ref, so the ref-only guard admitted threewriters rather than one. Task
16519is the cron doing exactly that on 2026-08-25.Against the top-level
concurrency:alternative:cargoincluded, on a runner that is already shared andqueueing, to solve a problem one condition closes.
concurrency:is silently ignored on this Forgejo (jlxq0/mantis#32): theblock parses, nothing warns, and it does nothing. A workflow-level block is therefore one
well-intentioned refactor away from being inert while still looking present, which is the
same shape as a required status that can only be green.
mainjust built, so its cache would be byte-identical and it loses nothing by importingonly. A cron and a dispatch run on
mainare the same case. Extending the existingargument beats adding a second mechanism beside it.
The cost #18 names is real and accepted: the cron no longer refreshes the cache. It was
refreshing it with a byte-identical export of a commit
mainhad already built.Verified by exercising the condition, not by reading it
The first row is the control. Without it, "the export stopped happening" is
indistinguishable from "the export was disabled", and the four
norows alone aresatisfied by a guard that never exports at all.
Acceptance after merge
A condition table is a statement about the shell, not about the runner. The observable
consequence is the buildcache ref's own digest:
D0 = sha256:0592aacd0bbecb…, recorded before this branch existed.main, so itsdockerjob must export and the digestmust move. That is the control, and it proves the export still works.
workflow_dispatchrun, after which the digest must be unchanged. That isthe treatment.
I will post both digests on #18 before closing it. A treatment with no control would be
satisfied by an export that had silently broken for an unrelated reason.
Also
Pitfall recorded in
AGENTS.md, since the next person reading a ref-only guard will readit as naming one writer, exactly as this one did.