Repository navigation
Single-source version bump: derive manifests and lockfiles from Cargo.toml - #173
Merged
Merged
Conversation
….toml Add scripts/sync-version.sh, which reads [workspace.package] version and writes it to the internal ontographia-* workspace dependencies, both npm manifests, the workspace packages in Cargo.lock, and the root version fields of bindings/typescript/package-lock.json. It is idempotent and needs no network. bump-version.sh now sets the workspace version and runs the sync; verify-release-version.sh also checks both lockfiles. scripts/test-version-sync.sh exercises bump, idempotence, a Cargo.toml-only edit, stale-lockfile detection, and the per-file diff shape on a temporary copy; CI runs it in the rust job. docs/release.md and the script READMEs describe the new flow. Closes #172
yohei1126
commented
Nov 14, 2026
yohei1126
left a comment
Collaborator
Author
There was a problem hiding this comment.
Model check
Results
- Model: Gemini 4 Argon (
gemini-4-argon-medium) - Remaining model quota could not be read before this check.
- Reviewed head:
6240235f4ac547901a13deaaab2e793428ff2eb4 - Verdict: PASS
- Findings by severity: 0 blocker / 0 major / 0 minor / 2 nit
Findings
- [nit]
bindings/wasm/README.md:123lockfile wording: The sentence saysscripts/sync-version.shcopies the workspace version to "both npm manifests and their lockfiles", which could be read as implyingbindings/wasmhas apackage-lock.json. In practice, the two lockfiles updated areCargo.lockandbindings/typescript/package-lock.json. - [nit]
scripts/sync-version.sh:57-70signal cleanup: Every error branch andreport()removes its temporary file, so normal runs and malformed inputs leave no temp files behind, but unlikescripts/test-version-sync.shthere is notraponEXIT HUP INT TERMif a signal interruptsawkornodemid-run.
Notes
scripts/sync-version.shstrictly validates semver before passing the version string toawkornode, rewrites only the internalontographia-*entries in[workspace.dependencies], the workspace (source-less) package blocks inCargo.lock, the two npm manifests, and the two root version fields inbindings/typescript/package-lock.json, and leaves unchanged files untouched.- In
release.yml,preflight(withactions/setup-nodeNode 22) runsscripts/verify-release-version.shbeforecreate-releaseandverify, and GitHub-hostedubuntu-latestimages include Node.js onPATHfor the secondverify-release-version.shcall inverify(and fortest-version-sync.shin theci.ymlrustjob). - This is a review comment, not an approval, and the PR draft state is unchanged.
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.
Closes #172
Summary
Make
Cargo.toml[workspace.package] versionthe only value a person edits. Everything else is derived from it by one idempotent, offline step.scripts/sync-version.sh(new, no arguments): reads the workspace version and writes it to the internalontographia-*entries in[workspace.dependencies],bindings/typescript/package.json,bindings/wasm/package.json, the workspace packages inCargo.lock(blocks withoutsource; registry packages untouched), and the top-levelversion/packages[""].versionofbindings/typescript/package-lock.json. Each file is rewritten only when its content changes; a second run reports every file as already at the version.scripts/bump-version.sh <X.Y.Z>: sets only[workspace.package] version, then runssync-version.sh. Existing options keep working;--commitstages all five files.scripts/verify-release-version.shstays the check and now also fails when aCargo.lockworkspace package or eitherpackage-lock.jsonversion differs from the workspace version, pointing toscripts/sync-version.sh. It readspackage-lock.jsonwithnode(present on every runner that calls it:ubuntu-latestinrelease.yml, andsetup-nodeinpreflight-release.yml).scripts/test-version-sync.sh(new) works on a temporary copy of the working tree: bump to a test version and check all five files plusverify-release-version.sh; run the sync again and assert nothing changed; edit onlyCargo.tomland assert propagation; make each lockfile stale and assertverify-release-version.shfails with the file-specific message; assert the per-file changed-line counts equal the 0.1.8 → 0.1.9 bump (Cargo.toml 4, Cargo.lock 8, package.json 1, wasm package.json 1, package-lock.json 2);cargo metadata --locked --offlinestill loads the lock.bash scripts/test-version-sync.shadded to the existingrustjob. Nopermissions:change, no release workflow change.docs/release.md(flow, version bumps, full release, version table),scripts/README.md,bindings/wasm/README.md, and the hint strings inbindings/wasm/scripts/build-package.shandscripts/package-npm.mjs.The repository version stays 0.1.9 in this PR.
Verification (macOS arm64, bash 3.2.57)
bash scripts/test-version-sync.shversion sync test okbash scripts/sync-version.sh(real tree)already 0.1.9, no changebash scripts/verify-release-version.sh v0.1.9release version ok: 0.1.9 (npm 0.1.9, wasm 0.1.9, Cargo.lock, package-lock.json)bash scripts/bump-version.sh 0.1.10 --no-testsync-version.shchanges nothing;verify-release-version.sh v0.1.10okshellcheckon the four scriptsbash scripts/docs_check.shdocs check okcargo test --workspaceNotes
EXPECTED_CARGO_TOML_LINES/EXPECTED_CARGO_LOCK_LINESin the test.scripts/bump-version.sh 0.1.10and compared.