Skip to content

Add bump-version script to keep release version refs in sync#218

Merged
danieljohnmorris merged 2 commits into
mainfrom
feature/bump-version-script
May 13, 2026
Merged

Add bump-version script to keep release version refs in sync#218
danieljohnmorris merged 2 commits into
mainfrom
feature/bump-version-script

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

Caught while loading project context: AGENTS.md still said 0.8.0 and .claude-plugin/plugin.json was at 0.8.0 even though Cargo.toml is at 0.10.3. The release process documented only step 1 as 'bump version in Cargo.toml', so every release since 0.8 has drifted these.

Fixes the drift and prevents recurrence by adding scripts/bump-version.sh X.Y.Z that rewrites the version in:

  • Cargo.toml
  • AGENTS.md (the "Current version: **X.Y.Z**" line)
  • .claude-plugin/plugin.json
  • .claude-plugin/marketplace.json

Then runs cargo update -p ilo --precise X.Y.Z to refresh Cargo.lock. npm/ and pi/ are already bumped from the git tag by CI, so they don't need to be in the script.

AGENTS.md release-process step 1 now calls the script instead of pointing at Cargo.toml alone.

What's in the diff

Commit 1 - add scripts/bump-version.sh to keep release version refs in sync

  • scripts/bump-version.sh: awk-based line replacement (line-based JSON edit to avoid reflowing keys or escaping unicode). Validates X.Y.Z shape, refuses to run outside the repo root, warns if cargo update fails before falling back to cargo check.
  • tests/bump_version_script.rs: runs the script with a 9.99.99 sentinel against the live working-tree files, asserts the sentinel landed in every target, uses a Drop guard to restore the four targets plus Cargo.lock so a panic never leaks the sentinel. Second test asserts bad input is rejected.
  • AGENTS.md: release-process step 1 now calls the script.

Commit 2 - sync stale version refs to 0.10.3

  • Ran the new script with 0.10.3 to bring the four files in line. Also adds a trailing newline to both JSON files.

Repro

Before:

```
$ grep -nE '"version"|Current version' Cargo.toml AGENTS.md .claude-plugin/*.json
Cargo.toml:3:version = "0.10.3"
AGENTS.md:7:- Current version: 0.8.0 ...
.claude-plugin/marketplace.json:13: "version": "0.10.3",
.claude-plugin/plugin.json:4: "version": "0.8.0",
```

After: all four read 0.10.3. Running scripts/bump-version.sh 0.11.0 would move all four (and Cargo.lock) to 0.11.0 in one command.

Test plan

  • `cargo test --test bump_version_script` (both new tests pass)
  • `cargo test --release --features cranelift` (full suite: 67 test binaries, all green)
  • `cargo fmt --check`
  • `cargo clippy --tests --features cranelift -- -D warnings`
  • Manual: ran the script with a sentinel, confirmed only the four targets diff, confirmed restore-on-panic by deliberately breaking the assert during dev

Follow-ups

None.

One command rewrites Cargo.toml, AGENTS.md, .claude-plugin/plugin.json,
and .claude-plugin/marketplace.json, then refreshes Cargo.lock via
cargo update. npm/ and pi/ are still bumped from the git tag by CI.

Updates the release-process docs in AGENTS.md to call the script in
step 1 instead of hand-editing Cargo.toml.

Regression test runs the script with a sentinel version, confirms it
lands in every target, and uses a drop guard to restore originals so
the working tree never leaks the sentinel.
AGENTS.md still claimed 0.8.0 and .claude-plugin/plugin.json was at
0.8.0 while Cargo.toml is at 0.10.3. Ran the new bump script against
the current version to bring them in line. Also adds trailing newlines
to the two JSON files.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris merged commit 912f7c4 into main May 13, 2026
5 checks passed
@danieljohnmorris danieljohnmorris deleted the feature/bump-version-script branch May 13, 2026 11:34
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