refactor(onboard): extract entry option resolution#5161
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR extracts onboarding entry option resolution (CLI flag parsing, environment variable handling, validation, and early error gating) from inline code in ChangesEntry Options Module Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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 AdvisorFindings: 0 needs attention, 0 worth checking, 0 nice ideas Consider writing more tests for
This is an automated advisory review. A human maintainer must make the final merge decision. |
Selective E2E Results — ✅ All requested jobs passedRun: 27297021441
|
Selective E2E Results — ❌ Some jobs failedRun: 27371459799
|
Selective E2E Results — ❌ Some jobs failedRun: 27371582699
|
1 similar comment
Selective E2E Results — ❌ Some jobs failedRun: 27371582699
|
Selective E2E Results — ✅ All requested jobs passedRun: 27371582699
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Selective E2E Results — ✅ All requested jobs passedRun: 27372961345
|
…into codex/pr-5159-update # Conflicts: # src/lib/onboard.ts
…t-flow' into codex/pr-5161-update
Selective E2E Results — ❌ Some jobs failedRun: 27379313333
|
Selective E2E Results — ✅ All requested jobs passedRun: 27379313333
|
Summary
Extracts the first-pass onboarding option resolution from
onboard()into a small helper. The helper now owns--resume/--freshvalidation,--fromand non-interactive env fallback handling, early sandbox-name validation, reserved-name checks, and the no-TTY--fromname guard.Related Issue
Refs #3802
Changes
resolveOnboardEntryOptionsinsrc/lib/onboard/entry-options.ts.onboard()with the new helper call.--from, resume deferral, reserved names, and validation guidance.test/e2e/test-onboard-negative-paths.shwith--fromentry-option guard coverage, including the no-name guard and the env-provided sandbox-name path.onboard.tsso it referencesresolveOnboardEntryOptionsinstead of stale line numbers.Type of Change
Verification
Targeted checks run:
npx @biomejs/biome format --write src/lib/onboard.ts src/lib/onboard/entry-options.ts src/lib/onboard/entry-options.test.tsnpx @biomejs/biome lint src/lib/onboard.ts src/lib/onboard/entry-options.ts src/lib/onboard/entry-options.test.tsnpm run build:clinpm run typecheck:clinpx vitest run src/lib/onboard/entry-options.test.ts test/onboard.test.ts test/cli/onboard-compatibility.test.ts(87 tests)CI=true npx vitest run --project installer-integration test/install-preflight.test.ts(104 tests; rerun locally after the CI installer-integration timeout)bash -n test/e2e/test-onboard-negative-paths.sh--from Dockerfilewithout--name/NEMOCLAW_SANDBOX_NAMEexits 1 with the explicit missing-name guard and no stack trace.--from DockerfilewithNEMOCLAW_SANDBOX_NAME="bad name"exits 1 at sandbox-name validation and does not print the missing-name guard.git diff --checkGitHub/remote validation:
726a539b0416e0cd86274fac43290382c6edee22.onboard-negative-paths-e2epassed: https://github.com/NVIDIA/NemoClaw/actions/runs/27297021441ubuntu-repo-cloud-openclawpassed: https://github.com/NVIDIA/NemoClaw/actions/runs/27297021291mergeable_state=clean.Local broad-hook note:
Full
npx prek run --all-filesremains blocked locally by the unrelatedtest/release-latest-tag.test.tsfixture commit signing failure (/home/cvillela/.ssh/git-signing-key.pubmissing private key). This PR does not touch that release test file.shellcheckandshfmtare not installed in this local environment; the E2E script was syntax-checked withbash -nand covered by direct CLI probes. CI ShellCheck passed remotely.npx prek run --all-filespassesnpm testpassesTests added or updated for new or changed behavior
No secrets, API keys, or credentials committed
Docs updated for user-facing behavior changes
npm run docsbuilds without warnings (doc changes only)Doc pages follow the style guide (doc changes only)
New doc pages include SPDX header and frontmatter (new pages only)
Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Tests
Refactor