fix(bootstrap-windows): install Ubuntu 24.04 when WSL distro is missing - #4101
Conversation
📝 WalkthroughWalkthroughWindows bootstrap script now defaults to and immediately installs Ubuntu-24.04 WSL when missing, replacing a deferred handoff mechanism. New helper functions handle install command creation, registration polling, and failure messaging. Top-level flow is simplified and covered by a Vitest suite that validates success and failure guidance. ChangesWindows Bootstrap WSL Distro Installation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
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 docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: None Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 1 needs attention, 0 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/bootstrap-windows.ps1 (1)
717-726: 💤 Low valueMisleading status message after fresh distro installation.
Line 726 prints "WSL distro already registered" unconditionally, even when we just installed the distro in lines 718-723. Consider updating the messaging to reflect the actual scenario.
💡 Suggested improvement
if ($distros -notcontains $DistroName) { Install-WslDistro -Name $DistroName $distros = Get-WslDistros if ($distros -notcontains $DistroName) { Write-WslUbuntuRequiredNotice -Name $DistroName throw "WSL distro '$DistroName' is still not registered after install." } + Write-Status "WSL distro registered: $DistroName" + } else { + Write-Status "WSL distro already registered: $DistroName" } - - Write-Status "WSL distro already registered: $DistroName"🤖 Prompt for 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. In `@scripts/bootstrap-windows.ps1` around lines 717 - 726, The status message "WSL distro already registered: $DistroName" is printed unconditionally even after a fresh install; update the logic around Install-WslDistro/Get-WslDistros to emit a different message when the distro was just installed versus when it was already present — e.g., track a flag (e.g., $installed = $true) or check membership of $distros after the install and call Write-Status with "WSL distro installed: $DistroName" when installation occurred, otherwise keep "WSL distro already registered: $DistroName"; modify the block that uses $distros, $DistroName, Install-WslDistro, Get-WslDistros, and Write-Status accordingly.
🤖 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.
Nitpick comments:
In `@scripts/bootstrap-windows.ps1`:
- Around line 717-726: The status message "WSL distro already registered:
$DistroName" is printed unconditionally even after a fresh install; update the
logic around Install-WslDistro/Get-WslDistros to emit a different message when
the distro was just installed versus when it was already present — e.g., track a
flag (e.g., $installed = $true) or check membership of $distros after the
install and call Write-Status with "WSL distro installed: $DistroName" when
installation occurred, otherwise keep "WSL distro already registered:
$DistroName"; modify the block that uses $distros, $DistroName,
Install-WslDistro, Get-WslDistros, and Write-Status accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ca218e31-dd6d-4674-92c7-8693a9583e13
📒 Files selected for processing (2)
scripts/bootstrap-windows.ps1test/bootstrap-windows.test.ts
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Fixes a regression from #4101 where first-run Ubuntu account setup ran inside the current PowerShell console, causing prompt alignment issues. This restores the separate WSL handoff window, keeps the `Ubuntu-24.04` default, and documents how users with an existing `Ubuntu` distro can reuse it with `-DistroName Ubuntu`. ## Changes - Defer missing Ubuntu distro installation to the final handoff window. - Skip Docker-in-WSL verification until first-run Ubuntu setup completes. - Update bootstrap tests to guard against same-console `wsl --install` regressions. - Document the `Ubuntu-24.04` default and `-DistroName Ubuntu` override. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [x] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## 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] `npx prek run --all-files` passes - [x] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [x] Docs updated for user-facing behavior changes - [ ] `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 required by CI. Run: git config user.name && git config user.email --> Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated Windows preparation guide with clarified instructions for Ubuntu 24.04 installation, WSL 2 feature enablement, Docker Desktop setup, and system restart procedures. Added details on default distro configuration and reusing existing distributions. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/4278?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>
Summary
wsl --install Ubuntu-24.04immediately instead of deferring distro creation to the final Ubuntu handoff.Verification
npm ci --ignore-scriptsnpx vitest run test/bootstrap-windows.test.tsgit diff --checkFixes #3974
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Signed-off-by: Aaron Erickson aerickson@nvidia.com