Skip to content

feat: install multiple runtimes from devEngines.runtime - #32

Open
BlankParticle wants to merge 2 commits into
pnpm:mainfrom
BlankParticle:feat/install-multiple-runtimes
Open

feat: install multiple runtimes from devEngines.runtime#32
BlankParticle wants to merge 2 commits into
pnpm:mainfrom
BlankParticle:feat/install-multiple-runtimes

Conversation

@BlankParticle

@BlankParticle BlankParticle commented Aug 14, 2026

Copy link
Copy Markdown

We have a repo setup where we use pnpm as package manager and both Node and Bun as runtime, I was moving to use pnpm/setup action as it seems the one we should be using now.
So this is what I put in our package.json

  "packageManager": "pnpm@11.21.0",
  "devEngines": {
    "runtime": [ {
        "name": "bun",
        "version": "1.3.13",
        "onFail": "warn"
      },
      {
        "name": "node",
        "version": "24",
        "onFail": "warn"
      } ]
  }

But when the action runs, it only installed pnpm and bun, and the nodejs version resolved to the preinstalled version on the container. I figured out that it only installs the first runtime if the runtime is an array. So this is the workaround we have for now

 - name: Setup pnpm, Node.js, Bun
      uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2
      with:
        cache: true
        install: false

    - name: Install Node 24
      run: pnpm runtime set node 24 -g

    - name: Install dependencies
      run: pnpm install --frozen-lockfile

We need to install node before running install since we have postinstall that needs node 24

So, this PR adds supports for installing multiple runtimes without breaking any old consumers of this action

Summary by CodeRabbit

  • New Features

    • Automatically installs all runtimes declared in the project when no specific runtime is provided.
    • Added a runtimes output containing all installed runtimes in order.
    • Runtime setup now supports multiple runtimes and keeps each runtime’s shims configured correctly.
  • Bug Fixes

    • Prevented package installation from reprocessing runtime declarations after runtimes are installed.
  • Documentation

    • Updated runtime input, output, and workflow documentation to reflect multi-runtime support.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@BlankParticle, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dd747409-5d6c-4ddf-ab06-58ec1cd7fb1a

📥 Commits

Reviewing files that changed from the base of the PR and between 4a47136 and 0447c75.

⛔ Files ignored due to path filters (1)
  • dist/index.js is excluded by !**/dist/**
📒 Files selected for processing (4)
  • .github/workflows/test.yaml
  • README.md
  • action.yml
  • src/install-runtime/index.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 22d44f75-f095-41dc-97fa-d48046b63819

📥 Commits

Reviewing files that changed from the base of the PR and between 84cb39b and 4a47136.

⛔ Files ignored due to path filters (1)
  • dist/index.js is excluded by !**/dist/**
📒 Files selected for processing (7)
  • .github/workflows/test.yaml
  • README.md
  • action.yml
  • src/index.ts
  • src/install-runtime/index.ts
  • src/outputs/index.ts
  • src/pnpm-install/index.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-05-11T16:19:49.450Z
Learnt from: zkochan
Repo: pnpm/setup PR: 1
File: src/cache-restore/run.ts:35-35
Timestamp: 2026-05-11T16:19:49.450Z
Learning: When using `actions/exec` (`getExecOutput` / `exec`), it is valid for the `commandLine` option to include both the command and its arguments in a single string (e.g., `getExecOutput('pnpm store path --silent')`). The library tokenizes `commandLine` internally (via `argStringToArray()`), so this behaves like passing an equivalent command + args array (e.g., `getExecOutput('pnpm', ['store','path','--silent'])`). In code reviews, do not flag this as incorrect—this matches documented behavior and a production-tested pattern.

Applied to files:

  • src/outputs/index.ts
  • src/index.ts
  • src/pnpm-install/index.ts
  • src/install-runtime/index.ts
📚 Learning: 2026-08-09T14:55:39.968Z
Learnt from: zkochan
Repo: pnpm/setup PR: 25
File: src/install-runtime/index.ts:72-81
Timestamp: 2026-08-09T14:55:39.968Z
Learning: In `src/install-runtime/index.ts`, `keepInstalledRuntimeAuthoritative` must use a truthiness check for `PNPM_CONFIG_GLOBAL_SHIMS` and `pnpm_config_global_shims`. pnpm's `load_global_shims_setting` ignores empty environment values, so empty values must be treated as unset and the action must export `PNPM_CONFIG_GLOBAL_SHIMS` to disable the installed runtime's context-aware shim.

Applied to files:

  • src/install-runtime/index.ts
🔇 Additional comments (7)
src/install-runtime/index.ts (1)

26-36: LGTM!

Also applies to: 68-85, 127-131

src/index.ts (1)

6-12: LGTM!

Also applies to: 33-51

src/outputs/index.ts (1)

5-13: LGTM!

src/pnpm-install/index.ts (1)

7-7: LGTM!

Also applies to: 22-25

action.yml (1)

32-34: LGTM!

Also applies to: 58-60, 80-84

README.md (1)

12-20: LGTM!

Also applies to: 33-35, 116-117

.github/workflows/test.yaml (1)

324-324: LGTM!

Also applies to: 340-343, 355-386, 633-649


📝 Walkthrough

Walkthrough

The action now installs all valid devEngines.runtime entries when no runtime input is provided. It tracks installed runtimes, disables runtime processing during pnpm install, and exposes the first runtime plus an ordered JSON list.

Changes

Multi-runtime installation

Layer / File(s) Summary
Resolve runtime requests
src/install-runtime/index.ts
Runtime resolution returns one explicit request or all valid runtime entries from the manifest.
Install and configure runtimes
src/index.ts, src/install-runtime/index.ts
The action installs each request, collects installed runtimes, and disables shims for every installed runtime.
Propagate runtime state
src/outputs/index.ts, src/pnpm-install/index.ts, action.yml, README.md
Outputs identify the first installed runtime and serialize all runtimes. pnpm install uses --no-runtime when runtimes were installed. Documentation describes the updated behavior.
Validate runtime behavior
.github/workflows/test.yaml
Tests install Bun and Node from devEngines.runtime, verify their versions, check the ordered runtime output, and assert [] when no runtime is configured.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 4a471

The PR adds support for installing multiple runtimes from devEngines.runtime, with no actionable merge-blocking risk currently identified beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Action
  participant RuntimeResolver
  participant RuntimeInstaller
  participant Outputs
  participant PnpmInstall
  Action->>RuntimeResolver: Resolve explicit or manifest runtimes
  RuntimeResolver->>RuntimeInstaller: Install each runtime
  RuntimeInstaller-->>Action: Return installed runtime records
  Action->>Outputs: Set first runtime and runtimes JSON output
  Action->>PnpmInstall: Run install with runtime-installed state
  PnpmInstall-->>Action: Append --no-runtime when runtimes were installed
Loading

Suggested reviewers: zkochan

Poem

A rabbit installs Bun and Node,
Then lists each runtime in a row.
Shims stand still, pnpm moves on,
Empty lists appear when none are drawn.
“Hop!” says the rabbit, “the outputs glow!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: installing multiple runtimes from devEngines.runtime.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The PR is not yet safe to merge because a runtime download failure still aborts the action despite a non-fatal devEngines onFail policy.

Runtime entries discard onFail, and installRuntime marks every installation error as failed before runMain returns early, leaving the previously reported failure behavior reachable.

Files Needing Attention: src/index.ts, src/install-runtime/index.ts

Reviews (3): Last reviewed commit: "fix: dedupe runtime versions" | Re-trigger Greptile

Comment thread src/index.ts
Comment thread src/outputs/index.ts
Comment thread .github/workflows/test.yaml
Comment thread src/install-runtime/index.ts
@BlankParticle
BlankParticle force-pushed the feat/install-multiple-runtimes branch from c689cee to 0447c75 Compare August 14, 2026 09:36
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