Repository navigation
Separate NFS home staging policy from copy mechanics - #11907
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Security-sensitive NFS staging spans multiple modules, requiring human review of credential exclusion before opening files, pinned-descriptor and symlink-race guarantees, and cleanup on root-squashed Docker/gVisor homes.
No open issues 🎉
What changed in this PR
Refactors NFS home staging into focused modules, addressing #11902 while preserving public exports and existing staging behavior.
Changes:
- Separate credential exclusions, descriptor-based copying, and tool-path staging.
- Reduce
stageNfsHometo validation and orchestration; extract the buffered file-transfer loop. - Add regression coverage for short writes and descriptor cleanup after copy failures.
| File | Description |
|---|---|
src/nfs-home.ts |
Preserves public exports and coordinates staging. |
src/nfs-home.test.ts |
Adds short-write and copy-failure cleanup tests. |
src/nfs-home-tools.ts |
Handles tool-path selection, deduplication, and destination directories. |
src/nfs-home-exclusions.ts |
Builds credential exclusions and expands canonical symlink targets. |
src/nfs-home-copy.ts |
Houses descriptor helpers, recursive copying, and buffered transfers. |
Review effort: Max (adaptive)
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
|
@copilot merge main, resolve conflicts, and address review feedback |
…e-nfs-home Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 94.41% | 94.41% | ➡️ +0.00% |
| Statements | 93.04% | 93.03% | 📉 -0.01% |
| Functions | 93.62% | 93.58% | 📉 -0.04% |
| Branches | 87.36% | 87.36% | ➡️ +0.00% |
📁 Per-file Coverage Changes (3 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/main-action-cleanup.ts |
97.9% → 96.9% (-1.03%) | 98.0% → 97.0% (-0.99%) |
src/routing/bootstrap.ts |
91.0% → 90.0% (-1.00%) | 86.6% → 85.3% (-1.34%) |
src/nfs-home.ts |
90.6% → 91.2% (+0.59%) | 85.9% → 91.9% (+5.96%) |
✨ New Files (3 files)
src/nfs-home-copy.ts: 88.0% linessrc/nfs-home-exclusions.ts: 100.0% linessrc/nfs-home-tools.ts: 97.9% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
stageNfsHomecombined validation, credential exclusions, descriptor-based copying, and tool staging. This split isolates the security-sensitive policy and reduces the orchestration module from 307 to 65 lines.