refactor(cli): delete setup.sh, route all setup through nemoclaw onboard#1230
refactor(cli): delete setup.sh, route all setup through nemoclaw onboard#1230cv wants to merge 9 commits into
Conversation
After a Docker container restart, the gateway regenerates its mTLS certificates but stale host key entries in ~/.ssh/known_hosts cause SSH handshake verification failures. This fix: - Purges old openshell host key entries from known_hosts when the gateway is destroyed during onboard - Uses ephemeral known_hosts files for sandbox SSH connections in debug.sh to avoid accumulating stale entries Fixes #768 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…filter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…atching - Move SANDBOX_SSH_KNOWN cleanup into cleanup() instead of a standalone trap that overwrites the existing EXIT handler (scripts/debug.sh) - Narrow known_hosts pruning to only match hostnames that startsWith "openshell-" in the host field, split by comma, skipping comments and empty lines (bin/lib/onboard.js) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add comments inside empty catch blocks to satisfy no-empty rule - Apply Prettier formatting to chained filter/join calls Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Extract pruneKnownHostsEntries() as a testable helper and add 10 tests covering: openshell- removal, comma-separated hosts, comment/blank preservation, no-match passthrough, key-data false positives, hashed entries, and bracketed port entries. Signed-off-by: Carlos Villela <cvillela@nvidia.com>
scripts/setup.sh (324 lines) duplicated every step that `nemoclaw onboard` already handles with better error recovery, exponential backoff, interactive prompts, and registry management. - Delete scripts/setup.sh and its dedicated test file - `nemoclaw setup` now delegates to onboard instead of shelling out to the deleted script - brev-setup.sh installs the CLI and runs `nemoclaw onboard --non-interactive` instead of calling setup.sh - Remove setup.sh assertions from gateway-cleanup and runner tests - Update comments in walkthrough.sh and brev-e2e.test.js Relates to #924 (shell consolidation). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request refactors the NemoClaw setup flow by removing the monolithic Changes
Sequence Diagram(s)sequenceDiagram
participant NodeProcess as Node Process<br/>(onboard.js)
participant SSHKeygen as SSH Keygen<br/>(external)
participant FileSystem as File System<br/>(~/.ssh/known_hosts)
NodeProcess->>SSHKeygen: ssh-keygen -R openshell-${GATEWAY_NAME}<br/>(best-effort, ignore failures)
SSHKeygen-->>NodeProcess: complete (may fail)
NodeProcess->>FileSystem: read ~/.ssh/known_hosts
FileSystem-->>NodeProcess: file contents
NodeProcess->>NodeProcess: pruneKnownHostsEntries(contents)<br/>filter out openshell-* entries
alt Changes detected
NodeProcess->>FileSystem: write filtered contents back
FileSystem-->>NodeProcess: write complete
else No changes
NodeProcess->>NodeProcess: skip write
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Reopening from a clean branch based on main (the original had stale commits from another branch). |
…ard (#1235) ## Summary - Delete `scripts/setup.sh` (324 lines) — every step it performed is already handled by `nemoclaw onboard` with better error recovery (exponential backoff via pRetry), interactive prompts, registry management, and WSL2-aware Ollama binding - `nemoclaw setup` now delegates to `onboard` instead of shelling out to the deleted script - `brev-setup.sh` installs the nemoclaw CLI and runs `nemoclaw onboard --non-interactive` instead of calling setup.sh - Remove setup.sh-specific tests and assertions (3 test removals across 3 files); all equivalent assertions against `onboard.js` already exist ## Test plan - [x] 541 CLI tests pass (`vitest run --project cli`) - [ ] Verify `nemoclaw setup` prints deprecation notice and runs onboard - [ ] Verify `brev-setup.sh` bootstraps correctly on a fresh Brev VM (E2E) Relates to #924 (shell consolidation). Supersedes #1230. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Migrated legacy setup to a unified onboarding flow and removed the old top-level setup orchestration. * **Chores** * Updated bootstrap to build/install the CLI locally and run onboarding non-interactively. * Adjusted setup walkthrough instructions to reference onboarding. * **Tests** * Removed tests tied to the removed setup script and sandbox-name behavior. * Added CLI dispatch tests verifying setup argument forwarding into onboarding. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ard (#1235) ## Summary - Delete `scripts/setup.sh` (324 lines) — every step it performed is already handled by `nemoclaw onboard` with better error recovery (exponential backoff via pRetry), interactive prompts, registry management, and WSL2-aware Ollama binding - `nemoclaw setup` now delegates to `onboard` instead of shelling out to the deleted script - `brev-setup.sh` installs the nemoclaw CLI and runs `nemoclaw onboard --non-interactive` instead of calling setup.sh - Remove setup.sh-specific tests and assertions (3 test removals across 3 files); all equivalent assertions against `onboard.js` already exist ## Test plan - [x] 541 CLI tests pass (`vitest run --project cli`) - [ ] Verify `nemoclaw setup` prints deprecation notice and runs onboard - [ ] Verify `brev-setup.sh` bootstraps correctly on a fresh Brev VM (E2E) Relates to #924 (shell consolidation). Supersedes #1230. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Migrated legacy setup to a unified onboarding flow and removed the old top-level setup orchestration. * **Chores** * Updated bootstrap to build/install the CLI locally and run onboarding non-interactively. * Adjusted setup walkthrough instructions to reference onboarding. * **Tests** * Removed tests tied to the removed setup script and sandbox-name behavior. * Added CLI dispatch tests verifying setup argument forwarding into onboarding. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ard (NVIDIA#1235) ## Summary - Delete `scripts/setup.sh` (324 lines) — every step it performed is already handled by `nemoclaw onboard` with better error recovery (exponential backoff via pRetry), interactive prompts, registry management, and WSL2-aware Ollama binding - `nemoclaw setup` now delegates to `onboard` instead of shelling out to the deleted script - `brev-setup.sh` installs the nemoclaw CLI and runs `nemoclaw onboard --non-interactive` instead of calling setup.sh - Remove setup.sh-specific tests and assertions (3 test removals across 3 files); all equivalent assertions against `onboard.js` already exist ## Test plan - [x] 541 CLI tests pass (`vitest run --project cli`) - [ ] Verify `nemoclaw setup` prints deprecation notice and runs onboard - [ ] Verify `brev-setup.sh` bootstraps correctly on a fresh Brev VM (E2E) Relates to NVIDIA#924 (shell consolidation). Supersedes NVIDIA#1230. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Migrated legacy setup to a unified onboarding flow and removed the old top-level setup orchestration. * **Chores** * Updated bootstrap to build/install the CLI locally and run onboarding non-interactively. * Adjusted setup walkthrough instructions to reference onboarding. * **Tests** * Removed tests tied to the removed setup script and sandbox-name behavior. * Added CLI dispatch tests verifying setup argument forwarding into onboarding. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ard (NVIDIA#1235) ## Summary - Delete `scripts/setup.sh` (324 lines) — every step it performed is already handled by `nemoclaw onboard` with better error recovery (exponential backoff via pRetry), interactive prompts, registry management, and WSL2-aware Ollama binding - `nemoclaw setup` now delegates to `onboard` instead of shelling out to the deleted script - `brev-setup.sh` installs the nemoclaw CLI and runs `nemoclaw onboard --non-interactive` instead of calling setup.sh - Remove setup.sh-specific tests and assertions (3 test removals across 3 files); all equivalent assertions against `onboard.js` already exist ## Test plan - [x] 541 CLI tests pass (`vitest run --project cli`) - [ ] Verify `nemoclaw setup` prints deprecation notice and runs onboard - [ ] Verify `brev-setup.sh` bootstraps correctly on a fresh Brev VM (E2E) Relates to NVIDIA#924 (shell consolidation). Supersedes NVIDIA#1230. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Migrated legacy setup to a unified onboarding flow and removed the old top-level setup orchestration. * **Chores** * Updated bootstrap to build/install the CLI locally and run onboarding non-interactively. * Adjusted setup walkthrough instructions to reference onboarding. * **Tests** * Removed tests tied to the removed setup script and sandbox-name behavior. * Added CLI dispatch tests verifying setup argument forwarding into onboarding. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
scripts/setup.sh(324 lines) — every step it performed is already handled bynemoclaw onboardwith better error recovery (exponential backoff via pRetry), interactive prompts, registry management, and WSL2-aware Ollama bindingnemoclaw setupnow delegates toonboardinstead of shelling out to the deleted scriptbrev-setup.shinstalls the nemoclaw CLI and runsnemoclaw onboard --non-interactiveinstead of calling setup.shonboard.jsalready existTest plan
vitest run --project cli)nemoclaw setupprints deprecation notice and runs onboardbrev-setup.shbootstraps correctly on a fresh Brev VM (E2E)Relates to #924 (shell consolidation).
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
nemoclaw onboardreplaces legacy setup workflowImprovements
Deprecated
scripts/setup.shsetup process