Skip to content

chore: drive release-please version bumps from inline markers - #159

Merged
alukach merged 4 commits into
mainfrom
chore/release-please-version-markers
Sep 28, 2026
Merged

alukach merged 4 commits into
mainfrom
chore/release-please-version-markers

Conversation

@alukach

@alukach alukach commented Sep 25, 2026

Copy link
Copy Markdown
Member

What I'm changing

release-please-config.json carried seven separate JSONPath entries, one per internal crate, just to keep the version pins under [workspace.dependencies] in step with the workspace version. Adding a crate meant remembering to add an eighth entry in a file nowhere near the manifest; forgetting it leaves the new crate's pin behind at the old version, which cargo publish then rejects or, worse, resolves to a stale release from crates.io.

I first tried dropping the pins entirely, since every member uses version.workspace = true. Cargo does not allow that: both 1.92 and stable 1.98 refuse to package a path dependency without a version ("all dependencies must have a version requirement specified when packaging"). So the pins stay, and the config is collapsed instead.

Stacked on #158 (both PRs edit the same extra-files array).

How I did it

  • Cargo.toml: each of the eight lines release-please must bump ([workspace.package] version plus the seven internal pins) ends with # x-release-please-version. The marker sits on the line it governs, so a new crate's entry is a copy of its neighbor and cannot be forgotten in a separate file.
  • release-please-config.json: the seven toml/JSONPath entries for Cargo.toml become a single {"type": "generic", "path": "Cargo.toml"} entry. The generic updater replaces the first semver-looking string on any line carrying the marker and leaves every other line untouched, including rust-version once chore: adopt workspace lints, declare MSRV, lint Workers crates in CI #154 lands (no marker there).
  • CONTRIBUTING.md: one paragraph on adding a workspace crate: pin the version (cargo requires it) and add the marker.
  • .github/workflows/release.yml is unchanged. Its sed that re-pins from the tag on publish still matches these lines and remains a useful belt-and-braces for tag-driven pre-releases.

Verified with release-please's actual Generic updater (v17.9.0) run against this manifest: exactly the eight marked lines change, cargo metadata still parses the file, and cargo check --locked passes after applying both updaters at a simulated 0.7.3.

Test plan

  • release-please Generic updater dry run: 8 lines changed, all marked, nothing else
  • cargo metadata --no-deps on the annotated manifest
  • cargo check --locked before and after a simulated release bump through both updaters

🤖 Generated with Claude Code

alukach and others added 2 commits September 25, 2026 08:54
release-please bumped every workspace crate's version in Cargo.toml but
never touched Cargo.lock, so the lockfile went stale on each release
(main carried 0.7.1 entries against a 0.7.2 manifest until the next
cargo invocation happened to rewrite it). Nothing caught it because CI
ran without --locked.

The release PR now also rewrites the lock entries: a TOML extra-file
whose JSONPath selects every `[[package]]` without a `source`, which is
exactly the set of workspace members (registry and VCS dependencies all
carry one). The check job runs `cargo check --locked`, so a stale
lockfile fails CI instead of silently regenerating.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Seven JSONPath entries in release-please-config.json existed only to keep
the internal `[workspace.dependencies]` version pins in step with the
workspace version. A new crate had to be remembered in that file or its
pin would be left behind. Dropping the pins is not an option: cargo (1.92
and stable 1.98 alike) refuses to package a path dependency without a
version.

Each of the eight lines now ends with `# x-release-please-version`, and
the config has a single `generic` entry for Cargo.toml. The marker sits on
the line it governs, so a new crate's entry is a copy of its neighbour.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@claude

claude Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Claude finished @alukach's task in 1m 19s —— View job


Review complete

  • Gather context (PR diff, changed files)
  • Review Cargo.toml marker changes
  • Review release-please-config.json generic updater config
  • Review CONTRIBUTING.md update
  • Apply ponytail-review pass
  • Post final review

✅ No blocking issues — safe to merge.

Verified the mechanics:

  • Cargo.toml: the # x-release-please-version marker is appended after the closing }/quote on all 8 lines ([workspace.package] version + 7 internal crate pins), so it's a trailing comment and doesn't change what Cargo parses — cargo metadata/cargo package still see a normal version = "..." field.
  • .github/workflows/release.yml's sed patterns (^version = ".*" and the multistore[a-z-]* = {.*version = " capture) both stop at the first/last " on the line, so the appended comment doesn't interfere with the tag-driven re-pin on publish.
  • release-please-config.json collapses the 7 per-crate toml/JSONPath entries into a single {"type": "generic", "path": "Cargo.toml"} entry, leaving the Cargo.lock toml entry untouched — valid JSON, and consistent with how release-please's Generic updater keys off the x-release-please-version line comment.
  • CONTRIBUTING.md addition correctly instructs future crate additions to pin version (required for cargo publish of a path dependency) and add the marker on that same line.
  • No docs/ references to release-please-config.json or the old JSONPath entries were found, so no additional doc updates are needed.

Nothing else in the diff touches code paths, dependencies, or CI permissions.

Simplify (ponytail) — none. This PR is itself the simplification (7 JSONPath entries → 1 generic entry); no new abstractions, dependencies, or boilerplate introduced.


💰 Estimated review cost: $0.23 · 1m19s · 13 turns

The previous commit's manifest was produced by a local release
simulation and seven dependency pins were not reset to 0.7.2, which
breaks resolution (path crates are 0.7.2). Squash on merge.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🚀 Latest commit deployed to https://multistore-proxy-pr-159.development-seed.workers.dev

  • Date: 2026-09-25T16:01:05Z
  • Commit: ab8b512

Base automatically changed from chore/lockfile-release-sync to main September 25, 2026 15:57
@alukach
alukach marked this pull request as ready for review September 25, 2026 16:01
@alukach
alukach merged commit e855d36 into main Sep 28, 2026
17 checks passed
@alukach
alukach deleted the chore/release-please-version-markers branch September 28, 2026 23:31

This branch was successfully deployed

1 active deployment
preview — 5c49c45a Deployed Sep 25, 2026 by alukach via Deploy & Test / Deploy #458
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant