Repository navigation
test(runtime): verify existing MicroSandbox source migration - #1487
Conversation
✅ Deploy Preview for devsydev canceled.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
✅ Deploy Preview for images-devsy-sh canceled.
|
|
@greptileai review |
[Medium impact] The reviewed changes appear safe to merge, with no actionable issues found. SummaryAdds coverage for moving an existing MicroSandbox workspace from the embedded driver to external provider
No actionable issues were found. This review used source inspection; it did not run the native migration cases.
|
|
@coderabbitai full review Please review the complete current draft at 0aeea93, covering all four changed files and retained security, architecture, lifecycle/cleanup and merge-risk concerns. Exact-head implementation CI and all 80 native scenarios passed; Greptile completed 5/5. Keep the PR draft while the full review completes. |
✅ Action performedFull review finished. |
|
@coderabbitai Please supplement your completed full review (run 4b98975b-8f6d-4895-b72b-8d5b8277100a) of exact head 0aeea93 with an explicit security/architecture assessment of all four changed files. The completed summary contains merge risk but no security/architecture section. Assess provider/source trust boundaries, workspace/VM preservation assertions, ownership and bounded cleanup, and the post-commit init-failure contract. Identify any significant unresolved concern, or state that none was found. This asks for the missing assessment, not another full review; keep the PR draft. We are independently investigating the reported zizmor parser failure against the unchanged base expression. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
git rev-parse HEAD
gh pr view 1487 --repo devsy-org/devsy --json headRefOid,baseRefOid,isDraft
git show --stat --oneline 0aeea936aba901a4d2a1622458cda1dfb9ac0cdf
ast-grep outline e2e/tests/up/provider_microsandbox_migration.go --items all
ast-grep outline cmd/provider/set_source_init_failure_test.go --items all
gh pr diff 1487 --repo devsy-org/devsy -- .github/workflows/pr-ci.yml e2e/tests/up/MICROSANDBOX.md 2>/dev/null || git diff HEAD^ HEAD -- .github/workflows/pr-ci.yml e2e/tests/up/MICROSANDBOX.md
sed -n '1,380p' e2e/tests/up/provider_microsandbox_migration.go
sed -n '1,220p' cmd/provider/set_source_init_failure_test.goLength of output: 25046 🏁 Script executed: #!/bin/bash
set -euo pipefail
git diff --stat 571d46ed222ef1ac6e2ba19e2e701f390358b38a...0aeea936aba901a4d2a1622458cda1dfb9ac0cdf
git diff 571d46ed222ef1ac6e2ba19e2e701f390358b38a...0aeea936aba901a4d2a1622458cda1dfb9ac0cdf -- .github/workflows/pr-ci.yml e2e/tests/up/MICROSANDBOX.md
rg -n -C3 'func .*snapshotCompatibilityWorkspace|type compatibilityWorkspaceState|func .*inspectSafeRecreate|func .*microsandboxResourceCommand|func .*newMicrosandboxTestSession|microsandboxExternalProvider\s*=|func .*CleanupWorkspace|func .*SetSourceCmd.*Run|func .*SetProviderSource|func .*ReplaceProvider|func .*InitProvider' --type go .
fd -i 'set_source|compatibility|safe_recreate|resource|provider' cmd/provider pkg/workspace e2e/tests/up e2e/framework
ast-grep outline cmd/provider --items all --type function,method --match 'Run|Source'
ast-grep outline pkg/workspace --items all --type function --match 'Provider|Init'
ast-grep outline e2e/framework/util.go --items all --match 'Cleanup|Workspace'
sed -n '370,540p' .github/workflows/pr-ci.yml
sed -n '100,155p' e2e/tests/up/MICROSANDBOX.mdLength of output: 27861 🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline cmd/provider/set_source.go --items all
ast-grep outline pkg/workspace/provider.go --items all
ast-grep outline e2e/tests/up/microsandbox_session.go --items all
ast-grep outline e2e/tests/up/provider_microsandbox_compatibility.go --items all --match 'compatibilityWorkspaceState|compatibilityFileState|snapshotCompatibilityWorkspace|snapshotCompatibilityFile'
ast-grep outline e2e/tests/up/provider_microsandbox_recreate.go --items all --match 'safeRecreateInspection|inspectSafeRecreate'
ast-grep outline e2e/tests/up/provider_microsandbox_resources.go --items all --match microsandboxResourceCommand
ast-grep outline e2e/framework/command.go --items all --match 'CleanupWorkspace|DevsyWorkspaceDelete'
sed -n '1,250p' cmd/provider/set_source.go
sed -n '80,220p' e2e/tests/up/microsandbox_session.go
sed -n '500,620p' e2e/tests/up/provider_microsandbox_compatibility.go
sed -n '40,85p' e2e/tests/up/provider_microsandbox_recreate.go
sed -n '335,375p' e2e/tests/up/provider_microsandbox_recreate.go
sed -n '350,380p' e2e/tests/up/provider_microsandbox_resources.go
sed -n '505,550p' e2e/framework/command.go
rg -n -C8 'func (UpdateProvider|updateProvider|SwitchProvider)\b|func .*Init\b|InitAttempted|InitError' pkg/workspace/provider.go pkg/provider --glob '*.go' --glob '!**/*_test.go'Length of output: 25220
Security and architecture assessment
|
|
Final disposition for exact head
This establishes the tested migration and init-failure contracts. It does not promise rollback after committed initialization/recreation effects, raw VM configuration equivalence, or runtime behavior on other host profiles. |
Existing MicroSandbox workspaces need evidence that changing the same provider name from the embedded driver to the published external provider preserves their VM and data. This adds running and stopped
provider set-sourcescenarios against external provider 0.1.8, using the existing shared test session, independent suite deadline and report validator.Each scenario starts with the embedded provider and user-provided memory, storage and ephemeral-root options. It verifies the new pinned source and external driver, successful initialization, unchanged provider name/default/options, persisted workspace and SSH records, VM creation time and root/named-volume/bind markers. A running guest keeps its boot ID through migration and ordinary up. A stopped guest stays stopped through source replacement, then ordinary up resumes the same VM with a new boot ID and retained data. Workspace deletion must remove the record and exact owned sandbox; fallback cleanup and named-volume removal have independent bounded attempts. The command test separately proves that failed initialization after committing a replacement leaves that source selected but uninitialized, records the error and preserves options/default/workspace bytes. It does not promise rollback or binary-tree replacement recovery.
The branch normally integrates actual merged PR1485 and current related main, retaining the Go helper foundation, remote-agent row, direct shared SSH calls, dynamic Windows coverage and existing caching/deadlines. The new external-only two-case row makes the configured catalogue 16 suites/80 cases (37 built-in, 43 external). No production behavior or default selection changes; the embedded manifest and driver remain intact.
Local validation: full affected command/up/helper races, Linux E2E/command/helper vet, Linux amd64 and arm64 E2E compilation, Windows command-package compilation, module verification and strict Linux CI lint with zero issues passed. A network-isolated Linux dry run selected exactly the two external migration cases; that proves registration only. All 13 affected-file hooks completed: nine passed and four had expected no-file skips; formatting and diff checks passed. Local CodeRabbit remains temporarily waived by the user while its service cannot start; no local review coverage is claimed.
Exact-head implementation run 38628263920 passed all 88 jobs. All 16 native reports passed once: 80 selected cases (37 built-in, 43 external), including both actual running/stopped migration cases, with no selected skips, dry run or focus. Windows passed all 42 discovered roots and 84 test/subtest IDs plus both helper units. The current performance artifact records 808 reaped warm probes and successful fresh/reused up; it makes no cold-cache or speedup claim. Fresh Greptile completed for this exact head with confidence 5/5 and no actionable findings. Full CodeRabbit completed while draft for all four files with no actionable comments and Minimal merge risk. A supplemental exact-head security/architecture assessment completed with no significant unresolved concerns; its full source-backed limits were inspected. The embedded zizmor parser failure reproduces on the unchanged base expression, and semantically equivalent temporary YAML scans show no introduced finding; the original scanner result is not claimed as passing. Final live checks, threads and all 23 GitHub signatures were refreshed before readiness. The external-provider transition stays conditional on these and the remaining documentation/applicability gates.