023 — Release walks the ready stories, waiting for each merge (#95)
Status: shipped (v0.28.0)
Why
With several stories ready, each needs its own tp release on its own
branch: the run opens the pull request, prints "Merge it, then run 'tp
release' on main" and exits (go-span v0.1.0, story/favicon-lint). The
releaser then merges, switches branch by hand, runs again for the next
story, and finally runs it on main to tag. merge_wait (story 008)
already waits for one pull request (10m by default since story 022), but
only that one.
What changes
- Walk (
fragments: true):tp releaseon a story branch opens or updates its pull request intoreleaseand waits up tomerge_waitfor the merge. Once it is merged, the run checks out the first story in.tp-release.yml(inafter:order) that is not yet inrelease, and repeats. - When every story is merged, it checks out the base branch and runs story 021's batch: release commit, release PR, wait, tag.
- A pull request still open at the deadline, or closed, stops the walk.
It names that story, exits 0, and leaves its branch checked out. Run
tp releasethere again to resume: a story already inreleaseis skipped by ancestry.
Acceptance
| Story PR during the wait | Stories left | Then |
|---|---|---|
| merged | yes | check out the next story branch; open its PR; wait |
| merged | none | check out the base; the batch: release commit, release PR, wait, tag |
| merged | no .tp-release.yml |
say to list the batch; stop |
| open at the deadline | any | stop on that story's branch, named; exit 0 |
| closed unmerged | any | stop: says so, nothing tagged, exit 0 |
| Ctrl-C | any | stop waiting; PR stays open; exit 0 |
| — (already merged) | — | skipped |
Out of scope
- Merging pull requests on the releaser's behalf.
- Walking stories across repositories (#62
sweep).
Decisions
- The walk is in
fragments: truemode only. Without fragments, each story's PR carries a CHANGELOG[Unreleased]edit, and the edits conflict with each other (the reason for story 021). In fragments mode the story PRs intoreleasealready exist; the walk adds a wait for a human merge of each, and the batch's local merge skips stories that are already inrelease. ADR 0005 holds as written.
Done when
- tests express the acceptance table and pass
- spec updated (
docs/release-workflow.md) - ADR written if a fork was resolved (none needed: within ADR 0005)
- roadmap ticked and stamped; changelog entry
- issue closed with a link to the release