Skip to content

build(bootstrap): use mise to manage Node.js and pnpm - #1109

Merged
marcusds merged 9 commits into
mainfrom
astd-148-mise-nodejs-pnpm-bootstrap/mschwab
Aug 7, 2026
Merged

build(bootstrap): use mise to manage Node.js and pnpm#1109
marcusds merged 9 commits into
mainfrom
astd-148-mise-nodejs-pnpm-bootstrap/mschwab

Conversation

@marcusds

@marcusds marcusds commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Bootstrap previously assumed Node.js and pnpm were already on PATH. This routes both through mise so a fresh checkout works without nvm, corepack, or a system Node.

  • Add mise.toml pinning node to 22.23.2 — the version .nvmrc already names — and pnpm to 10 (resolves to 10.34.5). web/package.json constrains node on both ends, while pnpm only has a floor.
  • New verify-mise target: installs mise (if absent) at a pinned MISE_VERSION, then mise install --yes. Non-interactive, so it works in CI and on fresh developer machines without prompts.
  • verify-pnpm, verify-node-version, bootstrap-studio, and update-web-sdk invoke node/pnpm through mise exec --, so they use the mise-managed versions regardless of what the caller has on PATH.
  • script/verify-node-version.sh still owns the engine-strict check and its diagnostics; it just runs under mise exec -- now. Its corepack-enable fallback and missing-binary branches are unreachable under mise and have been dropped.
  • NMP_SKIP_MISE=1 bootstraps against the toolchain already on PATH instead (airgapped installs, nix shells, distro packages). Engines are enforced either way.
  • Nothing is written to your shell rc. SETUP.md documents mise exec -- / mise activate for running pnpm directly in web/.

Ported from NVIDIA-NeMo/Platform#530, adapted to this repo's script/verify-node-version.sh bootstrap path.

Linear: ASTD-148

Test plan

Verified on a brand-new Ubuntu 26.04 LTS (aarch64) VM with no node, no pnpm, and no mise installed — git and curl were preinstalled; make was installed via apt-get install make as a prerequisite:

  • git clone this branch, then make bootstrap-studio — mise installs to ~/.local/bin/mise, resolves node 22.23.2 and pnpm 10.34.5 from mise.toml, installs web deps and builds Studio assets. Exit 0, 20 MB of assets in web/packages/studio/dist including index.html.
  • make verify-node-version alone — exit 0, engine-strict check passes against web/package.json.
  • mise exec -- node --versionv22.23.2; mise exec -- pnpm --version10.34.5.
  • make verify-node-version NMP_SKIP_MISE=1 on that VM (no pnpm anywhere) — fails with an actionable message naming both toolchain paths rather than a bare Error 127.
  • Same fresh-machine run on macOS (arm64) after deleting mise entirely and stripping node/pnpm from PATH — pinned installer fetches exactly MISE_VERSION, full bootstrap-studio exits 0.
  • mise install succeeds without mise trust, confirming a [tools]-only mise.toml is trust-exempt.

Summary by CodeRabbit

  • New Features

    • Added automated setup using pinned Node.js and pnpm versions.
    • Added checks to verify required development tools are available.
    • Added an option to use an existing toolchain instead.
  • Documentation

    • Updated Studio and web development setup instructions.
    • Clarified tool activation, dependency installation, and development commands.
    • Improved guidance for missing tools, version compatibility, and bootstrap recovery.

@github-actions github-actions Bot added the build conventional-commit type label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 31260/39870 78.4% 62.8%
Integration Tests 18204/37822 48.1% 20.6%

@marcusds
marcusds marked this pull request as ready for review August 6, 2026 04:30
@marcusds
marcusds requested review from a team as code owners August 6, 2026 04:30
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR pins Node.js and pnpm in mise.toml, adds mise-based Makefile verification and execution, updates tool availability checks, and revises repository and web setup guidance.

Changes

Mise-managed Studio toolchain

Layer / File(s) Summary
Pinned toolchain and mise setup
mise.toml, Makefile
Node.js and pnpm versions are pinned. Makefile targets install mise, install the pinned tools, and support NMP_SKIP_MISE=1.
Toolchain validation and command execution
Makefile, script/verify-node-version.sh
pnpm and Node.js checks use the selected toolchain. SDK generation and Studio bootstrap commands run through MISE_EXEC.
Setup and repository guidance
AGENTS.md, SETUP.md, web/AGENTS.md, web/README.md
Documentation describes mise activation, manual setup, bypass behavior, compatible versions, and the updated Studio workflow.

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Makefile
  participant mise
  participant VerifyScript as verify-node-version.sh
  participant pnpm
  Developer->>Makefile: make bootstrap-studio
  Makefile->>mise: verify and install pinned tools
  Makefile->>VerifyScript: validate node and pnpm
  VerifyScript-->>Makefile: return tool status
  Makefile->>pnpm: install dependencies
  Makefile->>pnpm: build Studio assets
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: using mise to manage Node.js and pnpm during bootstrap.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch astd-148-mise-nodejs-pnpm-bootstrap/mschwab

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
mise.toml (1)

3-3: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Use an exact pnpm version.

Line 3 uses pnpm = "10", a fuzzy major selector. web/package.json declares pnpm@10.34.5, so mise install can select another 10.x release and make the toolchain drift. Use pnpm = "10.34.5" if this PR promises a reproducible package manager. If the major-wide range is intentional, commit a mise lockfile and document that contract. Mise documents major-only selectors as fuzzy. (mise.jdx.dev)

Proposed fix
 node = "22.23.2"
-pnpm = "10"
+pnpm = "10.34.5"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@mise.toml` at line 3, Pin the pnpm version in the mise configuration from the
fuzzy major selector to the exact version declared by web/package.json, 10.34.5,
so the package-manager toolchain remains reproducible.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 212-214: Update the mise installation block in the Makefile to
download a pinned installer or artifact, verify its signature or checksum, and
permit only HTTPS redirects before execution. Keep the existing MISE_VERSION
selection while replacing direct execution of the unverified curl pipeline.

In `@script/verify-node-version.sh`:
- Around line 10-14: Update the missing-tool message in the node/pnpm validation
loop to account for NMP_SKIP_MISE=1: when the bypass is enabled, report that the
script is using the PATH-based toolchain and provide generic PATH recovery
guidance instead of mise-specific instructions; retain the existing mise-managed
message for the default mode.

In `@web/README.md`:
- Line 20: Update the README statement about Make targets to say they use
mise-managed versions by default, and document the supported NMP_SKIP_MISE=1
bypass command without changing the surrounding setup guidance.
- Around line 7-20: Update web/README.md lines 7-20 to present the mise-managed
and manual Node.js/pnpm installation workflows as separate tabs. Update SETUP.md
lines 102-115 to present one-off execution, shell activation, and
NMP_SKIP_MISE=1 workflows as separate tabs, preserving each workflow’s existing
instructions.
- Around line 7-18: Update the setup instructions in web/README.md (lines 7-18),
SETUP.md (lines 100-113), and web/AGENTS.md (line 35) to add $HOME/.local/bin to
PATH before invoking mise, or invoke mise via its absolute path; ensure all
documented mise activate and mise exec commands work from a fresh shell.

---

Nitpick comments:
In `@mise.toml`:
- Line 3: Pin the pnpm version in the mise configuration from the fuzzy major
selector to the exact version declared by web/package.json, 10.34.5, so the
package-manager toolchain remains reproducible.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 80019fb8-0431-42b3-bff6-13b95ccfed19

📥 Commits

Reviewing files that changed from the base of the PR and between 73670d7 and cffffdb.

📒 Files selected for processing (7)
  • AGENTS.md
  • Makefile
  • SETUP.md
  • mise.toml
  • script/verify-node-version.sh
  • web/AGENTS.md
  • web/README.md

Comment thread Makefile
Comment thread script/verify-node-version.sh Outdated
Comment thread web/README.md
Comment thread web/README.md Outdated
Comment thread web/README.md Outdated
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Bootstrap previously assumed Node.js and pnpm were already on PATH.
Replace the `verify-pnpm` / `verify-node-version` shell-check path with
a `verify-mise` target that installs mise (if absent) and resolves
`node@22` / `pnpm@10` from a new `mise.toml`. Subsequent bootstrap
steps invoke node and pnpm via `mise exec --` so they pick up the
mise-managed versions regardless of what the caller already has on
PATH.

`mise trust --all --silent` runs before `mise install --yes` so the
target is non-interactive in CI and on fresh developer machines.

Signed-off-by: mschwab <mschwab@nvidia.com>
…tation

`make update-web-sdk` previously called `cd web && pnpm gen` and assumed
pnpm was on PATH — same fresh-checkout gap this branch fixes for the
Studio bootstrap path. Make it depend on `verify-mise` and run pnpm via
`$(MISE_EXEC)`.

Also drop the `setup-mise-shell` target that appended `mise activate` to
the developer's shell rc. It's invasive for what's only needed when a
dev wants direnv-style auto-activation; the bootstrap and pre-commit
paths already route through `mise exec --`, and `mise` itself prints
the activation hint after its own installer runs.

Signed-off-by: mschwab <mschwab@nvidia.com>
…de-version

The script now runs under `mise exec --`, so node and pnpm are always
present. The corepack-enable fallback and the separate missing-binary
branches can never fire. Replace them with one guard that points at
`make verify-node-version` for the case where someone runs the script
directly, outside the mise-managed PATH.

Signed-off-by: mschwab <mschwab@nvidia.com>
`mise trust --all` walked ancestor directories as well as the repo, so it
silently trusted any mise config above the checkout. It was also never
needed: a mise.toml holding only [tools] is trust-exempt, and `mise
install` runs clean without it.

Pin the installer with MISE_VERSION so `make bootstrap` can't pull an
arbitrary release off mise.run, and add NMP_SKIP_MISE=1 for bootstrapping
against a toolchain that is already on PATH (offline installs, nix
shells, distro packages). web/package.json engines are enforced either
way.

Also drop the stale `pnpm env use --global` advice from the bootstrap
failure message and document the mise workflow in SETUP.md, including
that direct `pnpm` use in web/ needs `mise exec --` or `mise activate`.

Signed-off-by: mschwab <mschwab@nvidia.com>
…issing

With NMP_SKIP_MISE=1 on a machine without pnpm, verify-pnpm failed with
make's bare `Error 127`. The guidance in verify-node-version.sh never
printed because verify-pnpm runs first. Catch the failure and say which
of the two toolchain paths is in play.

Signed-off-by: mschwab <mschwab@nvidia.com>
web/README.md still told developers to install Node.js 22 from
nodejs.org and `npm install -g pnpm`. Replace that with the two
supported options: let mise manage the versions pinned in mise.toml, or
install node and pnpm yourself. Note that the make targets use the
mise-managed versions either way, and fix the `pnpm dev` working
directory to match web/AGENTS.md.

Also drop the stale "upgrade Node on the VM" advice from the Cursor
Cloud notes and point agents at mise from web/AGENTS.md.

Signed-off-by: mschwab <mschwab@nvidia.com>
`node = "22"` resolved to whatever the latest 22.x was at install time,
so two developers bootstrapping months apart could land on different
patches. web/package.json constrains node on both ends
(`>=22.23.2 <23`), so pin it to the same 22.23.2 that .nvmrc already
names. pnpm stays fuzzy — engines only sets a floor for it.

Signed-off-by: mschwab <mschwab@nvidia.com>
Review follow-ups:

- Pin pnpm to 10.34 so the package manager can't drift across a minor
  while still picking up patch releases. node stays exact because
  web/package.json constrains it on both ends.
- mise installs to ~/.local/bin, which isn't on PATH by default on
  macOS, so `mise activate` and `mise exec` fail on a fresh shell.
  Say so in web/README.md, SETUP.md, and web/AGENTS.md.
- verify-node-version.sh told users to run `make verify-node-version`
  when a tool was missing, which is the target that just failed, and it
  claimed a mise-managed toolchain even under NMP_SKIP_MISE=1. Branch on
  the bypass and point at `make verify-mise` otherwise.
- web/README.md said the make targets "always" use mise-managed
  versions, contradicting NMP_SKIP_MISE=1.

Signed-off-by: mschwab <mschwab@nvidia.com>
@marcusds
marcusds force-pushed the astd-148-mise-nodejs-pnpm-bootstrap/mschwab branch from 3e52511 to c33e867 Compare August 6, 2026 07:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 203-204: Quote the MISE executable path in the Makefile so paths
containing spaces remain a single shell word. Update both the MISE_EXEC command
construction and the direct “mise install --yes” invocation, preserving the
existing NMP_SKIP_MISE behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 62dd138f-950e-424a-9221-b903e30972bb

📥 Commits

Reviewing files that changed from the base of the PR and between a1b7051 and 3e52511.

📒 Files selected for processing (7)
  • AGENTS.md
  • Makefile
  • SETUP.md
  • mise.toml
  • script/verify-node-version.sh
  • web/AGENTS.md
  • web/README.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • mise.toml
  • script/verify-node-version.sh
  • web/AGENTS.md
  • AGENTS.md
  • web/README.md
  • SETUP.md

Comment thread Makefile Outdated
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

MISE resolves to `command -v mise` or $HOME/.local/bin/mise, either of
which can contain spaces. The existence guards already quoted it, but
the two invocation sites did not, so a home directory with a space split
the path into separate shell words and bootstrap failed with a
misleading "No such file or directory".

Signed-off-by: mschwab <mschwab@nvidia.com>
@marcusds
marcusds added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Aug 6, 2026
@marcusds
marcusds added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 5751403 Aug 7, 2026
52 checks passed
@marcusds
marcusds deleted the astd-148-mise-nodejs-pnpm-bootstrap/mschwab branch August 7, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build conventional-commit type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants