Skip to content

test(blueprint): add chown coverage and debug logging for snapshot restore#1899

Merged
ericksoa merged 1 commit into
mainfrom
fix/snapshot-chown-tests-and-logging
Apr 15, 2026
Merged

test(blueprint): add chown coverage and debug logging for snapshot restore#1899
ericksoa merged 1 commit into
mainfrom
fix/snapshot-chown-tests-and-logging

Conversation

@ericksoa
Copy link
Copy Markdown
Contributor

@ericksoa ericksoa commented Apr 15, 2026

Summary

Follow-up to #1667 — the best-effort chown-after-restore path had no test coverage and silently discarded failures.

  • Add three tests for the chown behavior in restoreIntoSandbox:
    • chown is called after successful cp with correct args
    • chown failure still returns true (best-effort semantics)
    • chown is not called when cp fails
  • Add console.debug breadcrumb when chown exits non-zero, so ownership failures leave a trace instead of vanishing silently

Test plan

  • npx vitest run nemoclaw/src/blueprint/snapshot.test.ts — 19/19 pass
  • npm run build (plugin) — clean
  • make check — all hooks pass
  • Pre-existing test/policies.test.ts failures (15) confirmed on main — unrelated

Signed-off-by: Aaron Erickson aerickson@nvidia.com

Summary by CodeRabbit

Release Notes

  • Improvements

    • Enhanced sandbox restoration process with improved logging and error handling for permission operations.
  • Tests

    • Added comprehensive test coverage for sandbox restoration scenarios, including success, partial failure, and error cases.
  • Documentation

    • Added documentation for AI-assisted label triage workflow and guidelines.

…store

Follow-up to #1667 — the chown-after-restore path had no test coverage
and silently discarded failures. Add three tests (chown called, chown
failure still returns true, chown skipped on cp failure) and a
console.debug breadcrumb when chown exits non-zero.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

A new skill instruction document for AI-assisted GitHub issue and PR label triage is added, and the restoreIntoSandbox function is enhanced to capture and log chown operation results with corresponding unit tests.

Changes

Cohort / File(s) Summary
Skill Instructions
.agents/skills/nemoclaw-user-triage-instructions/SKILL.md
New skill definition for AI-assisted label triage, specifying label selection rules, output formatting, tone constraints, and operational restrictions.
Sandbox Restore Logic
nemoclaw/src/blueprint/snapshot.ts
Enhanced restoreIntoSandbox to capture and log the result of recursive chown operation, emitting debug messages with sandbox name, exit code, and stderr when chown exits non-zero (non-fatal).
Snapshot Tests
nemoclaw/src/blueprint/snapshot.test.ts
Added three test cases verifying: successful chown after cp, non-fatal chown failure, and prevention of chown when cp fails.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Labels hop and triage flows,
Our sandbox sweeps with chown now glows—
When dust settles (or fails to care),
We log it all, debug aware! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding test coverage for chown behavior and debug logging in snapshot restore functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/snapshot-chown-tests-and-logging

Comment @coderabbitai help to get the list of available commands and usage tips.

@ericksoa ericksoa merged commit bc7c16e into main Apr 15, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant