-
Notifications
You must be signed in to change notification settings - Fork 607
fix: fall back to package.json for CLI version detection #21382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
PhilWindle
merged 1 commit into
merge-train/spartan
from
claudebox/fix-aztec-version-unknown
Mar 12, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ludamad I would ping you about this on slack but at this point I don't know how so asking here.
2 things seem strange to me in this function:
.release-please-manifest.jsonwhich seems strange given that release please is deprecated. Also it doesn't seem to correctly resolve the specific version (e.g. a given nightly) and instead it just resolves the future stable version (e.g. currently 4.3.0 onv4).Given these 2 problems I implemented my own function in this PR that looks as follows:
What this does is that it returns the version from package.json or "dev" string when the code is run froms a checked out monorepo and not a real release.
I think we should replace the
getPackageVersionfunction with my implementation.(and maybe drop the
.release-please-manifest.jsonfile)Would you agree?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI feedback
Agree with the diagnosis, broadly agree with the replacement, but a few wrinkles before wholesale replacing it.
On the diagnosis — yes:
.release-please-manifest.jsoncurrently holds5.0.0in this checkout. That's the next stable target, not the actually-installed/built version. So for nightlies and stable releases the manifest reading is straight-up wrong;package.json(which release tooling stamps at publish time) is the right source.undefinedforces every caller into?? '<fallback>'('','unknown','0.0.0'— all different, none ideal). A typed string is cleaner.Wrinkles to think about before swapping:
Path depth. Your snippet uses
../../../package.jsonbut the existing fallback in this file uses../../package.json. Fordest/update-checker/package_version.jsin the published stdlib package,../../is the package root. Make sure the depth in feat: stamping aztec version into contract artifacts #22550 matches the file's actual location, not a copy-paste from elsewhere.Caller behavior change in dev. Today, in a repo checkout, every caller sees
5.0.0. After the change they'll see'dev'. Mostly fine, butwarn_if_aztec_version_mismatch.tsbuildsexpectedTag = \v${version}`→'vdev'and will then warn on every aztec-nr dep. That caller needs an explicitif (version === DEV_VERSION) return;` guard.Other callers of
?? ''.aztec-node/server.tsetc. compare versions across the network — if the node reports'dev', downstream comparisons should treat that explicitly rather than as "just another version string." Worth a pass.Don't delete
.release-please-manifest.jsonin this PR. Even if release-please is deprecated, that file may still be consumed by current release tooling / GH actions. Confirm it's actually unused first; it's a separate, riskier change from "stop reading it from JS."Naming.
getPackageVersionOrDevis fine, but since you're replacing the canonical one, I'd just keepgetPackageVersion(): string(always-returns-a-string semantics, with'dev'baked in) so callers don't need to know the suffix. The behavior is now "the package version, orDEV_VERSIONfor unstamped checkouts."So: yes, replace it. But fold the dev guard into the version-mismatch warner in the same PR, double-check the path depth, and split off the manifest-file deletion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided to go ahead and tackled this in #22941