Skip to content

Commit 54564b4

Browse files
authored
fix(release-image): stamp stdlib/package.json with release version (#23393)
## Summary The aztec node Docker image was returning `"dev"` from `getNodeVersion()` in 4.3.0-rc.1. Root cause: PR #22941 switched `getPackageVersion()` to read the version from `yarn-project/stdlib/package.json`, but `release-image/Dockerfile` was only updated to stamp `.release-please-manifest.json` (which the old implementation consumed). `stdlib/package.json` kept the `0.1.0` placeholder inside the image, which `getPackageVersion()` substitutes with `DEV_VERSION` (`"dev"`). This adds a second stamp step in the Dockerfile that rewrites `.version` in `yarn-project/stdlib/package.json` using `jq` (already installed in the release-image base). The existing `.release-please-manifest.json` stamp is left alone for now since other tooling may still consume it. Only `stdlib/package.json` needs stamping for the version-reporting bug: `getPackageVersion()` resolves `../../package.json` from `stdlib/dest/update-checker/`, so it always reads the stdlib package regardless of which CLI invokes it (`aztec --version`, `getNodeVersion`, contract-artifact stamping, etc). The npm publish path is unaffected — `ci3/deploy_npm` already calls `ci3/release_prep_package_json` before `npm publish`, so npm consumers got the correct version all along. The Docker path was the only release surface that missed the rename. ## Test plan - [ ] CI release-image build passes with the new `RUN jq …` step. - [ ] Run the resulting image with `VERSION=4.3.0-rc.X` and confirm `aztec --version` and a node's `getNodeVersion` RPC both return the stamped version instead of `"dev"`.
2 parents 1e50f24 + 75fd494 commit 54564b4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

release-image/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ WORKDIR "/usr/src/yarn-project"
1818
# Ensure the correct version shows in aztec --version
1919
ARG VERSION
2020
RUN echo '{".": "'$VERSION'"}' > /usr/src/.release-please-manifest.json
21+
# Stamp the version into stdlib/package.json, which getPackageVersion() reads at runtime.
22+
RUN jq --arg v "$VERSION" '.version = $v' /usr/src/yarn-project/stdlib/package.json > /tmp/p.json \
23+
&& mv /tmp/p.json /usr/src/yarn-project/stdlib/package.json
2124

2225
ENTRYPOINT ["node", "--no-warnings", "/usr/src/yarn-project/aztec/dest/bin/index.js"]

0 commit comments

Comments
 (0)