Skip to content

fix(cli): fail fast on unsupported onboarding hosts#1461

Open
ChunkyMonkey11 wants to merge 12 commits intoNVIDIA:mainfrom
ChunkyMonkey11:feat/next-contribution-2026-04-02
Open

fix(cli): fail fast on unsupported onboarding hosts#1461
ChunkyMonkey11 wants to merge 12 commits intoNVIDIA:mainfrom
ChunkyMonkey11:feat/next-contribution-2026-04-02

Conversation

@ChunkyMonkey11
Copy link
Copy Markdown
Contributor

@ChunkyMonkey11 ChunkyMonkey11 commented Apr 3, 2026

Summary

  • Add explicit host OS support classification for onboarding preflight.
  • Fail fast when host support status is error.
  • Keep onboarding non-blocking for warning hosts while surfacing clear guidance.

Root Cause

Onboarding did not gate early on unsupported host OS/platform combinations, which could lead users into later-stage failures after expensive setup steps.

Changes

  • Added src/lib/host-support.ts with Linux/macOS/platform classification helpers.
  • Added CJS shim bin/lib/host-support.js.
  • Wired checkHostSupport() into bin/lib/onboard.js preflight.
  • Added unit coverage in src/lib/host-support.test.ts.
  • Added onboarding regression test in test/onboard.test.js to verify fail-fast behavior before Docker checks.
  • Simplified the pre-20 EOL condition in src/lib/host-support.ts from a redundant clause to major < 20.

Validation

  • npm test -- src/lib/host-support.test.ts test/onboard.test.js
  • Pre-commit and pre-push hooks passed during commit/push in this environment.

Signed-off-by: Revant Patel revant.h.patel@gmail.com

Summary by CodeRabbit

  • New Features

    • Onboarding now checks host OS support up front (Linux/macOS/others), prints clear success/warning/error messages, and exits early if unsupported—preventing later steps (Docker, GPU/memory checks, etc.) from running.
    • Improved Linux distro lifecycle (supported / near‑EOL / EOL) and macOS version detection with clearer, actionable warnings.
  • Tests

    • Added tests covering OS release parsing, host classification, and onboarding exit behavior across platforms and error paths.

@ChunkyMonkey11 ChunkyMonkey11 marked this pull request as ready for review April 3, 2026 22:09
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a host support detection library (Linux/macOS), a CommonJS shim, unit and integration tests, and integrates the host support check into onboarding preflight to log results and exit early on unsupported hosts.

Changes

Cohort / File(s) Summary
Host Support Source
src/lib/host-support.ts
New TypeScript module exporting types and checkHostSupport() with platform branching, /etc/os-release parsing, macOS detection via sw_vers, classification helpers, and injectable I/O for testing.
Host Support Tests
src/lib/host-support.test.ts
New Vitest suite exercising parseOsRelease, classifyLinuxHost, macOS handling, and checkHostSupport() using injected read/get implementations and error paths.
Host Support Shim
bin/lib/host-support.js
New CommonJS shim that re-exports the compiled module at ../../dist/lib/host-support via module.exports = require(...).
Onboard Integration
bin/lib/onboard.js
Calls checkHostSupport() at start of preflight(); logs ok/warning to stdout, logs errors to stderr and calls process.exit(1) for unsupported hosts; subsequent checks run only after host support evaluation.
Integration Test
test/onboard.test.js
New test that spawns bin/lib/onboard.js, stubs bin/lib/host-support.js in the child to force an unsupported-host error, asserts the child exits with code 1 before any Docker invocation.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant Onboard as Onboard (preflight)
  participant HostSupport as HostSupport
  participant OS as OS/FileSystem
  participant Docker as DockerChecks

  User->>Onboard: run onboard (preflight)
  Onboard->>HostSupport: checkHostSupport(opts)
  HostSupport->>OS: read /etc/os-release or run sw_vers
  OS-->>HostSupport: return version info or error
  HostSupport-->>Onboard: HostSupportResult (ok|warning|error)
  alt status == "error"
    Onboard->>Onboard: log to stderr
    Onboard-->>User: exit(1)
  else status == "ok" or "warning"
    Onboard->>Onboard: log to stdout
    Onboard->>Docker: run docker & other checks
    Docker-->>Onboard: continue startup
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I sniff the OS with twitchy nose,
I parse the lines where version info grows.
A shim to call, a test to see,
Preflight hops — yes, that's me!
I drum my paws: support or flee.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding host OS support validation to fail fast during onboarding when hosts are unsupported, which directly matches the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@ChunkyMonkey11 ChunkyMonkey11 changed the title [codex] fix(cli): fail fast on unsupported onboarding hosts fix(cli): fail fast on unsupported onboarding hosts Apr 3, 2026
@ChunkyMonkey11
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ChunkyMonkey11
Copy link
Copy Markdown
Contributor Author

@cv when you have a moment, could you please approve workflows for PR #1461 so checks can run? Thanks!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/lib/host-support.ts (1)

143-151: Consider simplifying the EOL condition.

The condition major < 20 || (major === 18 && minor <= 4) is logically redundant — major < 20 already covers all 18.x versions. The second clause (major === 18 && minor <= 4) is a subset of major < 20 and never evaluated independently.

If the intent is to mark all pre-20.x as EOL, major < 20 alone suffices. If only specific 18.x versions should be EOL, the condition needs restructuring.

Simplified condition (if all pre-20.x is intended as EOL)
-  if (major < 20 || (major === 18 && minor <= 4)) {
+  if (major < 20) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/host-support.ts` around lines 143 - 151, The EOL check uses a
redundant clause: simplify the if-condition to remove the never-reached subset
and make intent explicit; replace the current `if (major < 20 || (major === 18
&& minor <= 4))` logic with either a single `major < 20` when all pre-20.x
releases are EOL or, if only specific 18.x minors should be EOL, change it to a
focused check like `major === 18 && minor <= 4`; update the branch that returns
the object containing os, version (normalized), status, code, and message
accordingly so the condition accurately reflects the intended EOL policy for
variables major, minor, and normalized.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/lib/host-support.ts`:
- Around line 143-151: The EOL check uses a redundant clause: simplify the
if-condition to remove the never-reached subset and make intent explicit;
replace the current `if (major < 20 || (major === 18 && minor <= 4))` logic with
either a single `major < 20` when all pre-20.x releases are EOL or, if only
specific 18.x minors should be EOL, change it to a focused check like `major ===
18 && minor <= 4`; update the branch that returns the object containing os,
version (normalized), status, code, and message accordingly so the condition
accurately reflects the intended EOL policy for variables major, minor, and
normalized.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 98c1c43d-3aa0-418e-bfd0-40775b730070

📥 Commits

Reviewing files that changed from the base of the PR and between b1bb01c and 9c10484.

📒 Files selected for processing (5)
  • bin/lib/host-support.js
  • bin/lib/onboard.js
  • src/lib/host-support.test.ts
  • src/lib/host-support.ts
  • test/onboard.test.js

@ChunkyMonkey11
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@wscurran wscurran added Getting Started Use this label to identify setup, installation, or onboarding issues. priority: medium Issue that should be addressed in upcoming releases NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). fix labels Apr 4, 2026
@wscurran
Copy link
Copy Markdown
Contributor

wscurran commented Apr 4, 2026

✨ Thanks for submitting this pull request, which proposes a way to fail fast during onboarding when the host OS is unsupported, improving the setup experience.

@ChunkyMonkey11
Copy link
Copy Markdown
Contributor Author

Hi @wscurran, quick update: I merged the latest upstream/main into this branch and resolved the onboarding preflight conflict. The branch is now up to date and ready for commit/review on your side.

@ChunkyMonkey11
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 5, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Labels

fix Getting Started Use this label to identify setup, installation, or onboarding issues. NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). priority: medium Issue that should be addressed in upcoming releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants