Refactor Cloud Hypervisor runtime backend into focused modules - #8518
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Signal cleanup cannot reach the in-flight manager until boot fully completes, potentially orphaning microVM resources.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Refactors the Cloud Hypervisor runtime into focused lifecycle modules while preserving its compatibility entry point.
Changes:
- Separates boot, readiness, cleanup, and runtime facade responsibilities.
- Centralizes shared runtime constants.
- Adds coverage for both import paths.
File summaries
| File | Description |
|---|---|
src/cloud-hypervisor/runtime-readiness.ts |
Extracts network and connectivity probes. |
src/cloud-hypervisor/runtime-cleanup.ts |
Extracts teardown and diagnostics. |
src/cloud-hypervisor/runtime-boot-loop.ts |
Extracts boot orchestration and retries. |
src/cloud-hypervisor/runtime-backend.ts |
Implements the focused runtime facade. |
src/cloud-hypervisor/backend-utils.ts |
Centralizes shared constants. |
src/cloud-hypervisor-runtime-backend.ts |
Preserves compatibility exports. |
src/cloud-hypervisor-runtime-backend.test.ts |
Verifies both import paths. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| failedBootDiagnostics: this.failedBootDiagnostics, | ||
| cleanedManagers: this.cleanedManagers, | ||
| }); | ||
| this.manager = boot.manager; |
|
@copilot address the review feedback |
Addressed in 32e60a5 (plus follow-up 3e13d64):
|
|
✅ Copilot review passed with no inline comments. @copilot Add the |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 94.09% | 94.09% | ➡️ +0.00% |
| Statements | 92.76% | 92.77% | ➡️ +0.01% |
| Functions | 93.48% | 93.38% | 📉 -0.10% |
| Branches | 86.63% | 86.62% | ➡️ -0.01% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/cloud-hypervisor-runtime-backend.ts |
96.2% → 100.0% (+3.76%) | 93.4% → 100.0% (+6.60%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (4 files)
src/cloud-hypervisor/runtime-backend.ts: 96.3% linessrc/cloud-hypervisor/runtime-boot-loop.ts: 96.3% linessrc/cloud-hypervisor/runtime-cleanup.ts: 94.0% linessrc/cloud-hypervisor/runtime-readiness.ts: 92.7% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
✅ Smoke Claude passed Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
Smoke Test: Services Connectivity — PASS ✅
Overall: PASS
|
|
Merged PR titles:
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed25.pkgs.visualstudio.com"See Network Configuration for more information.
|
|
Smoke Test: Copilot Engine —
Overall: PASS
|
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (api.github.com) reachable: HTTP 200 Overall status: PASS
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
✅ Copilot BYOK Smoke Test Results
Status: PASS cc:
|
Smoke Test: API Proxy OpenTelemetry Tracing — Results
All scenarios passed. No issues found.
|
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 94.09% | 94.09% | ➡️ +0.00% |
| Statements | 92.76% | 92.77% | ➡️ +0.01% |
| Functions | 93.48% | 93.38% | 📉 -0.10% |
| Branches | 86.63% | 86.62% | ➡️ -0.01% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/cloud-hypervisor-runtime-backend.ts |
96.2% → 100.0% (+3.76%) | 93.4% → 100.0% (+6.60%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (4 files)
src/cloud-hypervisor/runtime-backend.ts: 96.3% linessrc/cloud-hypervisor/runtime-boot-loop.ts: 96.3% linessrc/cloud-hypervisor/runtime-cleanup.ts: 94.0% linessrc/cloud-hypervisor/runtime-readiness.ts: 92.7% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environment (
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Notes:
|
CloudHypervisorRuntimeBackendmixed boot orchestration, guest execution, readiness probing, and cleanup/diagnostics in one large file. This made the security-sensitive guest network readiness path harder to review independently.Runtime facade
src/cloud-hypervisor/runtime-backend.ts.src/cloud-hypervisor-runtime-backend.tsas a compatibility re-export.Boot lifecycle
runtime-boot-loop.ts.Readiness probing
runtime-readiness.ts.Cleanup and diagnostics
runtime-cleanup.ts.Shared constants
backend-utils.ts.