refactor(cli): parse durations with oclif flags - #2929
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 No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughA new shared module extracts duration parsing logic into reusable oclif flag adapters. ChangesDuration Parsing Extraction
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 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 Stop rebuilding argv strings in lifecycle oclif adapters and pass typed option objects from the parsed oclif result into action facades. ## Stack Navigation - Position: 35 of 60 - Previous PR: [#2927 — refactor(cli): use oclif flag relationships](#2927) - Next PR: [#2929 — refactor(cli): parse durations with oclif flags](#2929) ## Changes - Added typed lifecycle option shapes and compatibility normalizers for destroy, rebuild, gc, and upgrade-sandboxes. - Updated lifecycle command classes to pass typed options instead of reconstructed legacy argv arrays. - Kept action-level compatibility with existing internal argv callers. - Replaced a gc source-shape assertion with behavior-level option normalization coverage. ## 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 ## Release Notes * **Refactor** * Internal improvements to command option handling for enhanced type safety and consistency across sandbox management operations. * **Tests** * Added test coverage for option normalization utilities to ensure robust handling of configuration flags. <!-- 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 Replace the transitional hand-written public sandbox help renderer with an oclif `CommandHelp` projection that keeps NemoClaw's public syntax while letting oclif render command details. ## Stack Navigation - Position: 37 of 60 - Previous PR: [#2929 — refactor(cli): parse durations with oclif flags](#2929) - Next PR: [#2936 — test(cli): cover oclif metadata routing helpers](#2936) ## Changes - Extended oclif metadata lookup so public help can access args, flags, base flags, usage, and examples. - Reworked public sandbox help rendering to use `CommandHelp` with an overridden public usage line. - Preserved public `nemoclaw <name> action` syntax while rendering oclif-managed flags, arguments, descriptions, and examples. - Updated help tests to assert the projected oclif output does not leak internal command IDs. ## Notes Help output format changes from `Usage: nemoclaw ...` to `$ nemoclaw ...` (oclif default rendering). Public command syntax and flags are unchanged; only the leading prefix in help/example lines differs. ## 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** * Help output now displays with enhanced structure, including clearly separated USAGE sections with command syntax examples, FLAGS sections listing available options, and fully-resolved command examples to guide users through commands. * Help text generation now uses standardized formatting, ensuring consistent and professional presentation across all CLI commands. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- 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
Changes
--sinceand shields--timeout.--sincevalue from oclif.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
Improvements
--sinceand--timeout), with clearer error messages for invalid values.Tests