Answer stability round 1: 1 🔴, 1 🟡 (0 misread); stamp deploy-release's trace in UTC, end a stopped run's trace, drop redundant assertions, and the product-owner and prose fixes

This commit is contained in:
2026-11-27 14:14:28 +01:00
parent 3eb57d44c6
commit 74066a3134
13 changed files with 107 additions and 77 deletions
+15 -10
View File
@@ -33,8 +33,9 @@ with --cut-patch.
deletes the branch on origin, then moves <checkout> to the tag as above. A failed delete only warns.
It says on stderr as each step finishes, and ends stdout, after the changelog, with the line
`Done: v<version> is cut and pushed, and <checkout> is on it.`
It keeps each of those lines, with its time, in a file of the run's own under $XDG_STATE_HOME/deploy-release
(default ~/.local/state/deploy-release), and so does --cut-patch.
It keeps each of those lines, with its time in UTC, in the run's trace: a file of its own under
$XDG_STATE_HOME/deploy-release (default ~/.local/state/deploy-release), named by when the run began. --cut-patch does too.
Where Ctrl-C or an unexpected fault ends the run, the trace ends with a line that starts `stopped:`.
Where a step fails it stops, exit 1, with git's or the forge's reason, and leaves the pull request
and the branch as they are. A rerun continues: it takes the branch's open pull request and a cut
commit already merged, and drops a cut tag an earlier run made but never pushed. Once the tag is pushed, the release is cut: where only the
@@ -53,8 +54,8 @@ doesn't hold, and on a GitHub origin, whose rebase merge would drop the tag from
2. In a worktree of its own at the tag, it applies each commit's changes, except to CHANGELOG.md, todo.md,
docs/comprehension-history.md and docs/reading-cost.md, heads CHANGELOG.md with the release's section, and commits that
titled `Cut release <version>`. Where a commit doesn't apply, it stops, names it, and says how to cut the patch by hand.
3. It runs ci.sh on that commit, with its output in a file beside the run's trace, which it names on stderr. It stops
where ci.sh fails or still runs after 30 minutes, before anything is tagged.
3. It runs ci.sh on that commit and names on stderr the file, beside the run's trace, that takes ci.sh's output. It
stops where ci.sh fails or still runs after 30 minutes, before anything is tagged.
4. It tags the commit v<version>, annotated `Cut release <version>`, and pushes only the tag.
5. On a fresh origin/main it merges the tag keeping main's files, moves the release's entries from ## Unreleased to a
## <version> section below it, commits that titled `Merge release <version> into main`, and lands it through the branch
@@ -63,7 +64,6 @@ doesn't hold, and on a GitHub origin, whose rebase merge would drop the tag from
A rerun takes a tag origin holds already, once it checks the tag lists the same changelog entries, and the merge-back's open
pull request. Once the merge-back has merged, the release is cut: where only the move stopped, run a bare deploy-release.
"""
import datetime
import os
import pathlib
import shlex
@@ -96,17 +96,22 @@ def main(argv: list[str]) -> int:
return 1
print(moved)
return 0
clone, now = os.getcwd(), datetime.datetime.now
clone, now = os.getcwd(), time.time
folder, name = trace.trace_folder(os.environ, pathlib.Path.home()), trace.run_name(now(), os.getpid())
begun = trace.started(folder, name, f"deploy-release {shlex.join([*argv[:2 if patching else 1], checkout])} in {clone}", now)
if isinstance(begun, Failure):
print(f"deploy-release: warning: {begun.reason}", file=sys.stderr)
file = None if isinstance(begun, Failure) else begun
say = trace.saying(file, now, sys.stderr)
if commits is not None:
moved = cut_patch(clone, checkout, commits, time.sleep, say, ci_runner(folder / f"{name}-ci.log", CI_SECONDS, say, f"deploy-release-ci-{name}", removed_container))
else:
moved = cut(clone, checkout, time.sleep, say)
try:
if commits is not None:
moved = cut_patch(clone, checkout, commits, time.sleep, say, ci_runner(folder / f"{name}-ci.log", CI_SECONDS, say, f"deploy-release-ci-{name}", removed_container))
else:
moved = cut(clone, checkout, time.sleep, say)
except BaseException as stopped:
# Ctrl-C or a fault nobody foresaw: its traceback reaches only the terminal, so the trace says the run ended here.
trace.kept(file, f"stopped: {stopped!r}", now, sys.stderr)
raise
if isinstance(moved, Failure):
say(moved.reason)
return 1