Skip to content

provision-node input; README recipe and smoke job for running beside actions/setup-node - #11

Merged
colinhacks merged 5 commits into
mainfrom
route-installs
Sep 16, 2026
Merged

colinhacks merged 5 commits into
mainfrom
route-installs

Conversation

@colinhacks

@colinhacks colinhacks commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Adds provision-node (default true). With false the Node provision step is skipped: nothing is fronted on PATH and the node-version output is empty, for a job where actions/setup-node already put the wanted Node on PATH. nub still resolves the project's pin at its own invocation.

README gains a "Beside setup-node" recipe: keep actions/setup-node, add setup-nub with provision-node: false, replace npm ci with nub install --frozen-lockfile. A smoke job proves it on ubuntu, macOS and Windows against a .nvmrc that disagrees with setup-node's version.

A package-manager name as the cache value no longer prints a notice.

nubjs/setup-node builds on this input.

Copilot AI lite review requested due to automatic review settings September 8, 2026 17:11
@pullfrog

pullfrog Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Run failed. View the logs →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Opus | 𝕏

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

Only a minor documentation grammar issue was found; the functional changes are small and are covered by the updated smoke workflow.

Pull request overview

This PR updates setup-nub’s optional package-manager shim behavior so that, when enabled, bare npm ci / npm install can be routed through Nub’s engine (while all other package-manager invocations keep using the pinned/real tools), and documents/tests that behavior.

Changes:

  • Update shim: true to run nub pm shim --route-installs and emit a notice when the installed nub doesn’t support install routing.
  • Rewrite README guidance around an additive migration (keep actions/setup-node, add setup-nub, don’t change workflow commands).
  • Extend the smoke workflow to assert the routed vs non-routed behavior via a shim marker file.
File summaries
File Description
README.md Updates documentation for routed npm ci/npm install behavior under shim: true.
action.yml Passes --route-installs to nub pm shim and prints a notice when routing isn’t enabled.
.github/workflows/smoke.yml Adds a smoke test that verifies the routed vs non-routed npm ci behavior.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md Outdated
With `shim: true`, the action runs `nub pm shim` and puts the shim directory first on PATH. In a project that pins a package manager (`packageManager` or `devEngines.packageManager`), `npm`, `pnpm`, and `yarn` in later steps run that pinned version, provisioned on demand, the same job corepack does. In an unpinned project they fall through to the runner's own tool. The shims do not route those commands into Nub's own installer; use `nub install` for that.
With `shim: true`, the action runs `nub pm shim --route-installs` and puts the shim directory first on PATH. Two things follow for later steps.

A bare `npm ci` or `npm install` in a project with a `package-lock.json` runs on Nub's engine, from that lockfile, with the flags npm's own CI invocations carry (`--ignore-scripts`, `--omit=dev`, `--no-audit`, `--no-fund`) translated or accepted. Nothing else in the workflow changes: `npm test`, `npm run`, `npx`, an install with a package name, and an install carrying a flag Nub does not translate all run the real npm as typed. So adding the action next to `actions/setup-node` is the whole migration:
@pullfrog

pullfrog Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Run failed. View the logs →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Opus | 𝕏

@colinhacks colinhacks changed the title shim: true routes npm ci and npm install through Nub's engine README: run beside actions/setup-node; smoke job for the additive install Sep 8, 2026
@pullfrog

pullfrog Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Run failed. View the logs →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Opus | 𝕏

…tall

A workflow that keeps setup-node adds setup-nub after it, with the same
node-version, and replaces `npm ci` with `nub install --frozen-lockfile`.
The smoke job proves it on all three runners: the install runs on Nub's
engine from package-lock.json, bare node stays the version setup-node
chose, and `npm run` still works.
@pullfrog

pullfrog Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Run failed. View the logs →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Opus | 𝕏

provision-node: false skips the Node provision step: nothing is fronted on
PATH and the node-version output is empty, for a job where
actions/setup-node already put the wanted Node on PATH. The smoke job for
the beside-setup-node recipe writes a disagreeing .nvmrc first, so the
check that bare node stays setup-node's would fail with the step on.

A package-manager name as the cache value no longer prints a notice; it is
a documented spelling.
@pullfrog

pullfrog Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Run failed. View the logs →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Opus | 𝕏

@colinhacks colinhacks changed the title README: run beside actions/setup-node; smoke job for the additive install provision-node input; README recipe and smoke job for running beside actions/setup-node Sep 8, 2026
The dep-glob output was written with a plain echo, so a second line broke
GITHUB_OUTPUT with 'Invalid format'. Heredoc form, as pin-glob already
used. A smoke job passes a two-line list.
@pullfrog

pullfrog Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Run failed. View the logs →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Opus | 𝕏

@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 blocking issues — the functional change is sound and this PR's own CI already proves it end to end. What's left is documentation and coverage polish.

Reviewed changes — pullfrog has not reviewed this PR before (the only prior review is Copilot's, against 9443730, which the branch has since rewritten), so this pass covers the full diff rather than only the 7ca7b3c..78849ce delta.

  • Added the provision-node input — defaults to true; false gates off the entire Provision Node step, so nothing is provisioned, no Node bin dir is fronted, and the node-version output comes back empty.
  • Documented a "Beside setup-node" recipe — keep actions/setup-node, add setup-nub with provision-node: false, swap npm ci for nub install --frozen-lockfile.
  • Fixed dep-glob for a newline-delimited cache-dependency-path — switched to the heredoc $GITHUB_OUTPUT form, matching the pin-glob block right below it. The previous echo "dep-glob=$dep_glob" wrote a malformed output file and failed the step outright for any multi-line value.
  • Dropped the ::notice:: that fired when cache was given a package-manager name; the value is still treated as truthy, only the log line is gone.
  • Added two smoke jobs — multi-dep-path (a two-line cache-dependency-path) and additive (three-OS: actions/setup-node pins Node 20, a root .nvmrc of 22 serves as the negative control, and nub install --frozen-lockfile installs a hand-written npm lockfile).

Two things I checked rather than assumed. steps.provision is referenced in exactly one place repo-wide — the node-version output at action.yml:83 — so skipping the step cannot starve any other step, and the documented "output empty" behavior falls out for free. And because smoke.yml triggers on pull_request, the new jobs gate this PR: additive is already green on ubuntu and windows, which settles the node_modules/.nub-engine marker, the --frozen-lockfile flag, the hand-written file: lockfile fixture, and the exact-equality [[ "$out" == "42" ]] capture under Git Bash. None of those needed flagging in the end.

ℹ️ The "Node on the global PATH" section still describes PATH fronting as unconditional

README.md:59 opens with "setup-nub provisions a Node toolchain and adds its bin dir to the global PATH", and the "Which version is fronted" list enumerates three cases — explicit input, project pin, no pin. provision-node is the one input whose entire purpose is to suppress that mechanism, and it appears nowhere in the section a reader consults to understand PATH behavior.

Technical details
# `provision-node` is absent from the section that documents PATH fronting

## Affected sites
- `README.md:59` — asserts unconditionally that the action "provisions a Node toolchain and adds its bin dir to the global `PATH`".
- `README.md:61-66` — the "Which version is fronted" list covers explicit `node-version` / project pin / no pin, but not `provision-node: false`.
- `README.md:67` — "The remaining nuance vs setup-node" now understates the set of nuances.

## Required outcome
- A reader who lands on "Node on the global PATH" learns that the fronting can be turned off entirely, without having to find the new "Beside setup-node" section or the inputs table.

## Suggested approach (optional)
- Add a fourth bullet to the "Which version is fronted" list along the lines of: **With `provision-node: false`** — nothing is provisioned and nothing is fronted; whatever is already on `PATH` (typically `actions/setup-node`'s Node) stays, and the `node-version` output is empty.
- Soften the opening sentence's "provisions ... and adds" to note the default, e.g. "by default".

ℹ️ Nitpicks

  • action.yml: setting node-version (or node-version-file) together with provision-node: false silently ignores the version input — the step that consumes it never runs. The action already warns on subtler divergences (the deprecated version alias, the pin-vs-PATH mismatch at action.yml:604), so a one-line ::warning:: when both are set would fit the existing style and catch a plausible mis-migration.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using Claude Opus | 𝕏

Comment thread action.yml
Comment thread .github/workflows/smoke.yml

@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 78849ce..7bbcef6 delta, which is entirely the two fix-ups for the inline threads left on the previous pass.

  • Asserted the empty node-version output in the additive smoke job — the uses: ./ step now carries id: nub, and the script below it fails the job if steps.nub.outputs.node-version is non-empty.
  • Corrected the Provision Node step's intent comment — "This runs UNCONDITIONALLY" is replaced by a description that names provision-node: false as the opt-out and restates what it suppresses (no provision, nothing fronted, empty output).

I checked that the new assertion can actually fail rather than passing vacuously: smoke.yml:159 and smoke.yml:185 assert that same output equals 20* in the pin-resolution and eager-provision jobs, so the output is demonstrably populated whenever the provision step runs. If provision-node: false ever stopped gating the step, line 433 would catch it. The additive job is already green on windows-latest at 7bbcef6, which settles empirically that a skipped composite step yields an empty action-level output.

Both prior threads are replied to and resolved. The one item from the last pass that the new commits don't touch is the Node on the global PATH section in README.md, which still describes PATH fronting as unconditional — it stays on the record from the previous review and is not a merge blocker.

Pullfrog  | View workflow run | Using Claude Opus | 𝕏

@colinhacks
colinhacks merged commit c7b970e into main Sep 16, 2026
44 checks passed
@colinhacks
colinhacks deleted the route-installs branch September 16, 2026 04:24
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.

2 participants