refactor(installer): add internal plan commands#3108
Conversation
This reverts commit 4ebeae4.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a new NemoClaw installer plan system comprising core logic, three internal CLI commands, and tests. The system reads installer configuration from environment variables and flags, computes installation metadata (reference, provider, npm settings), and outputs results as JSON or text. ChangesInstaller Plan System
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Automated PR review summaryReviewed PR #3108: refactor(installer): add internal plan commands Recommendation
Installation and setup findings
What was validated
Failing tests and unresolved impact
Passing tests and why they matteredPassing test 1: Installed CLI routes hidden internal installer commands
Passing test 2: Installer plan honors explicit ref precedence and emits deterministic normalized JSON
Passing test 3: Resolve-release-tag and normalize-env preserve deterministic fallback behavior
Passing test 4: Invalid provider is surfaced as invalid instead of causing planner failure
Bottom line
|
|
verified locally — no env leak from the one footgun worth noting before downstream consumers wire up: cheap fixes: reject anything that's not |
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…al-installer-plan
prekshivyas
left a comment
There was a problem hiding this comment.
Pure additive — wires the #3107 typed installer helpers into three hidden oclif internal commands plus a composing action layer. Same pattern as #3083 → #3080.
Three new static hidden = true commands under src/commands/internal/installer/:
internal installer plan— callsbuildInstallerPlan(...), accepts CLI flags for env overrides (--install-ref,--install-tag,--provider) and probe inputs (--node-version,--npm-version,--npm-prefix, plus threehidden: trueversion-source fallback flags).internal installer resolve-release-tag— thin wrapper aroundresolveInstallRef.internal installer normalize-env— projects to{installRef, provider}only.
The action layer at src/lib/actions/installer-plan.ts:48 composes all four #3107 domain helpers into a single InstallerPlan shape with {installRef, installerVersion, npm | null, provider, runtime | null}. Both npm and runtime are nullable so callers can build partial plans when probes aren't available — the test "missing optional probes without failing plan construction" pins this contract.
Test coverage targets the right invariants:
installer-plan.test.ts(3 cases) proves all 4 domain helpers compose correctly, thevalid: falseflag plumbs through for bad providers, and the env→ref+provider projection works.internal-cli.test.ts(+2 cases, +58 lines) exercises real oclif dispatch viaprocess.execPath+ JSON parse, proving routing + flag parsing + JSON emission for all three commands.
Observations (non-blocking):
provider.validistruewhen eitherraw === null(no provider given) ORnormalized !== null. Slightly counterintuitive — the next PR's wrapper will need to distinguish "no provider" from "valid provider X" when emitting user-facing errors.defaultVersiondefaults to\"0.1.0\"from #3107; in production the wrapper will pass--package-json-versionor--stamped-version, so the literal only surfaces in tests with no version sources.
install.sh is untouched, per PR description.
CI: pr.yaml lightweight checks pass (commit-lint, dco, layer-boundary, check-hash). Self-hosted queued, other rollup checks pending. CodeRabbit in progress at approval time.
Summary
Adds hidden oclif-native installer internal commands that expose the typed installer domain helpers through deterministic planning and normalization entrypoints. This prepares follow-up installer shell migrations without changing the public installer bootstrap behavior.
Changes
nemoclaw internal installer plan --jsonfor deterministic installer planning from env/probe inputs.nemoclaw internal installer resolve-release-tagandnormalize-envhelper commands.src/lib/actions/installer-plan.tsand tests for provider/ref/runtime/npm planning.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
New Features
Tests