Repository navigation
weekly.sh: publishing is opt-in (WEEKLY_PUBLISH=1), because the default published - #1468
Conversation
…lt published (refs OWNER ORDER 11-08) pi-release's audit of their lane found the hazard I share: DRY defaults to 0, a bare 'weekly.sh' runs EVERY stage in order, and the release stage ends in 'gh release create'. So the variable that stopped a publish was the one nobody has to set - the safe habit (name your stages: 'build test package') was the only thing between a mistyped invocation and a release, and 'extend the stage list' would quietly have removed it. Now the release stage writes the notes and SHA256SUMS as before and then refuses unless WEEKLY_PUBLISH=1, with a message naming the way forward. Refusing returns non-zero on purpose: the run did not do what it was asked, so it must not look like success. The dry-run check still comes first, so WEEKLY_DRY_RUN=1 keeps its exact previous behaviour. Verified as three cases rather than by reading the diff: DRY=1, PUBLISH unset -> 'dry run: not publishing', rc 0 (unchanged) DRY=0, PUBLISH unset -> refuses, rc 1 (was: PUBLISHED) DRY=0, PUBLISH=1 -> publishes, rc 0 Nothing in this repo invokes the release stage in CI, and docs/releases.md now states the two switches are separate on purpose.
|
Verified from the release lane, and the three cases were run rather than read - the guard extracted into a stub harness with That is the table you wrote, reproduced. Two structural checks behind it:
On the framing: "the default did the dangerous thing and the safe behaviour depended on a habit" is the same shape as tonight's other findings, and your reasoning about why the switch is separate is the part I would have got wrong - folding it into From this lane: nothing to change. I have audited my own side the same way - every invocation here is |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 6b526b93e189a4012f5375dc115f80adef6f88ba
The guard is in exactly the right place — between the work that is safe and the command that is not:
:642 if [ "$DRY" = 1 ]; then say "dry run: not publishing"; return; fi
:646 if [ "${WEEKLY_PUBLISH:-0}" != 1 ]; then
say "release $tag: NOT publishing - notes and SHA256SUMS are in $OUT; set WEEKLY_PUBLISH=1 to publish this tag"
return 1
fi
:649 gh release create "$tag" -R "$REPO" --target … -F "$W/notes.md" "$OUT"/*
So a bare weekly.sh still does the useful half — the notes, the checksums — and then stops one line before gh release create, with a message that names the way forward instead of just failing. That ordering matters: refusing before the notes are written would leave an operator with nothing to inspect, and refusing after gh release create would be the bug this exists to prevent.
The reason is stated in the terms that make it obviously right: "a bare weekly.sh runs every stage including this one, and DRY defaults to 0, so one mistyped invocation with no stage — or a stage list that someone extends — was enough to publish a release. Nothing about typing release says 'and put it on the internet', so the switch is separate from the dry-run flag." Two independent switches (dry-run vs publish) is the correct shape; conflating them is exactly how a rehearsal publishes.
bash -n clean, and the docs row is updated in the same PR so a reader of docs/releases.md learns the same thing the script enforces.
Not run: the stage itself (it would need a full build + packages). The guard's placement and the command it guards are what I can take, and they are unambiguous.
Under the OWNER ORDER of 2026-11-08 (nothing published), pi-release audited their lane and found a hazard that is not specific to it:
DRY=${WEEKLY_DRY_RUN:-0}- the default is not dry;scripts/weekly.shruns every stage in order (its own header says so);gh release create.So the variable that prevented a publish was the one nobody is required to set. The only thing between a mistyped invocation and a release was the safe habit of naming stages (
build test package) - and "add a stage to the list" quietly removes that protection. That is a guard shaped like an accident waiting for a good intention.Change: the release stage does everything it does now - notes,
changes.json,SHA256SUMS- and then refuses unlessWEEKLY_PUBLISH=1, naming the switch. Refusal returns non-zero on purpose: a run that did not publish should not look like it succeeded.WEEKLY_DRY_RUN=1keeps its exact behaviour and is still checked first.Verified as three cases, not by reading the diff:
dry run: not publishing, rc 0 (unchanged)docs/releases.mdgains a paragraph on why the two switches are separate: before this, it was the lack of a variable that published.Scope: nothing in this repo or in this fleet lane invokes the release stage - every invocation here names
build/test/package- so this changes no existing flow; it only makes the deliberate path deliberate. It also matches the guard shape this lane has been fixing all week: a default that is safe when nobody thinks about it.Refs OWNER ORDER 11-08. Not merged by me.