refactor(cli): pass lifecycle typed options - #2928
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 📝 WalkthroughWalkthroughThe PR refactors sandbox lifecycle actions to accept typed options objects instead of CLI argument arrays. It introduces ChangesLifecycle Options Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 |
## Summary Move simple cross-flag validation into oclif metadata so NemoClaw does not maintain duplicate parser logic for relationships oclif already supports. ## Stack Navigation - Position: 34 of 60 - Previous PR: [#2926 — refactor(cli): add shared oclif command base](#2926) - Next PR: [#2928 — refactor(cli): pass lifecycle typed options](#2928) ## Changes - Made onboard `--resume` and `--fresh` mutually exclusive through oclif flag metadata. - Made policy `--from-file` and `--from-dir` mutually exclusive through oclif flag metadata. - Added command-level tests showing invalid flag combinations fail before action dispatch. - Updated policy CLI expectations for oclif's relationship validation wording. ## 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) ## Verification - [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 - [ ] Docs updated for user-facing behavior changes - [ ] `make 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) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## New Features * Added `sandbox doctor` command for comprehensive health diagnostics * Enhanced logs streaming with `--follow`, `--tail`, and `--since` filtering options ## Improvements * Added short flag aliases: `-y` for `--yes`, `-q` for `--quick`, `-n` for `--tail`, `-v` for `--verbose`, `-o` for `--output` * Improved CLI help output with command examples across all subcommands * Enhanced error messages and argument validation for better user guidance * Extended sandbox rebuild workflow with credential preflight and workspace backup/restore ## Documentation * Updated documented CLI flag syntax for all major commands with new short forms and options <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
## Summary Move duration syntax validation into shared custom oclif flags so logs and shields adapters rely on oclif parsing instead of post-parse validation. ## Stack Navigation - Position: 36 of 60 - Previous PR: [#2928 — refactor(cli): pass lifecycle typed options](#2928) - Next PR: [#2930 — refactor(cli): project public help through oclif](#2930) ## Changes - Added shared custom oclif duration flag parsers for logs `--since` and shields `--timeout`. - Updated logs command parsing to receive an already-normalized `--since` value from oclif. - Updated hidden shields down command metadata to use the shared timeout parser. - Added unit coverage for accepted and rejected duration inputs. ## 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) ## Verification - [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 - [ ] Docs updated for user-facing behavior changes - [ ] `make 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) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Enhanced validation and whitespace normalization for duration inputs in CLI flags (`--since` and `--timeout`), with clearer error messages for invalid values. * **Tests** * Added test coverage for duration flag parsing to ensure proper validation and error handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Stop rebuilding argv strings in lifecycle oclif adapters and pass typed option objects from the parsed oclif result into action facades.
Stack Navigation
Changes
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
Release Notes
Refactor
Tests