fix(release): bump version with a surgical edit so create-release keeps Cargo.toml comments (VA-137) #145
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VA-137-release-preserve-comments"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes VA-137:
just create-releasestrips all top-level Cargo.toml comments on every release.Root cause
The recipe bumped the version by reserializing the whole file:
nushell's
to tomldoes not preserve comments, so every release silently deleted all top-level comments. On v0.4.0 this removed the six-line block above[profile.release]documenting why the release binary keeps line-table debuginfo + the symbol table (VA-92). It was restored by hand in PR #141 and would be stripped again on the next release.Fix
Replace the reserialization with a single anchored regex that rewrites only the version value under
[workspace.package]:The
[^\[]*?bound stops at the next[section], so the severalworkspace.dependenciesversion = ...pins are never touched.--raw+ first-match-only replace keeps the file byte-for-byte identical apart from that one string.Validation
Tested on the real Cargo.toml with nushell 0.112.2 (the host version) across major / minor / hotfix bumps:
1.0.0,0.5.0,0.4.1)versionpins (tokio1, etc.) are unchangedjust --show create-releaserenders the recipe line unchanged (no{{ }}interference) and the justfile still parses. This unblocks the next release (VA-135 crate republish, VA-136 tag-build check) without re-stripping the comments those changes rely on.🤖 Generated with Claude Code