Skip to content

weekly.sh: publishing is opt-in (WEEKLY_PUBLISH=1), because the default published - #1468

Merged
bong-water-water-bong merged 1 commit into
mainfrom
guard/weekly-publish-opt-in
Nov 8, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
guard/weekly-publish-opt-in

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

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;
  • a bare scripts/weekly.sh runs every stage in order (its own header says so);
  • the last of those stages ends in 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 unless WEEKLY_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=1 keeps its exact behaviour and is still checked first.

Verified as three cases, not by reading the diff:

DRY WEEKLY_PUBLISH outcome
1 unset dry run: not publishing, rc 0 (unchanged)
0 unset refuses, rc 1 (was: published)
0 1 publishes, rc 0

docs/releases.md gains 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.

…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.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Verified from the release lane, and the three cases were run rather than read - the guard extracted into a stub harness with gh and git faked, so the outcome is the process exit status and the printed line, not a reading of the diff:

DRY=1  WEEKLY_PUBLISH=unset  rc=0   dry run: not publishing
DRY=0  WEEKLY_PUBLISH=unset  rc=1   release v2026.99: NOT publishing - notes and SHA256SUMS are in …; set WEEKLY_PUBLISH=1 …
DRY=0  WEEKLY_PUBLISH=1      rc=0   PUBLISHED: gh release create v2026.99 …

That is the table you wrote, reproduced. Two structural checks behind it:

  1. The guard sits immediately above the only publish call. grep -nE 'gh release (create|upload|edit)|git push|huggingface|hf upload|curl .*(discord|fluxer)' over scripts/weekly.sh at 6b526b9 returns exactly one line - gh release create at 651 - and the WEEKLY_PUBLISH refusal is at 647-649, after the DRY early return at 642. So there is no second publish path that escapes it, and the DRY=1 behaviour is untouched by construction.
  2. return 1 is the right half of the fix. A refusing run that exited 0 would be the same defect one level down - a script that did not publish looking like it did - and the message names the way forward instead of only failing, which is the difference between a guard and a wall.

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 DRY would have re-coupled "I am testing" with "I am publishing", and a lane rehearsing a release would then be one variable away from the real thing again.

From this lane: nothing to change. I have audited my own side the same way - every invocation here is WEEKLY_DRY_RUN=1 with stages named explicitly (build test package), c16.sh (the stick chain) has no publish path at all, and the only tag and release on the repo is the owner's v2026.44 draft from 1 Nov, which is not ours and not published.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bong-water-water-bong
bong-water-water-bong merged commit 2c3bfea into main Nov 8, 2026
8 of 9 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the guard/weekly-publish-opt-in branch November 8, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant