Repository navigation
refactor(onboard): finish oclif flag migration - #5916
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR replaces legacy string-array onboarding CLI handling with typed ChangesOnboard flags migration and legacy removal
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Auto-dispatched E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review Advisor (Nemotron Ultra) — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
🚨 Required before mergeAddress these before merging unless a maintainer explicitly overrides the advisor with rationale.
|
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
Selective E2E Results —
|
| Job | Result |
|---|---|
| onboard-resume-e2e |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@src/lib/onboard/command-agents.test.ts`:
- Around line 17-24: The test in resolveOnboardOptions is still using an
already-absolute manifestPath, so it does not verify canonicalization behavior.
Update the setup in command-agents.test.ts to pass a relative agents manifest
input and then assert the returned agentsManifest matches path.resolve(...) of
that input, keeping the test focused on behavior rather than implementation
details.
In `@src/lib/onboard/command.test.ts`:
- Around line 169-171: The cleanup in the test’s finally block uses an if
statement that triggers the guardrail; rewrite the restore logic in
onbboard/command.test.ts using a conditional expression instead. Keep the same
behavior for process.env.NEMOCLAW_OLLAMA_NO_AUTOSTART by preserving the previous
value when defined and deleting it when undefined, but do so without introducing
a new if inside the cleanup path.
- Around line 101-107: The test for resolveOnboardOptions() is locking in an
absolute-path implementation by passing an already resolved Dockerfile path and
expecting it back unchanged. Update the case in command.test.ts to use a
relative --from input while still validating the file on disk, and assert that
the original relative string is preserved by resolve() via fromDockerfile
instead of comparing against an absolute path.
🪄 Autofix (Beta)
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: bc1e1b40-a016-47c8-9da1-bf64c9a12d8e
📒 Files selected for processing (19)
biome.jsonsrc/commands/global-oclif-command-adapters.test.tssrc/commands/onboard.test.tssrc/commands/onboard.tssrc/commands/setup-spark.tssrc/commands/setup.tssrc/lib/actions/global.test.tssrc/lib/actions/global.tssrc/lib/actions/onboard.tssrc/lib/onboard/README.mdsrc/lib/onboard/command-agents.test.tssrc/lib/onboard/command-support.tssrc/lib/onboard/command.test.tssrc/lib/onboard/command.tssrc/lib/onboard/legacy-command.test.tssrc/lib/onboard/legacy-command.tssrc/lib/onboard/usage-notice.tstest/cli/onboard-compatibility.test.tstest/nemohermes-alias.test.ts
💤 Files with no reviewable changes (2)
- src/lib/onboard/legacy-command.test.ts
- src/lib/onboard/legacy-command.ts
Selective E2E Results —
|
| Job | Result |
|---|---|
| onboard-resume-e2e |
Selective E2E Results — ✅ All requested jobs passedRun: 28306983686
|
Selective E2E Results —
|
| Job | Result |
|---|---|
| onboard-resume-e2e |
Selective E2E Results —
|
| Job | Result |
|---|---|
| onboard-resume-e2e |
|
Automated-review follow-up for the Nemotron findings:
The final head has green CLI shards, |
Selective E2E Results — ✅ All requested jobs passedRun: 28307280628
|
<!-- markdownlint-disable MD041 --> ## Summary Finish the onboarding oclif migration by passing parsed flags through a typed command boundary instead of reconstructing argv and parsing it again. This removes the legacy parser and alias-specific action plumbing while preserving domain validation and the public sandbox-first dispatcher. ## Changes - replace the `oclif flags -> string[] -> legacy parser` round trip with typed option resolution - move GPU flag exclusivity and device dependencies into oclif metadata while retaining file, agent-alias, manifest, and notice validation in the onboarding boundary - route `setup` and `setup-spark` through the shared onboard action and oclif's native, alias-aware deprecation support - delete the manual parser, manual usage renderer, and deprecated alias action facade, for 804 net lines removed - replace parser-internal tests with typed resolver, command-boundary, integration, package-contract, and alias-branding coverage - cap every function in the affected production cluster at cognitive complexity 10 ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates <!-- Check all that apply. For any "covered by existing tests", "not applicable", or waiver entry, add a brief justification on the same line or in the Changes section. --> - [x] Tests added or updated for changed behavior - [x] Existing tests cover changed behavior — justification: the full CLI integration suite continues to cover onboarding, deprecated aliases, custom Dockerfiles, resume behavior, and agent-specific launchers - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: public commands, flags, and documented semantics are unchanged; existing docs already state that aliases share onboard flags and GPU device selection requires `--sandbox-gpu` - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: reviewed the typed mapping against every legacy parser branch; targeted, coverage-ratchet, and full-matrix verification passed - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification <!-- Check each item you ran and confirmed. Leave unchecked items you skipped. Doc-only changes do not require npm test unless you ran it. --> - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes - [x] Targeted tests pass for changed behavior - [x] Full `npm test` passes (broad runtime changes only) - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Onboarding now uses a unified, typed flag flow across commands, improving handling for GPU options, agent selection, and `--from`/`--agents` inputs. * **Bug Fixes** * Strengthened validation for incompatible GPU and sandbox GPU device combinations, improved errors for missing/invalid agent manifests and invalid Dockerfile `--from` paths, and tightened `--control-ui-port` checks. * **Chores** * Updated deprecated-alias messaging and help for `setup` and `setup-spark` to consistently direct to `onboard`. * **Tests** * Updated/expanded onboarding and compatibility test coverage to match the new typed-flag behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Finish the onboarding oclif migration by passing parsed flags through a typed command boundary instead of reconstructing argv and parsing it again. This removes the legacy parser and alias-specific action plumbing while preserving domain validation and the public sandbox-first dispatcher.
Changes
oclif flags -> string[] -> legacy parserround trip with typed option resolutionsetupandsetup-sparkthrough the shared onboard action and oclif's native, alias-aware deprecation supportType of Change
Quality Gates
--sandbox-gpuVerification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
--from/--agentsinputs.--frompaths, and tightened--control-ui-portchecks.setupandsetup-sparkto consistently direct toonboard.