Skip to content

fix: sync Cargo.lock on release PRs via release workflow#43

Merged
quiet-node merged 1 commit intomainfrom
worktree-structured-floating-stearns
Apr 6, 2026
Merged

fix: sync Cargo.lock on release PRs via release workflow#43
quiet-node merged 1 commit intomainfrom
worktree-structured-floating-stearns

Conversation

@quiet-node
Copy link
Copy Markdown
Owner

@quiet-node quiet-node commented Apr 6, 2026

Summary

  • Fixes the immediate dirty `Cargo.lock` on main: committed version said `0.2.0`, working file said `0.2.1`
  • Adds a `sync-cargo-lock` job to the existing `release-please.yml` so future release PRs automatically include a `Cargo.lock` update before merging

Root cause

release-please bumps `Cargo.toml` via `extra-files`, but cannot safely update `Cargo.lock`. Using the `generic` extra-file type would do a naive string replace of `0.2.0` across the whole file, corrupting 9 unrelated packages that share that semver. So `Cargo.lock` was always left stale after each release merge (happened at 0.2.0, then again at 0.2.1).

How the fix works

A second job in `release-please.yml` that:

  1. Runs only when release-please has opened/updated a PR (not when it creates a release)
  2. Checks out the release PR branch using the `pr` output from the release-please action
  3. Runs `cargo update --package thuki` to regenerate only the thuki entry in `Cargo.lock`
  4. Commits and pushes the change back to the PR branch if anything changed (idempotent: safe to re-run)

Test plan

  • Merge this PR
  • Verify main no longer has an unstaged `Cargo.lock` diff
  • On the next release, confirm the release-please PR includes a `Cargo.lock` commit from `github-actions[bot]`

🤖 Generated with Claude Code

Release-please bumps Cargo.toml via extra-files but cannot safely update
Cargo.lock (many unrelated packages share the same semver, so a naive string
replace would corrupt them). This adds a dedicated workflow that triggers on
release-please PRs, runs 'cargo update --package thuki', and commits the
updated Cargo.lock back to the PR branch so the release commit is complete.

Also syncs Cargo.lock to 0.2.1 to clear the unstaged diff left by the
last release.

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
@quiet-node quiet-node force-pushed the worktree-structured-floating-stearns branch from e5c7ed7 to f9436f9 Compare April 6, 2026 00:13
@quiet-node quiet-node changed the title fix: sync Cargo.lock and automate it on future release PRs fix: sync Cargo.lock on release PRs via existing release workflow Apr 6, 2026
@quiet-node quiet-node changed the title fix: sync Cargo.lock on release PRs via existing release workflow fix: sync Cargo.lock on release PRs via release workflow Apr 6, 2026
@quiet-node quiet-node merged commit 18f49a4 into main Apr 6, 2026
3 checks passed
@quiet-node quiet-node deleted the worktree-structured-floating-stearns branch April 6, 2026 00:18
quiet-node added a commit that referenced this pull request Apr 6, 2026
Removes the sync-cargo-lock job and the pr output added in PRs #43-#52.
The release-please action started failing with 'Resource not accessible by
integration' and the sync job is the only change to this workflow in that
window. Reverting to the original two-job workflow to restore stability.

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node added a commit that referenced this pull request Apr 10, 2026
fix: sync Cargo.lock and add workflow to keep it in sync on release PRs

Release-please bumps Cargo.toml via extra-files but cannot safely update
Cargo.lock (many unrelated packages share the same semver, so a naive string
replace would corrupt them). This adds a dedicated workflow that triggers on
release-please PRs, runs 'cargo update --package thuki', and commits the
updated Cargo.lock back to the PR branch so the release commit is complete.

Also syncs Cargo.lock to 0.2.1 to clear the unstaged diff left by the
last release.

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node added a commit that referenced this pull request Apr 10, 2026
fix: sync Cargo.lock and add workflow to keep it in sync on release PRs

Release-please bumps Cargo.toml via extra-files but cannot safely update
Cargo.lock (many unrelated packages share the same semver, so a naive string
replace would corrupt them). This adds a dedicated workflow that triggers on
release-please PRs, runs 'cargo update --package thuki', and commits the
updated Cargo.lock back to the PR branch so the release commit is complete.

Also syncs Cargo.lock to 0.2.1 to clear the unstaged diff left by the
last release.

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node added a commit that referenced this pull request Apr 11, 2026
fix: sync Cargo.lock and add workflow to keep it in sync on release PRs

Release-please bumps Cargo.toml via extra-files but cannot safely update
Cargo.lock (many unrelated packages share the same semver, so a naive string
replace would corrupt them). This adds a dedicated workflow that triggers on
release-please PRs, runs 'cargo update --package thuki', and commits the
updated Cargo.lock back to the PR branch so the release commit is complete.

Also syncs Cargo.lock to 0.2.1 to clear the unstaged diff left by the
last release.

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
This was referenced Apr 11, 2026
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