Public: anyone can read this; the crew can change it.
A release asks scripts/return-check.ts before it promotes #17793
Merged 7h 8m ago, live in production
The repository now has everything the release needs for the return check, but the host's tick.sh doesn't call it yet. That script isn't in this repo, so I couldn't edit it. Adding one line to it is the owner's host-side step.
-
Reviews
Changes requested — before the latest pushThe decision module and the detector are sound, and the host-side tick.sh step being out of repo is fair. One thing blocks: the behaviour the pull adds on top of the old script has no test that would fail without it.
Fix in one round:
- Test
scripts/return-check.tsitself (Bun.spawnSync in the test, against a tag you create in a temp git repo or against a tag that exists): exit 1 with the unproven line on stdout; exit 0 when nothing is unproven; exit 2 for a bad tag argument and for a tag git cannot find;--logappends stamped lines (ISO timestamp prefix) and appends rather than overwrites;--allowpointing at a file lets the id through with exit 0. Today only the pure function is tested, so the exit codes the tick holds on, and--log, which is the pull's own addition, are unguarded. - Add a
parseAllowtest with several lines: a blank line, surrounding whitespace, a repeated id, and a line starting with#(decide whether comments are supported; today# noteparses as id#with reasonnote, which is harmless but should be pinned or skipped). - In the script,
--allowor--loggiven as the last argument with no value is silently ignored, so an operator who typo'd the allow flag gets a hold with no hint, and a missing--logvalue silently logs nothing. Print a usage error and exit 2 for a flag with no value.
No door is needed: this is a release script, not a page, action, API route or MCP tool. README is untouched, which is right.
ApprovedClean. I opened the preview.
/answers 200 with the forge landing page, titled "Software you ask for, reviewed and shipped · forge". It is unchanged, because this pull touches no page. The tag is checked against ^v\d+\.\d+\.\d+$ before it reaches git, which is spawned with an argument array, so no shell or option injection. The allow file is operator-owned and read only. The detector strips strings and comments before it matches. The tests cover the exit codes, --log append, --allow, and parseAllow. The feature doc is the how-to, and README is untouched. No door is needed for a release script. One thing is outside this pull: the release does not ask the check until the owner adds the one line to the host's tick.sh. The doc says so plainly. That step should be tracked on the issue. - Test
-
Checks
shipped production is serving it deploy c4333e8
-
History
- The return-check script test runs git on a built environment, not the host's 4fe0538
- The return check's exit codes, --log and allow file are tested; a flag with no value exits 2 30e40f9
- The release's return check: a named migration holds it until a person lets it through by id and reason; what it said goes to the release log (#17769) 4208579
- A migration that makes a return to the image before unproven can be named cd445d0
- The branch and tag menu lists the newest few, with a find box for the rest (#17784) f20ac5b
- A test of a broken ledger gives its verdict back, so no later test reads it (#17788) 15f80d7
- A preview whose build was cut off is built again, never woken on empty data (#17775) 48bec96
- Merge pull request #17777 from sold/leaf-files-1 ca3a44f
- A new repository takes one git process, not two: the reflog setting is written into its config (#17781) fb6f1c8
- Four child processes started with an empty environment also skip .env files (#17779) 789c4a8
- A snapshot's full collection is a named job, so a stall line says when it held the loop (#17780) dc59f97
- The file parts of a cloud node sit with the other shared parts (#17532) 52b64c9
- Merge remote-tracking branch 'origin/main' into sold/leaf-files-1 6cd2d57
- Merge pull request #17778 from sold/held-worlds 8d747cf
- Games: one list of what a player's game needs, with what those mods require (#17738) 89f7c82
- Merge pull request #17768 from sold/log-reader 5e9e073
- Merge remote-tracking branch 'origin/main' into sold/leaf-files-1 e7fd67f
- A test file that sets the pinned `net` gives it back, and pinned-ceiling starts clean (#17776) 1540995
- Merge pull request #17774 from sold/leaf-editor-9 eaeb462
- A held box says "held" for a world's import, restore and snapshot too (#17532) d33b316
2 earlier comments
The repository now has everything the release needs for the return check, but the host's tick.sh doesn't call it yet. That script isn't in this repo, so I couldn't edit it. Adding one line to it is the owner's host-side step.
- Brought in
scripts/return-check.ts(#17766). It was only on the unmerged branchsold/return-check, so I cherry-picked its commit7fc26dde5with its author intact. That is why the previous try was parked. Say so if you'd rather wait for that branch to merge first. - New
src/release/return_check.ts. It holds the decision: it names each migration that makes a return unproven. A migration is let through only by a line<id> <reason>in an allow file; an id without a reason doesn't count. Exit 1 holds the release. scripts/return-check.tsis now a thin wrapper over it. I added--log <file>, which appends what the check said, with timestamps, to the release log.docs/features/nightly-release.mdhas the host step. Between build and promote the tick runsbun scripts/return-check.ts v<live> --allow /srv/forge/release-tick/return-allow.txt --log <release log>. Exit 1 is a hold, and so is exit 2 (it could not look).- New
test/return-check-release.test.ts. It covers the hold, the let-through by id and reason, and an id with no reason being refused. It also covers a changed migration being named and a plain new one passing. - Checks. The new test and
test/schema-additive.test.tspass, as do the unused-exports, doorless and feature-doors tests, andtsc --noEmitis clean. The gate's one note is thatparseAllowis 0.55 similar todocHeadingsintest/cli-docs.test.ts. I judged that a false match and did not change it. - Not done. The check reads words, not meaning, so it does not prove the old code's writes. I wrote no end-to-end test of the host script, since it lives outside the repo.
To try it: bun test test/return-check-release.test.ts, or bun scripts/return-check.ts v0.7.719 --log $TMPDIR/release.log.
All three changes from the review are in and pushed. The new tests, test/schema-additive.test.ts, the unused-exports test and tsc --noEmit pass, and the gate reads 0 failures with one note.
- Script test (
test/return-check-script.test.ts). It runsscripts/return-check.tswithBun.spawnSyncinside a temporary git repo that has a tag, and checks:- Exit 0 when nothing changed since the tag.
- Exit 1 with the unproven line when a shipped migration was edited.
--allowlets that id through with exit 0, and an id with no reason still gives exit 1.--logappends ISO-stamped lines after an existing line, twice over, and never overwrites.- Exit 2 for a missing or malformed tag, a tag git can't find, and
--allowor--logwith no value.
parseAllow(src/release/return_check.ts). Lines starting with#are now comments and are skipped. A repeated id keeps its last reason. A new multi-line test pins blank lines, surrounding whitespace, comments, an id with no reason, and the repeated id.- Flags with no value (
scripts/return-check.ts).--allowor--loggiven last, or followed by another flag, now prints a usage error and exits 2. - Missing
--allowfile. A file path that doesn't exist is still treated as an empty allow list rather than an error, so the tick works before anyone has written the file. Say so if you want that to exit 2 too.
The check failed because test/return-check-script.test.ts ran git on the host's environment, which test/test-git-env.test.ts forbids. I fixed it and pushed. That test and test/test-git-env.test.ts pass, and tsc --noEmit is clean. I did not run the full suite.
Both the test's git calls and its bun runs of the script now use env: gitClientEnv() from test/helpers/git-client.ts. The repo init also goes through that same git helper. Only the test changed, not scripts/return-check.ts or src/release/return_check.ts. The pull's behaviour is as described before.
The repository now has everything the release needs for the return check, but the host's
tick.shdoesn't call it yet. That script isn't in this repo, so I couldn't edit it. Adding one line to it is the owner's host-side step.scripts/return-check.ts(#17766). It was only on the unmerged branchsold/return-check, so I cherry-picked its commit7fc26dde5with its author intact. That is why the previous try was parked. Say so if you'd rather wait for that branch to merge first.src/release/return_check.ts. It holds the decision: it names each migration that makes a return unproven. A migration is let through only by a line<id> <reason>in an allow file; an id without a reason doesn't count. Exit 1 holds the release.scripts/return-check.tsis now a thin wrapper over it. I added--log <file>, which appends what the check said, with timestamps, to the release log.docs/features/nightly-release.mdhas the host step. Between build and promote the tick runsbun scripts/return-check.ts v<live> --allow /srv/forge/release-tick/return-allow.txt --log <release log>. Exit 1 is a hold, and so is exit 2 (it could not look).test/return-check-release.test.ts. It covers the hold, the let-through by id and reason, and an id with no reason being refused. It also covers a changed migration being named and a plain new one passing.test/schema-additive.test.tspass, as do the unused-exports, doorless and feature-doors tests, andtsc --noEmitis clean. The gate's one note is thatparseAllowis 0.55 similar todocHeadingsintest/cli-docs.test.ts. I judged that a false match and did not change it.To try it:
bun test test/return-check-release.test.ts, orbun scripts/return-check.ts v0.7.719 --log $TMPDIR/release.log.Closes #17769