Repository navigation
Stamp the release version into the npm addon's CLI - #1300
Merged
Merged
Conversation
The release-ci precheck builds the napi addon through the same matrix as the release. A new npm-addon-version job loads the linux-x64 addon and fails when its CLI reports the version committed in packages/rust/Cargo.toml, i.e. when the planned version was never stamped into the crate the CLI reads its version from.
putitoutthere stamps the planned version into a napi crate only when its Cargo.toml sits at the npm package path. Ours lived at packages/ts/napi/Cargo.toml, so the stamp was skipped and the addon's CLI reported the committed core literal 0.2.7. Moving the manifest to packages/ts/Cargo.toml lets the release stamp it and, through the path dependency, the core crate whose version the CLI prints, the same way the maturin path already does for PyPI.
Replaces the npm addon version probe with the one invariant the release depends on, and returns every other file to main so the assertion runs against main's layout.
putitoutthere stamps the planned version into a napi crate only when its Cargo.toml sits at the npm package path. Ours lived in packages/ts/napi, so the stamp was skipped and the addon's CLI reported the committed core literal 0.2.7.
thekevinscott
enabled auto-merge
October 5, 2026 18:32
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.
Fixes #1297
Root cause
npx dirsql --versionprints the coredirsqlcrate'sCARGO_PKG_VERSION, whose committed literal is0.2.7. putitoutthere stamps the planned version in at build time.write-versionruns onpackages/python, whereCargo.tomlsits next topyproject.toml, and walks its path deps into the core crate.write-crate-versionruns for a napi build only whenCargo.tomlsits at the npm packagepath(packages/ts). Ours was atpackages/ts/napi/Cargo.toml, so the step was skipped (::notice::napi: no Cargo.toml at packages/ts — skipping the pre-build crate-version write), and the addon shipped0.2.7.Fix
Move the manifest to
packages/ts/Cargo.toml([lib] pathandbuildstill point intonapi/) and update the paths that name it. The release's existing stamp step then runs, the same way it does for PyPI; the planned version stays the one source of truth.Checked by hand:
npx putitoutthere@latest write-crate-version --path packages/ts --version 9.9.9rewrotepackages/ts/Cargo.tomlandpackages/rust/Cargo.toml, and the addon built from that tree printeddirsql 9.9.9.Test
internals/checks/tests/integration/release_globs_test.pyasserts that the npm package'spathinputitoutthere.tomlholds aCargo.toml, the invariant the stamp step depends on. It lives in the integration tier because that tier reads real repo files and runs in CI; the napi crate's inline tests andpackages/ts/toolstests do not run in CI.Red
Run 37355133357 (commit 2dd2b6e,
internals/checks integration tests):it_keeps_the_napi_manifest_at_the_npm_package_pathfailed against main's layout.Changelog / Migrations
packages/ts/changelog.d/packages/ts/migrations.d/E2E Verification
packages/ts:just e2e-attest-ts, passed, receipt committed.