Skip to content

Publish a GitHub Release from CHANGELOG.md when a version tag is pushed - #61

Merged
duizendstra merged 5 commits into
mainfrom
workshop/release-on-tag
Nov 9, 2026
Merged

duizendstra merged 5 commits into
mainfrom
workshop/release-on-tag

Conversation

@duizendstra

@duizendstra duizendstra commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Pushing a vX.Y.Z tag on main publishes the GitHub Release, and its notes come from CHANGELOG.md. This follows the release research: no release-please, no Conventional Commits, because the CHANGELOG is hand-written narrative.

Reworked at b467e53: v0.4.0 is released

The fold of 0.4.0 into 0.5.0 was reversed and v0.4.0 is tagged and released, so 0.4.0 is now a normal entry.

  • The > **Never released.** line has left CHANGELOG [0.4.0].
  • The fold handling has left release_notes.py and check.py, with its fixtures.
  • No version check special-cases 0.4.0. The badge and the PROMPT.md header at 0.4.0 are the released state.
  • CHANGELOG has no compare or tag links, so there is nothing to add for v0.4.0.

⚠ One stale line in the workflow file

.github/workflows/release.yml:6-7 still says the script refuses "a version marked never released". That is no longer true. The PAT has no workflow scope, so I can't push the edit. Jasper: the line should end at "…or the newest CHANGELOG entry. Nothing is published unless every check passes." The rest of the file is unchanged and correct.

What's in the branch

  • .github/workflows/release.yml (pushed by Jasper, 453ca62): on a pushed vX.Y.Z tag it checks that the tag is on main and runs check.py and the fixtures. It then prints the notes with release_notes.py and runs gh release create --verify-tag.
  • scripts/release_notes.py vX.Y.Z prints the body of the tag's ## [X.Y.Z] — YYYY-MM-DD entry alone, without its heading. It refuses, one FAIL: line each, a tag that:
    • isn't vX.Y.Z;
    • has no entry, or an empty one;
    • isn't the newest entry;
    • disagrees with the README badge or the PROMPT.md header.
  • check.py gains check_changelog_entries. Every entry heading is in the form the script parses, entries run newest first, and no ## subheading sits below the first entry.
  • test_scripts.py gains five test_release_* fixtures. None of them names a version, so no release cut invalidates them:
    • the refusals and the exact notes, run against a small synthetic repository;
    • a badge or header that disagrees with the tag;
    • on the real repo, the newest entry prints and the next minor is refused;
    • the next minor cut in a copy, where check.py passes and the notes publish;
    • the check failing on an out-of-order entry, a malformed heading, and a ## subheading.
  • MANIFEST is regenerated. CHANGELOG (Unreleased plus the Versioning note) and CONTRIBUTING's version gate describe the release path.

Checked at b467e53

  • scripts/check.py passes. scripts/test_scripts.py: 47 tests, OK.
  • release_notes.py v0.4.0 prints the [0.4.0] section. It is byte-identical to the published v0.4.0 Release body. release_notes.py v0.5.0 is refused with three FAIL: lines: the badge, the header, and no entry.
  • Author's placebo run, not a reviewer's. Each mutant fails a release fixture:
    • notes that append the next older entry;
    • no newest-entry check;
    • a missing entry that prints instead of failing.
  • I haven't run the workflow itself: that needs it on main and a pushed tag. The first real run is v0.5.0.
  • Squash message: no "(chore: remove scripts/, ship prompt-only #5)", and no reference to a private repository.

🤖 Generated with Claude Code

@duizendstra

Copy link
Copy Markdown
Member Author

Blind review verdict: SEND BACK · head b467e5385186edbca8479c8f401af0dee6790703 · base b2f2360 · reviewer model claude-opus-5-5

What passed.

  • release_notes.py v0.4.0 prints the [0.4.0] section. It is byte-identical to the published Release body: 32055 bytes, and diff is clean.
  • v0.5.0 exits 1 with three FAILs: the badge, the header, and no entry.
  • No fold logic is left in scripts/, .github/ or CONTRIBUTING, and there is no 0.4.0 special case.
  • check.py passes, and test_scripts.py runs 47 tests, OK.
  • The reviewer ran 14 placebo mutants with MANIFEST regenerated per mutant, and 11 were killed. The three that survived are defence in depth or unreachable in CI:
    • a ## subheading stop in release_notes.py;
    • fullmatch changed to search on the tag;
    • <= changed to < in the order check.

Blocker.

  • .github/workflows/release.yml:6-7 still says the workflow refuses "a version marked never released". That refusal no longer exists.
  • The fix: end the sentence at "…or the newest CHANGELOG entry.", and keep "Nothing is published unless every check passes."
  • This change needs the workflow scope, so it is Jasper's push. It moves the head, so a delta review follows.

Notes.

  • Squash-merge with a message that has no "(chore: remove scripts/, ship prompt-only #5)" and no private-repo reference. A merge commit would carry b0aff7b's reference onto main.
  • Neither CHANGELOG reader skips fences, so they do not fully meet CONTRIBUTING.md:163. This fails safe: a fenced ## line makes the check refuse the release.
  • A ## [Unreleased] placed below a released entry is not caught.
  • Cosmetic: the fixture name at test_scripts.py:753 still says "folded".
  • The PR body's "apart from one trailing newline" is wrong: the output is byte-identical. The body is corrected.

@duizendstra

Copy link
Copy Markdown
Member Author

Delta review, b467e53..b7af447: SEND BACK · head b7af447 · base b2f2360 · reviewer model claude-opus-5-5 (blind)

  • The release.yml comment now matches release_notes.py, which refuses a tag that disagrees with the README badge or the PROMPT.md header (line 58), or one that is not the newest entry (line 65).
  • "Nothing is published unless every check passes" holds: every check step runs before gh release create.
  • Suites at b7af447: check.py says all checks pass, and test_scripts.py runs 47 tests, OK.

Blocker: scripts/test_scripts.py:753, test_release_check_fails_entries_out_of_order_or_folded_backwards, still names the fold check that b467e53 removed. Its body now tests only entry order and headings.

Next: I'm renaming it (test file only, no workflow change).

@duizendstra

Copy link
Copy Markdown
Member Author

Delta review, b7af447..83d8de7: PUSH · head 83d8de7 · base b2f2360 · reviewer model claude-opus-5-5 (blind)

  • What changed: the test is renamed to test_release_check_fails_entries_out_of_order_or_misheaded, and the MANIFEST hash is updated to match.
  • Stale references: nothing in the tree refers to the removed fold check. The four remaining fold hits are unrelated prose.
  • Suites: check.py says all checks pass, and test_scripts.py runs 47 tests, OK.
  • Blockers: none.

For the squash message: two branch subjects carry a "(#5)" and a "(#61)". Please drop the "(#5)" from the squash message; the PR number GitHub adds is enough.

duizendstra added a commit that referenced this pull request Nov 8, 2026
v0.4.0 is tagged and released, so 0.4.0 is no longer folded into 0.5.0.
The "Never released" note leaves its CHANGELOG entry, and the fold handling
leaves release_notes.py and check.py with its fixtures: a tag's notes are
its own entry alone. release_notes.py v0.4.0 prints the section, the same
text as the published Release, and v0.5.0 is refused until it is cut.

The release fixtures no longer name 0.4.0 or 0.5.0: they read the newest
entry and cut the next minor in a copy, so a release does not stale them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@duizendstra
duizendstra force-pushed the workshop/release-on-tag branch from 83d8de7 to 57863c4 Compare November 8, 2026 11:09
@duizendstra

Copy link
Copy Markdown
Member Author

Reposted with internal references removed. First posted at 09:33 UTC; otherwise unchanged. Its SHAs are the ones of that time; the rewording note in this thread maps them to the current ones.

Review: SEND BACK. PR #61 at head b0aff7b, reviewed against base b2f2360 on claude-opus-5-5, the contextvibes-reviewer run blind.

Blockers

  1. The head lacks .github/workflows/release.yml. The CHANGELOG, CONTRIBUTING and both script docstrings describe a workflow that is not in the tree.
  2. One fixture fails once 0.5.0 is cut. It asserts that v0.5.0 has no entry. release.yml runs test_scripts.py, so the v0.5.0 tag would publish nothing.

Confirmed

  • The extractor is sound, and so is the 0.4.0 fold in a simulated cut.
  • The tag filter is valid syntax, and the merge-base gate works for annotated tags.
  • contents: write is enough to publish, and the release would become Latest.
  • 11 placebos each failed a fixture.

Notes

  • A ## subheading would end an entry's notes early, unchecked.
  • The empty-entry refusal had no fixture.
  • An internal reference should go.
  • "Byte for byte" is off by one leading newline.

Response in 30368ea

  • Blocker 2 is fixed.
    • The refusal fixtures now run against a synthetic three-file repo. The fold fixture runs against the real CHANGELOG, cutting 0.5.0 in a copy only if needed.
    • Proof: all 46 tests pass in a copy with 0.5.0 cut.
  • The new synthetic fold fixture found a bug the review did not. The folded note was stripped only up to "ships in 0.5.0", which left ; there is no v0.4.0 tag. in the 0.5.0 notes. The whole blockquote is now dropped, and a placebo fails two fixtures.
  • The notes are addressed.
    • check.py now fails a non-entry ## heading below the first entry.
    • The empty-entry refusal has a fixture.
    • The internal references are removed from the code and the PR body. One remained in b0aff7b's commit message.
    • The PR body is corrected.
  • Blocker 1 is open and needs Jasper. The push token has no workflow scope. The file is in the PR body as it stands.

A re-review of 30368ea against b0aff7b is running.

@duizendstra

Copy link
Copy Markdown
Member Author

Reposted with internal references removed. First posted at 09:36 UTC; otherwise unchanged. Its SHAs are the ones of that time; the rewording note in this thread maps them to the current ones.

Delta review on 30368ea (the Opus reviewer, base b2f2360): SEND BACK. One blocker is left, and it is the one this PR leaves to Jasper by design.

  1. .github/workflows/release.yml is not committed. CHANGELOG, CONTRIBUTING and the release_notes.py docstring describe it. The author's push token has no workflow scope, so the file is in this PR's body: the reviewer diffed it against the local file and found them identical. Once it is committed as shown, the reviewer expects PUSH WITH NOTE.

Confirmed in 30368ea:

  • The release fixtures no longer break when 0.5.0 is cut. They use a synthetic CHANGELOG, and the real-CHANGELOG fold test cuts a copy or skips.
  • without_note() fixes the leftover "; there is no v0.4.0 tag." The new assertion fails on the old code.
  • check.py now fails a ## heading that is not ## [ below the first entry.
  • There are no internal references in the tree or the PR body.
  • The tests are 46/46 OK, and check.py passes.

Notes:

  • b0aff7b's commit message still has an internal reference.
  • The new ## rule does not skip fenced blocks. There are none in the CHANGELOG today.
  • After 0.6.0 the real-CHANGELOG fold test skips, and the synthetic fold test still covers the fold.

Gap: the reviewer's read-only guard refused its scratch edits, so the full suite was not run on a 0.5.0-cut copy. That result is PLAUSIBLE, backed by in-memory notes() runs.

@duizendstra

Copy link
Copy Markdown
Member Author

Rewording note. The branch's commit messages were reworded and force-pushed to drop internal references. Every commit keeps its tree, so the reviewed content is unchanged.

Old New
b0aff7b 8accdbd
30368ea 2d26e78
453ca62 ee3061d
b467e53 273a8e7
b7af447 3053441
83d8de7 57863c4

For the squash-merge: leave out the "(#5)" that 453ca62 used to carry. It pointed at diffract#5, an unrelated old PR, and is gone from ee3061d.

@duizendstra

Copy link
Copy Markdown
Member Author

Rebase review: PUSH · head 00a64f6c3fa7f276ac19ce3aa480db09fa49ffdb · base 4d1fc1c · reviewer model claude-opus-5-5 (blind)

The branch is rebased onto main (4d1fc1c, after #63 and #59), and 2d26e78 is folded into the first commit, leaving five commits. This head is not pushed yet. Rewriting commits that touch .github/workflows/release.yml needs the workflow scope, so the push is the maintainer's. This verdict holds only while the PR head equals 00a64f6.

duizendstra and others added 5 commits November 9, 2026 08:37
release.yml runs on a pushed vX.Y.Z tag on main. It re-runs the checks,
then publishes the Release with that version's CHANGELOG entry as its
notes, printed by the new scripts/release_notes.py. The notes stay the
hand-written narrative; nothing is generated from commits.

release_notes.py refuses a tag that is not vX.Y.Z, has no entry or an
empty one, is not the newest entry, or disagrees with the README badge
or the PROMPT.md header. It also refuses a version marked never released.

0.4.0 is folded into 0.5.0 and gets no tag. Its entry opens with
a Never released note, and its body is appended to the 0.5.0 notes. Until
0.5.0 is cut, the badge and header at 0.4.0 still agree with that entry.

check.py gains check_changelog_entries: headings in the form the script
parses, newest first, folds pointing forward. Four fixtures in
test_scripts.py cover the refusals, the 0.5.0 cut and the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The workflow text from the PR body, unchanged. Committed with a
workflow-scoped token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.4.0 is tagged and released, so 0.4.0 is no longer folded into 0.5.0.
The "Never released" note leaves its CHANGELOG entry, and the fold handling
leaves release_notes.py and check.py with its fixtures: a tag's notes are
its own entry alone. release_notes.py v0.4.0 prints the section, the same
text as the published Release, and v0.5.0 is refused until it is cut.

The release fixtures no longer name 0.4.0 or 0.5.0: they read the newest
entry and cut the next minor in a copy, so a release does not stale them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@duizendstra
duizendstra force-pushed the workshop/release-on-tag branch from 57863c4 to 0eaca35 Compare November 9, 2026 11:01
@duizendstra
duizendstra merged commit b8d7b6b into main Nov 9, 2026
1 check passed
@duizendstra
duizendstra deleted the workshop/release-on-tag branch November 9, 2026 11:01
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