Repository navigation
fix(colima): Boot legacy overlay2 VMs and install missing Colima/Lima on start - #259
Merged
Merged
Conversation
Ignore Lima's stderr "No disk matching colima found." warning (merged into stdout by proc.run) when probing for a data disk, and include the output in the error if the JSON is genuinely invalid. Install devenv's Colima, Lima and docker CLI from `colima.start()` on macOS when they are missing from devenv's bin dir, instead of requiring `devenv update` first. Co-Authored-By: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Start test installs real global tools
- Stubbed _ensure_global_tools in test_fresh_vm_containerd_store_survives_stop_and_start so start() cannot trigger real Colima/Lima/Docker installs on Darwin.
Or push these changes by commenting:
@cursor push 4085470aa4
Preview (4085470aa4)
diff --git a/tests/lib/test_colima_storage.py b/tests/lib/test_colima_storage.py
--- a/tests/lib/test_colima_storage.py
+++ b/tests/lib/test_colima_storage.py
@@ -221,6 +221,7 @@ def run(command: tuple[str, ...], **kwargs: object) -> str:
with (
mock.patch.object(colima, "home", str(home)),
mock.patch.object(colima, "root", str(root)),
+ mock.patch.object(colima, "_ensure_global_tools"),
mock.patch.object(colima, "check", side_effect=lambda: next(statuses)),
mock.patch.object(colima, "_start", side_effect=start_vm),
mock.patch("devenv.lib.colima.proc.run", side_effect=run),
@@ -221,6 +221,7 @@ def run(command: tuple[str, ...], **kwargs: object) -> str:
with (
mock.patch.object(colima, "home", str(home)),
mock.patch.object(colima, "root", str(root)),
+ mock.patch.object(colima, "_ensure_global_tools"),
mock.patch.object(colima, "check", side_effect=lambda: next(statuses)),
mock.patch.object(colima, "_start", side_effect=start_vm),
mock.patch("devenv.lib.colima.proc.run", side_effect=run),You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit a95c024. Configure here.
start() now installs missing Colima, Lima, and Docker before booting. The containerd stop/start test patches only colima's root, so Lima and Docker would install into the real devenv prefix on macOS. Co-authored-by: Cursor <cursoragent@cursor.com>
joshuarli
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


devenv colima start(whichdevservices upruns duringdevenv syncwhen Docker is down) failed in two ways on a Mac with an existing legacy overlay2 Colima VM and no devenv-managed Colima/Lima.Bug 1: Lima's "no disk" warning is parsed as JSON
_legacy_root_disk()runslimactl disk list --json colimathroughproc.run(..., stdout=True), which merges stderr into the captured output. For a stopped legacy VM (disk: 512,runtime: docker, norootDisk, no~/.colima/_store/colima.json, no Lima data disk), Lima 2.2.1 exits 0, prints nothing on stdout and writes this to stderr:json.loadschoked on that line, so the VM never started. Ignoring the warning takes the existing no-data-disk path, which writescontainerd-snapshotter: falseand boots with overlay2 and the existing images intact.Changes
json.loads, keep only output lines whose first non-space character is{or[. If none remain, there is no data disk (disk = None). The command tuple is unchanged.StorageMigrationBlockedmessage now includes the captured output. It no longer says to repair Lima. It says to leave the Lima install and VM disks in place and to setdocker.features.containerd-snapshotterin~/.colima/default/colima.yaml.Bug 2: missing devenv Colima/Lima aborts start
colima.check()exits whencolimais not on PATH, and onlydevenv updatecallscolima.install_global()/limactl.install_global(). On the affected Mac, Homebrew had Colima 0.7.5 and Lima installed but unlinked, and~/.local/share/sentry-devenv/bin/colimadid not exist, sodevenv colima startcould not recover on its own.Changes
colima.start()now calls a new_ensure_global_tools()first. On macOS, if{root}/bin/colimaor{root}/bin/limactlis missing it runscolima.install_global()andlimactl.install_global(). If{root}/bin/dockeris missing it runsdocker.install_global().check()error now names~/.local/share/sentry-devenv/binand says a Homebrew Colima isn't used.Tests
tests/lib/test_colima_storage.py:expected_snapshotter is False), writescontainerd-snapshotter: false, and leaves the command tuple unchanged.{"name":"colima"}is treated as a modern data disk and blocks.StorageMigrationBlockedand the message includes the output.start()calls the installers when the bin files are missing, and skips them when they exist.{invalid. A bareinvalidline has no{/[prefix, so it is now treated as ignorable noise per the new rule.tests/lib/test_colima.pypatches_ensure_global_toolsfor itsstart()tests, so they don't try to install tools on a simulated Mac.tests/test_main.py::testfails on the Linux test VM with "docker engine not installed", both with and without this change. Everything else passes (276 tests), as doesuv run prek run --all-files. The~/dev/sentrysmoke test from AGENTS.md was not run, because it needs a Mac and this change doesn't alter devenv's Python pin or the Colima/Lima versions.