mirror of
https://github.com/penpot/penpot.git
synced 2026-11-26 21:00:32 +00:00
📚 Focus Node update guidance
Keep pin and image verification rules while replacing conflicting historical merge advice with version selection by project policy. AI-assisted-by: gpt-6.1-terra
This commit is contained in:
parent
d654d32845
commit
3336aa1bdf
@ -1,28 +1,17 @@
|
||||
# Updating Node Across the Toolchain
|
||||
# Updating Node across the toolchain
|
||||
|
||||
No single source of truth: nothing reads `.nvmrc` at build time, and the version is repeated in a different shape per file. Six sites move together, and the image ones carry a digest beside the tag.
|
||||
No single pin controls every build. Select the target version within the project's Node line unless a major bump is authorized, then align all pin sites. `.nvmrc` currently sets the project line; do not adopt a newer major merely because it appears on another branch.
|
||||
|
||||
## Pin sites
|
||||
|
||||
- `.nvmrc` → `v<X.Y.Z>`, with the leading `v`.
|
||||
- `docker/devenv/Dockerfile`, `setup-node` stage → `ENV NODE_VERSION=v<X.Y.Z>`; downloads `https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-{arm64,x64}.tar.gz`, one tarball per arch, and verifies each against a `NODE_SHA256` right below its `BINARY_URL`. Both hashes come from `SHASUMS256.txt` in that same dist directory, so a bump must recompute the two; only the arch SHAs change, the structure stays.
|
||||
- `docker/images/Dockerfile.mcp` → two stages: `FROM dhi.io/node:<X.Y.Z>-debian13-dev AS build` and `FROM dhi.io/node:<X.Y.Z>-debian13 AS image`. The release stage carries no `-dev`.
|
||||
- `docker/images/Dockerfile.media-processor` and `docker/images/Dockerfile.exporter` → single `FROM dhi.io/node:<X.Y.Z>-debian13-dev`.
|
||||
- `.github/workflows/plugins-deploy-api-doc.yml` and `.github/workflows/plugins-deploy-styles-doc.yml` → `runtime: node@<X.Y.Z>` in the `pnpm/setup` step. Its `working-directory: plugins` makes pnpm's own version come from the manifest, so this pin is the Node one; keep it equal to `.nvmrc` minus the `v`.
|
||||
- DHI tags take the bare version; only the devenv `NODE_VERSION` carries the `v`.
|
||||
- Every `dhi.io` base image in the repo (the node ones above, plus `debian-base` and `nginx`) is pinned by digest: `FROM dhi.io/<image>:<tag>@sha256:<digest>`. Tag and digest are a pair; Renovate's `Update DHI base images` commits rewrite both in one go, so a hand-made tag bump that leaves the digest behind keeps the old image.
|
||||
- `.nvmrc` uses `v<X.Y.Z>`.
|
||||
- `docker/devenv/Dockerfile` sets `NODE_VERSION` with the leading `v` and verifies the Node Linux tarballs for arm64 and x64. Obtain both SHA-256 values from that version's `SHASUMS256.txt` and verify the downloaded artifacts.
|
||||
- `docker/images/Dockerfile.mcp` has a DHI `-dev` build stage and a non-`-dev` release stage. `Dockerfile.media-processor` and `Dockerfile.exporter` use the DHI `-dev` image.
|
||||
- `.github/workflows/plugins-deploy-api-doc.yml` and `plugins-deploy-styles-doc.yml` pin `runtime: node@<X.Y.Z>` in `pnpm/setup`. Use the `.nvmrc` version without `v`; pnpm itself comes from the plugins manifest. For pnpm pins see `mem:workflow/updating-pnpm`.
|
||||
- DHI tags and digests are a pair: update both, or the old digest still selects the old image. Exact-version tags can lag upstream; anonymous access may return 401, so verify availability through an authorized build rather than assuming the tag exists.
|
||||
|
||||
## Gotchas
|
||||
## Merge and verification
|
||||
|
||||
- DHI tags are exact-version and lag the upstream release, and dhi.io answers 401 to anonymous requests, so a tag that does not exist yet can only be caught by a real build. `build-docker.yml` and `build-docker-devenv.yml` log into dhi.io, so the failure surfaces in CI, not locally.
|
||||
- Node 24.x is the Krypton LTS line: take the newest patch of that major unless a major bump is the point.
|
||||
- Renovate also opens these bumps, on `renovate-*` branches and with its config living outside this repo; a manual bump and Renovate's must not diverge on any of the six sites.
|
||||
- A backport merge can deliver a newer Node into `docker/` and the plugins-deploy workflows while main's `.nvmrc` stays behind, because main receives partial backports of `.github/` and `docker/` from develop. Merging main into staging therefore conflicts on the pin lines: take main's set and finish the bump (`.nvmrc` plus the `packageManager` fields via `mem:workflow/updating-pnpm`), or the six sites drift.
|
||||
- The newer version wins in both directions. A maintenance→main merge (`main-2.18.x` into `main`) can carry the newer Node while `.nvmrc` and the `packageManager` fields stay on the older pair; then adopt the newer set and finish the bump on all six sites plus the 35 `packageManager` fields.
|
||||
- Node stays on the 24.x line even when the rest of `.github/` moves on: `99db795966` (`update GitHub Actions`) took the two `plugins-deploy-*` `runtime:` pins to `node@26.13.1` on develop while `.nvmrc` stayed on `v24.22.3`. The project keeps every site on the `.nvmrc` value; resolve that conflict back to the 24.x pin instead of taking develop's.
|
||||
- Both workflows must stay valid YAML. The `python3` in the devenv has no `yaml` module, so validate with `uv run --with pyyaml python3 -c ...` instead of a bare import.
|
||||
|
||||
## Verification
|
||||
|
||||
- `rg '<old version>'` finds nothing outside `CHANGES.md` and untracked scratch files (a repo-wide grep without path filters hits multi-megabyte ClojureScript analyzer caches: always scope it). Grep `dhi\.io/node` as well: a line whose tag moved but whose digest did not still pulls the old image.
|
||||
- After a devenv rebuild, `node --version` matches `.nvmrc` and `pnpm --version` matches `PNPM_VERSION` in `docker/devenv/Dockerfile`.
|
||||
- Backports can update Dockerfiles or workflows without updating `.nvmrc`. Resolve the intended project version across all sites, including both MCP stages, rather than choosing solely by branch direction or highest version.
|
||||
- Validate both plugin deploy workflows as YAML; the devenv Python may lack PyYAML, so use an available YAML validator or `uv run --with pyyaml`.
|
||||
- Search the affected files for the old version and inspect each DHI tag and digest together. After rebuilding the devenv, check `node --version` against `.nvmrc` and `pnpm --version` against its Dockerfile pin. A DHI image change also needs an authorized build to validate the image.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user