Skip to content

fix(release): commit a hybrid package's Cargo.toml in a direct release - #691

Merged
goosewobbler merged 5 commits into
mainfrom
fix/678-hybrid-cargo-toml-commit
Oct 23, 2026
Merged

goosewobbler merged 5 commits into
mainfrom
fix/678-hybrid-cargo-toml-commit

Conversation

@goosewobbler

@goosewobbler goosewobbler commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Description

In a direct-commit release, a hybrid package (a directory with package.json and Cargo.toml or pubspec.yaml) records one update: its package.json. git-commit stages only updates[].filePath plus additionalFiles, so the bumped Cargo.toml was left out of the release commit and the tree was left dirty.

Two places write that Cargo.toml, and now both stage it:

  • Publish's prepare stage (when publish.cargo.enabled) adds each Cargo.toml it writes to ctx.additionalFiles, next to the synced locks. This also covers a standalone releasekit publish.
  • The version step bumps it whatever publish.cargo.enabled says, so the prepare fix alone leaves publish.cargo.enabled: false broken (e.g. a napi-rs crate). flushPendingWrites now returns the paths it wrote, and release passes them to publish alongside the notes files. That commits everything the version step wrote, including an async-mode hybrid's pubspec.yaml and, with cargo publishing off, the Cargo.lock files fix(version)!: sync every committed Cargo.lock that records a bumped crate #674 syncs.

VersionOutput is unchanged.

Not fixed here:

Related Issue(s)

Closes #678.

Type of Change

  • feat — New feature
  • fix — Bug fix
  • docs — Documentation change
  • refactor — Code refactoring
  • test — Adding or updating tests
  • chore — Maintenance, dependencies, tooling
  • Breaking change — Requires major version bump

Scope

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release
  • @releasekit/config
  • @releasekit/core
  • CI / workflows
  • Root / monorepo

Checklist

  • Lint passes (pnpm lint)
  • Tests pass (pnpm test)
  • Typecheck passes (pnpm typecheck)
  • Documentation updated (if applicable)
  • Breaking changes noted in description

Testing Notes

  • test/integration/direct-release-hybrid.spec.ts runs the built releasekit release on a temp repo with a napi-style package (package.json, Cargo.toml, committed Cargo.lock) and a package.json + pubspec.yaml package, in async mode with cargo publishing off. It asserts the release commit holds all three at the new version and the tree is clean, and fails with the release.ts change reverted.
  • Unit tests: prepare stages a hybrid's Cargo.toml; flushPendingWrites returns each written path once; runRelease passes the flushed files and notes files to publish.
  • Checked by hand with the built CLI, cargo publishing on and off, sync and async: before, the commit held only package.json and git status showed M Cargo.toml; after, everything is committed and the tree is clean.
  • Rebased onto main after fix(version)!: sync every committed Cargo.lock that records a bumped crate #674: core, version, publish and release suites pass, and so do all integration specs, hybrid and cargo-lock-sync included.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no blocking issue remains.

Summary

Direct releases now commit the native manifests and lockfiles written during versioning, even when Cargo publishing is disabled.

  • Cargo locks now follow the Rust crates that get bumped.
  • Direct releases now commit every file they update.

Reviews (2) · Last reviewed commit: "fix(release): commit a hybrid package's ..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Standing release PR: #614 · v0.42.0 queued (4 packages) · open 82d 18h 34m · ✅ ready to merge

Release Preview — v0.41.2 → v0.41.3

Note: Labels on this PR are advisory in standing-pr mode. Bumps come from conventional commits in the standing PR; override by editing labels on the standing PR itself. Add release:immediate to bypass the standing PR and release this PR directly.

These changes will be added to the release PR (#614) when merged:

Changelog

monorepo 0.41.2 → 0.41.3

Changed

  • trim the hybrid staging comment and test name
  • say what the hybrid staging comment's code does (publish)
  • move and tighten the hybrid staging comments
  • put the hybrid release test's config notes next to their settings

Fixed

  • commit a hybrid package's Cargo.toml in a direct release (release) (#678)

All packages → 0.41.3 (sync versioning)

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release

After merge — predicted release

No version escalation — this PR's changes will be included in the queued release without affecting the projected versions.

Package Standing PR This PR After merge
monorepo 0.42.0 0.41.3 0.42.0

Updated automatically by ReleaseKit

Comment thread packages/core/src/cargo.ts Outdated
@goosewobbler
goosewobbler force-pushed the fix/678-hybrid-cargo-toml-commit branch 2 times, most recently from 370ebd0 to b2e0569 Compare October 23, 2026 03:14
A hybrid package (package.json plus Cargo.toml or pubspec.yaml in one
directory) records a single update, its package.json, and the direct
release's git-commit stage stages only update paths and additionalFiles.
The bumped Cargo.toml was left out of the release commit and the tree
was left dirty.

- Publish's prepare stage stages each Cargo.toml it writes, next to the
  synced locks.
- flushPendingWrites returns the paths it wrote, and the direct release
  passes them to publish with the notes files. Files only the version
  step writes are committed too: a hybrid's Cargo.toml when
  publish.cargo.enabled is false, an async-mode hybrid's pubspec.yaml,
  and the synced Cargo.lock files in that config.

Closes #678

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@goosewobbler
goosewobbler force-pushed the fix/678-hybrid-cargo-toml-commit branch from b2e0569 to 8ffab2d Compare October 23, 2026 12:28
github-actions Bot and others added 4 commits October 23, 2026 13:33
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Direct release doesn't commit a hybrid package's Cargo.toml bump

1 participant