fix(policy): reject invalid custom preset YAML (Fixes #9406) - #9409
Conversation
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan includes up to 12 reviews per rolling hour; 6 remain after this review. 📝 WalkthroughWalkthroughCustom preset application now rejects unparseable or missing ChangesCustom preset validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change makes malformed custom preset documents fail closed before policy checks and mutation, with regression coverage and validation reported as passing. No actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
1 additional E2E selection from the second opinionAdvisory only. The primary lane did not select these E2E jobs or targets.
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. Since last review: 0 prior items resolved · 0 still apply · 0 new items found 1 semantic terminology decisionTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite for the commit under review. Recommended E2E: Manual-only E2E: 1 optional E2E recommendation
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
|
Thanks for picking this up so quickly. I filed #9406 and had a branch on the same approach, so rather than open a duplicate here are three things from my testing that may be worth folding in. Two now-dead conditions. With the early return in place, A positive regression test. The risk in turning a silent skip into a hard failure is over-rejection. I enumerated the shapes empirically against the pinned Replay paths are safe, and it is worth stating why. Happy to send any of this as a PR against your branch, or as a follow-up after this merges — whichever you prefer. |
prekshivyas
left a comment
There was a problem hiding this comment.
Reviewed commit ec1d3d6. No blocking findings.
Fixes NVIDIA#9406 Signed-off-by: Deepak Jain <deepujain@gmail.com>
Signed-off-by: Deepak Jain <deepujain@gmail.com>
ec1d3d6 to
18e1741
Compare
|
Removed both unreachable null guards and strengthened the positive path to apply a complete custom preset and record its content verbatim in customPolicies. Focused policy validation passes 121/121. Replay remains safe because the registry writers persist either accepted preset content or YAML.stringify output. Rebased on main; both PR commits are signed and GitHub Verified. |
Summary
Custom preset application now fails closed when the full preset document cannot be parsed into a
network_policiesmapping. This prevents malformed metadata above a valid policy tail from bypassing the custom-preset guards.Related Issue
Fixes #9406
Changes
network_policiesbefore reserved-key,allowed_ips, semantic, disclosure, or mutation work.Type of Change
Quality Gates
DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpx vitest run --project cli src/lib/policy/preset-allowed-ips.test.tspassed 14 tests.npm run test:changedpassed 139 files and 1,944 tests after the 25-test growth-guardrail lane passed.npm run docsbuilds without warnings (doc changes only)Additional validation:
npm run build:clipassed.npm run typecheck:clipassed.git diff --checkpassed.Signed-off-by: Deepak Jain deepujain@gmail.com
Summary by CodeRabbit