fix(release): preserve Cargo.toml comments in create-release #421

Merged
nrupard merged 1 commit from fix/create-release-preserve-cargo-comments into main 2026-07-07 17:03:10 +02:00
Owner

just create-release bumped the version with open Cargo.toml | update package.version | to toml, which round-trips through nu's TOML serializer and drops every comment. The v0.6.0 release commit silently deleted 11 lines of feature-flag and dependency rationale (MAPPS-338/299/292/355); that deletion had to be reverted by hand on the release branch.

This replaces the round-trip with a text-targeted str replace on the [package] version line (the first version = "..." in the file), so only that line changes and all comments survive. Verified against the current Cargo.toml: a simulated 0.5.0 -> 0.6.0 bump changes only line 5 and leaves every dependency version and comment untouched.

package.json stays on the JSON round-trip: JSON has no comments to lose and it already produced a clean one-line diff.

`just create-release` bumped the version with `open Cargo.toml | update package.version | to toml`, which round-trips through nu's TOML serializer and drops every comment. The v0.6.0 release commit silently deleted 11 lines of feature-flag and dependency rationale (MAPPS-338/299/292/355); that deletion had to be reverted by hand on the release branch. This replaces the round-trip with a text-targeted `str replace` on the `[package]` version line (the first `version = "..."` in the file), so only that line changes and all comments survive. Verified against the current Cargo.toml: a simulated 0.5.0 -> 0.6.0 bump changes only line 5 and leaves every dependency version and comment untouched. package.json stays on the JSON round-trip: JSON has no comments to lose and it already produced a clean one-line diff.
fix(release): preserve Cargo.toml comments in create-release
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 2m44s
Create release / Create release from merged PR (pull_request) Has been skipped
7c2afb1d41
`just create-release` bumped the version with `open Cargo.toml | update package.version | to toml`, round-tripping through nu's TOML serializer, which drops every comment. The v0.6.0 release commit silently deleted 11 lines of feature-flag and dependency rationale (MAPPS-338/299/292/355) as a result.

Replace the round-trip with a text-targeted `str replace` on the `[package]` version line (the first `version = "..."` in the file), so only that line changes and all comments survive. package.json is left on the JSON round-trip, which has no comments to lose and already produced a one-line diff.
nrupard scheduled this pull request to auto merge when all checks succeed 2026-07-07 17:02:12 +02:00
nrupard deleted branch fix/create-release-preserve-cargo-comments 2026-07-07 17:03:10 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!421
No description provided.