feat(policy): allow selecting policy presets by number#1195
feat(policy): allow selecting policy presets by number#1195cr7258 wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaced the CLI's printed preset menu with a new interactive chooser Changes
Sequence Diagram(s)mermaid 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 unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/policies.test.js`:
- Around line 22-62: The helper runPolicyAdd creates a temporary directory
(tmpDir) and writes scriptPath but never removes it; wrap the spawnSync call in
a try/finally (or ensure cleanup after execution) and remove tmpDir in the
finally block using a recursive forced removal (e.g., fs.rmSync(tmpDir, {
recursive: true, force: true })) so the temp directory (and the script file
inside) is always deleted after runPolicyAdd completes, even on errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7d421a00-4df3-41ba-a6d8-5b9939b63535
📒 Files selected for processing (3)
bin/lib/policies.jsbin/nemoclaw.jstest/policies.test.js
Summary
Allow
nemoclaw <sandbox> policy-addto be selected by number instead of typing preset names.root@se7en:/tmp/NemoClaw# node bin/nemoclaw.js seven-demo policy-add Available presets: 1) ○ discord — Discord API, gateway, and CDN access 2) ○ docker — Docker Hub and NVIDIA container registry access 3) ○ huggingface — Hugging Face Hub, LFS, and Inference API access 4) ○ jira — Jira and Atlassian Cloud access 5) ● npm — npm and Yarn registry access 6) ○ outlook — Microsoft Outlook and Graph API access 7) ○ pypi — Python Package Index (PyPI) access 8) ○ slack — Slack API, Socket Mode, and webhooks access 9) ○ telegram — Telegram Bot API access ● applied, ○ not applied Choose preset [1]: 7 Apply 'pypi' to sandbox 'seven-demo'? [Y/n]: y ✓ Policy version 3 submitted (hash: 462a3f55b4da) ✓ Policy version 3 loaded (active version: 3) Applied preset: pypiRelated Issue
Fixes #1164
Changes
Type of Change
Testing
npx prek run --all-filespasses (or equivalentlymake check).npm testpasses.make docsbuilds without warnings. (for doc-only changes)Checklist
General
Code Changes
npx prek run --all-filesauto-fixes formatting (ormake formatfor targeted runs).Doc Changes
update-docsagent skill to draft changes while complying with the style guide. For example, prompt your agent with "/update-docscatch up the docs for the new changes I made in this PR."Signed-off-by: Seven Cheng sevenc@nvidia.com
Summary by CodeRabbit
New Features
Validation
Tests