Add bump-version script to keep release version refs in sync#218
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Caught while loading project context:
AGENTS.mdstill said0.8.0and.claude-plugin/plugin.jsonwas at0.8.0even thoughCargo.tomlis at0.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.Zthat rewrites the version in:Cargo.tomlAGENTS.md(the "Current version: **X.Y.Z**" line).claude-plugin/plugin.json.claude-plugin/marketplace.jsonThen runs
cargo update -p ilo --precise X.Y.Zto refreshCargo.lock.npm/andpi/are already bumped from the git tag by CI, so they don't need to be in the script.AGENTS.mdrelease-process step 1 now calls the script instead of pointing atCargo.tomlalone.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). ValidatesX.Y.Zshape, refuses to run outside the repo root, warns ifcargo updatefails before falling back tocargo check.tests/bump_version_script.rs: runs the script with a9.99.99sentinel against the live working-tree files, asserts the sentinel landed in every target, uses aDropguard to restore the four targets plusCargo.lockso 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
0.10.3to 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. Runningscripts/bump-version.sh 0.11.0would move all four (andCargo.lock) to0.11.0in one command.Test plan
Follow-ups
None.