fix(release): take the release body from the CHANGELOG - #255
Conversation
Review — approve, no changesThe argument for taking the body from the CHANGELOG rather than the commit log is the right one, and the fallback behaviour is what makes it safe to merge: it still works, and it announces that it happened. "Notes generated because nobody wrote a changelog entry should not look like notes somebody wrote" is the correct instinct — a silent fallback would make a skipped release step invisible. Checked the pieces that could bite:
One thing to know, not to change
|
`gen-release-notes.ts` walked a commit range, and with no preceding tag it fell back to the root commit. That is how v0.3.0's release page came to read "0 commits." — #250 fixed the shallow clone that produced the empty range, but the underlying choice was still to describe a release by its commit subjects. CHANGELOG.md already says what shipped, written for people, grouped by what the changes mean rather than by the verb the commit happened to start with. A list of commit subjects is what you write when nobody wrote anything better. So `--version` makes that entry the release body. The commit walk remains the fallback and announces itself, in the body and on stderr: notes generated because nobody wrote a changelog entry should not look like notes somebody wrote. Repo-relative links are rewritten to absolute URLs pinned at the tag. A release body is not rendered inside the repository, so `docs/file-contract.md` resolves against nothing and 404s; pinning at the tag rather than the default branch also keeps a v0.3.0 link pointing at the v0.3.0 document after the file moves. `[Unreleased]` cannot satisfy the lookup — a release that shipped whatever happened to be sitting under that heading would be lying about its contents. Also passes a scrubbed environment to the git calls, for the reason in #252. It duplicates six lines rather than importing `gitSpawnEnv`, because the release job runs this with `npx tsx` after install but before any build, so core's `dist/` does not exist yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
73ffb37 to
8fdd274
Compare
Closes the last item on
docs/V0.3.0_REPORT.md§8's suggested follow-ups.The problem
gen-release-notes.tsdescribes a release by walking its commit range, and with no preceding tag it falls back to the root commit. #250 fixed the shallow clone that made that range come out empty — v0.3.0's release page shipped reading "0 commits." — but left the underlying choice in place: a release described by the verbs its commits happened to start with.CHANGELOG.mdalready says what shipped, written for people, grouped by what the changes mean. A list of commit subjects is what you write when nobody wrote anything better.Change
--version <x.y.z>makes that version's CHANGELOG entry the release body.The commit walk stays as the fallback and announces itself, in the body and on stderr:
Notes generated because nobody wrote a changelog entry should not look like notes somebody wrote.
Links are absolutised and pinned at the tag
A release body is not rendered inside the repository, so
docs/file-contract.mdresolves against nothing and 404s. Every repo-relative link becomeshttps://github.com/oratis/deepcode/blob/v0.3.1/docs/….Pinned at the tag, not the default branch — a link in the v0.3.0 notes should keep pointing at the v0.3.0 document after that file moves. Absolute URLs, in-page anchors and
mailto:are left alone.[Unreleased]cannot satisfy the lookupThe pattern requires the exact version. A release that shipped whatever happened to be sitting under "Unreleased" would be lying about its own contents.
Verified against the real thing
renders the actual 0.3.0 entry with working links, and
--version 9.9.9falls through to the commit log with the notice attached.Also
Passes a scrubbed environment to the git calls, for the reason in #252. Six lines duplicated rather than importing
gitSpawnEnv: thegithub-releasejob runs this withnpx tsxafterpnpm installbut before any build, sopackages/core/distdoes not exist. That is the caveat #252 listed as not-covered.Verification
typecheck, lint, format, docs clean; full suite green through the pre-commit hook. 11 new tests covering section extraction, the Unreleased guard, prose that looks like a heading, empty sections, link rewriting and argument parsing.
🤖 Generated with Claude Code