ReviewOS

stacks/rpx

release scripts double-generate CHANGELOG.md (dupe section per release)

#2260
Closed glennmichael123 opened this 11 days ago ·
11 days ago

Symptom

Every release commit since at least v0.11.7 has added two identical sections to the top of CHANGELOG.md:

  • one with the proper tag range (compare/v0.11.7...v0.11.8)
  • one with a ...HEAD range (compare/v0.11.7...HEAD)

Examples:

Root cause

The release:* scripts chain two changelog generators:

"release:patch": "bun --bun run changelog:generate && bunx --bun bumpx patch --recursive --yes"
  1. bun run changelog:generate (= bunx --bun logsmith --output CHANGELOG.md) runs before the new tag exists, so logsmith generates a <last-tag>...HEAD section and prepends it.
  2. bunx --bun bumpx patch ... then runs. bumpx has --changelog enabled by default and internally calls @stacksjs/logsmith's generateChangelog with the proper from/to tag range — generating a second section, this time with the freshly-created tag.

Both prepend to CHANGELOG.md, hence the duplicate.

Fix

Drop the redundant pre-step from every release script; let bumpx handle the changelog itself. The standalone changelog / changelog:generate scripts stay available for ad-hoc use.

- "release":       "bun --bun run changelog:generate && bunx --bun bumpx prompt --recursive",
- "release:patch": "bun --bun run changelog:generate && bunx --bun bumpx patch  --recursive --yes",
- "release:minor": "bun --bun run changelog:generate && bunx --bun bumpx minor  --recursive --yes",
- "release:major": "bun --bun run changelog:generate && bunx --bun bumpx major  --recursive --yes",
+ "release":       "bunx --bun bumpx prompt --recursive",
+ "release:patch": "bunx --bun bumpx patch  --recursive --yes",
+ "release:minor": "bunx --bun bumpx minor  --recursive --yes",
+ "release:major": "bunx --bun bumpx major  --recursive --yes",

Landed on main as 43d0172.

Cross-repo scope

This release-script pattern is copy-pasted across most stacksjs repos (seen in tlsx, bumpx, dtsx, etc. — anywhere using bumpx + logsmith). Sweeping the same fix across them next; will reference this issue in those commits.

The CHANGELOG.md history in this repo (and others) carries the historical dupes; not cleaning those up unless requested — fresh releases will be clean.

11 days ago

Verified fixed. The reported symptom — two identical sections per release, one with the proper tag range and one with ...HEAD — stopped exactly where 43d0172 says it should.

True dupe pairs (both <prev>...<new> and <prev>...HEAD for the same release) exist for v0.11.0 through v0.11.9 and none after. v0.11.10 is the first release containing the fix and the first clean one; every release since (41 of them, through v0.11.51) has a single proper-range section.

One unrelated, smaller thing surfaced while checking: a few later releases produced an odd section rather than a duplicate one — v0.11.24, v0.11.25 and v0.11.26 each emitted a ...HEAD range as their only section, and four releases have no section at all (v0.11.18→19, v0.11.27, v0.11.41→42). Nothing in the repo changed around those, and bunx bumpx is unpinned, so that's most likely upstream drift in bumpx/logsmith. Not the bug this issue is about; noting it so it isn't mistaken for a regression of this one.

Closing as fixed.

Sign in to comment on this issue.