Skip to content

feat(upgrade): add mise install channel - #571

Open
afonsojramos wants to merge 2 commits into
nubjs:mainfrom
afonsojramos:feat/upgrade-mise-channel
Open

feat(upgrade): add mise install channel#571
afonsojramos wants to merge 2 commits into
nubjs:mainfrom
afonsojramos:feat/upgrade-mise-channel

Conversation

@afonsojramos

Copy link
Copy Markdown
Contributor

nub upgrade misrouted mise installs: the npm-backend layout contains node_modules, so it hit the npm channel and npm install -g planted a second global copy that shadows the mise shim.

  • Detect both mise layouts (installs/nub/…, installs/npm-nubjs-nub/…) before the node_modules rung.
  • Delegate: mise ls --json <tool> finds the pinning config, mise use --path <config> <tool>@<resolved> installs + rewrites the pin.
  • Canary is not served via mise → standalone-installer hint, like Homebrew/winget.

Unit tests cover both layouts and mise ls parsing; dry-run + real upgrade from a mise install verified manually.

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nub Ready Ready Preview Jul 29, 2026 11:08pm

Request Review

@pullfrog pullfrog 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.

ℹ️ No critical issues — one docs consistency gap worth a look.

Reviewed changes — the initial submission of a new mise install channel for nub upgrade, so a mise-managed nub upgrades through mise itself instead of getting misrouted to npm install -g.

  • Route mise before the node_modules rungdetect_mise_install runs ahead of the Npm check in detect_channel, so the npm-backend layout (…/mise/installs/npm-nubjs-nub/<ver>/…/node_modules/…) classifies as Mise rather than planting a shadowing global copy.
  • Detect both layouts — a pure path-component scan maps the nub and npm-nubjs-nub installs-dir slugs to the mise tool ids nub / npm:@nubjs/nub via mise_tool_for_slug; unknown slugs fall through to Unknown.
  • Delegate the upgrade to miseperform_mise_upgrade reads the pinning config from mise ls --json <tool> (parse_mise_ls_source), resolves latest to a concrete version, then runs mise use --path <config> <tool>@<ver> to install and rewrite the pin.
  • Extend the canary gate — mise joins Homebrew/winget as a stable-only channel, so a canary ask routes to the standalone installer.
  • Tests — pure functions unit-tested for both layouts, npm-backend-over-node_modules precedence, and the mise ls match/fallback/no-source/non-array cases.

I verified the load-bearing mise CLI contracts against jdx/mise's current source: mise ls --json <tool> is a bare array (the tool positional takes an early-return branch), source.path names the pinning config, mise use --path <file> writes the pin to that exact file and installs if missing, npm:@nubjs/nub slugs to npm-nubjs-nub, and the npm backend resolves only from the semver version list so canary genuinely can't be served. The routing logic and its precedence over the node_modules rung are correct. The only gap is a docs update that AGENTS.md requires for a user-facing behavior change.

ℹ️ FAQ still names only Homebrew and winget as stable-only channels

The upgrade FAQ tells canary users that "Homebrew and winget carry only stable releases, so upgrading through them always lands on a release." This PR makes mise a third channel with exactly that behavior — the canary gate now bails on Homebrew | Winget | Mise alike — so the sentence is now incomplete for mise-installed users.

Technical details
# FAQ omits mise from the stable-only upgrade channels

## Affected sites
- `site/content/docs/faq.mdx:414` — "Homebrew and winget carry only stable releases, so upgrading through them always lands on a release." mise is now a stable-only channel too (the canary gate in `crates/nub-cli/src/cli.rs:6040` matches `Homebrew | Winget | Mise`).

## Required outcome
- The sentence names mise alongside Homebrew and winget as a stable-only channel.

## Suggested approach (optional)
- Change to "Homebrew, winget, and mise carry only stable releases, …". Optionally, the upgrade instructions at `faq.mdx:373` ("match how you installed … otherwise re-run your installer") could note that a mise install now upgrades in place via `nub upgrade`, but that is a softer nicety, not a correction.

Pullfrog  | Fix it ➔View workflow run | Using Claude Opus𝕏

@afonsojramos

Copy link
Copy Markdown
Contributor Author

Addressed: the FAQ now names mise alongside Homebrew and winget as a stable-only channel, and the upgrade answer notes that a mise-managed install upgrades in place via nub upgrade (delegating to mise and rewriting the pin). Also rebased onto main — the previous musl Docker smoke failure was a cancelled image build at the 35-minute timeout, unrelated to this change; the fresh run should clear it.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes — the delta since the prior pullfrog review is the docs commit that closes out that review's sole finding, plus a rebase of the feature commit onto current main.

  • Named mise among the stable-only upgrade channels — the canary paragraph now reads "Homebrew, winget, and mise carry only stable releases", matching the canary gate in crates/nub-cli/src/cli.rs:6114, which bails on Homebrew | Winget | Mise { .. } alike.
  • Documented the in-place mise upgrade path — the upgrade answer now tells a mise-managed install to use nub upgrade, which delegates to mise and rewrites the version pin, rather than leaving it under the generic "re-run your installer".
  • Rebased the feature commit onto main85ae7bb4 is a byte-identical replay of the previously reviewed 35da9444 (same single file, same +294/-9), so the mise routing, mise ls --json parsing, and mise use --path delegation carry no code delta.

I re-verified both new sentences against the implementation rather than the PR description: the canary claim matches the gate's matches! arm, and the pin-rewrite claim matches perform_mise_upgrade running mise use --path <config> <tool>@<version>. I also swept the rest of the docs for stale channel copy — site/content/docs/faq.mdx is the only page carrying channel-specific upgrade guidance, and the mise use -g nub / mise use nub@latest snippets in docs/index.mdx, README.md, and docs/deployment/index.mdx all install the registry nub tool, whose installs-dir slug detect_mise_install already covers.

Pullfrog  | View workflow run | Using Claude Opus𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant