From 066c048d4067cadd2b21c3e5a92d75110b770eae Mon Sep 17 00:00:00 2001 From: mchen-sentry Date: Tue, 12 Aug 2025 13:12:34 -0700 Subject: [PATCH 1/7] ensure docker currentContext is colima --- devenv/checks/dockerConfig.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devenv/checks/dockerConfig.py b/devenv/checks/dockerConfig.py index 9c48909..754299f 100644 --- a/devenv/checks/dockerConfig.py +++ b/devenv/checks/dockerConfig.py @@ -32,6 +32,14 @@ def check() -> tuple[bool, str]: "cliPluginsExtraDirs exists, which overshadows the default plugin path", ) + # Ensure the current context is set to colima + current_context = config.get("currentContext", "") + if current_context != "colima": + return ( + False, + f"currentContext is '{current_context}', should be 'colima'", + ) + return True, "" @@ -43,6 +51,7 @@ def fix() -> tuple[bool, str]: config.pop("credsStore", None) config.pop("cliPluginsExtraDirs", None) + config["currentContext"] = "colima" with open(os.path.expanduser("~/.docker/config.json"), "w") as f: json.dump(config, f) From 69fb40d0db7fcca3a9afaac78859505c253a5bb3 Mon Sep 17 00:00:00 2001 From: mchen-sentry Date: Tue, 12 Aug 2025 13:19:12 -0700 Subject: [PATCH 2/7] fix test/lint --- devenv/checks/dockerConfig.py | 2 +- tests/checks/test_dockerConfig.py | 31 +++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/devenv/checks/dockerConfig.py b/devenv/checks/dockerConfig.py index 754299f..e9cdd13 100644 --- a/devenv/checks/dockerConfig.py +++ b/devenv/checks/dockerConfig.py @@ -36,7 +36,7 @@ def check() -> tuple[bool, str]: current_context = config.get("currentContext", "") if current_context != "colima": return ( - False, + False, f"currentContext is '{current_context}', should be 'colima'", ) diff --git a/tests/checks/test_dockerConfig.py b/tests/checks/test_dockerConfig.py index f0cc071..7e0fad0 100644 --- a/tests/checks/test_dockerConfig.py +++ b/tests/checks/test_dockerConfig.py @@ -47,10 +47,37 @@ def test_binary_missing(fake_config: pathlib.Path, name: str) -> None: def test_fix_credsStore(fake_config: pathlib.Path) -> None: fake_config.write_text('{"credsStore": "bad"}') assert dockerConfig.fix() == (True, "") - assert fake_config.read_text() == "{}" + assert fake_config.read_text() == '{"currentContext": "colima"}' def test_fix_cliPluginsExtraDirs(fake_config: pathlib.Path) -> None: fake_config.write_text('{"cliPluginsExtraDirs": ["foo/"]}') assert dockerConfig.fix() == (True, "") - assert fake_config.read_text() == "{}" + assert fake_config.read_text() == '{"currentContext": "colima"}' + + +def test_currentContext_missing(fake_config: pathlib.Path) -> None: + fake_config.write_text('{"auths": {}}') + assert dockerConfig.check() == (False, "currentContext is '', should be 'colima'") + + +def test_currentContext_wrong(fake_config: pathlib.Path) -> None: + fake_config.write_text('{"currentContext": "desktop"}') + assert dockerConfig.check() == (False, "currentContext is 'desktop', should be 'colima'") + + +def test_currentContext_correct(fake_config: pathlib.Path) -> None: + fake_config.write_text('{"currentContext": "colima"}') + assert dockerConfig.check() == (True, "") + + +def test_fix_currentContext_missing(fake_config: pathlib.Path) -> None: + fake_config.write_text('{"auths": {}}') + assert dockerConfig.fix() == (True, "") + assert fake_config.read_text() == '{"auths": {}, "currentContext": "colima"}' + + +def test_fix_currentContext_wrong(fake_config: pathlib.Path) -> None: + fake_config.write_text('{"currentContext": "docker-desktop"}') + assert dockerConfig.fix() == (True, "") + assert fake_config.read_text() == '{"currentContext": "colima"}' From f26293051d36eaa41df9b16671dbd057e45ae51e Mon Sep 17 00:00:00 2001 From: mchen-sentry Date: Tue, 12 Aug 2025 13:22:54 -0700 Subject: [PATCH 3/7] lint --- tests/checks/test_dockerConfig.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/checks/test_dockerConfig.py b/tests/checks/test_dockerConfig.py index 7e0fad0..9210412 100644 --- a/tests/checks/test_dockerConfig.py +++ b/tests/checks/test_dockerConfig.py @@ -58,12 +58,18 @@ def test_fix_cliPluginsExtraDirs(fake_config: pathlib.Path) -> None: def test_currentContext_missing(fake_config: pathlib.Path) -> None: fake_config.write_text('{"auths": {}}') - assert dockerConfig.check() == (False, "currentContext is '', should be 'colima'") + assert dockerConfig.check() == ( + False, + "currentContext is '', should be 'colima'", + ) def test_currentContext_wrong(fake_config: pathlib.Path) -> None: fake_config.write_text('{"currentContext": "desktop"}') - assert dockerConfig.check() == (False, "currentContext is 'desktop', should be 'colima'") + assert dockerConfig.check() == ( + False, + "currentContext is 'desktop', should be 'colima'", + ) def test_currentContext_correct(fake_config: pathlib.Path) -> None: @@ -74,7 +80,9 @@ def test_currentContext_correct(fake_config: pathlib.Path) -> None: def test_fix_currentContext_missing(fake_config: pathlib.Path) -> None: fake_config.write_text('{"auths": {}}') assert dockerConfig.fix() == (True, "") - assert fake_config.read_text() == '{"auths": {}, "currentContext": "colima"}' + assert ( + fake_config.read_text() == '{"auths": {}, "currentContext": "colima"}' + ) def test_fix_currentContext_wrong(fake_config: pathlib.Path) -> None: From ea23642c131cbf48c81d5904df186090bd9cb78e Mon Sep 17 00:00:00 2001 From: mchen-sentry Date: Tue, 12 Aug 2025 13:25:46 -0700 Subject: [PATCH 4/7] fix test --- tests/checks/test_dockerConfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checks/test_dockerConfig.py b/tests/checks/test_dockerConfig.py index 9210412..1f0fa9b 100644 --- a/tests/checks/test_dockerConfig.py +++ b/tests/checks/test_dockerConfig.py @@ -24,12 +24,12 @@ def new_expanduser(s: str) -> str: def test_no_credsStore_ok(fake_config: pathlib.Path) -> None: - fake_config.write_text("{}") + fake_config.write_text('{"currentContext": "colima"}') assert dockerConfig.check() == (True, "") def test_binary_ok(fake_config: pathlib.Path) -> None: - fake_config.write_text('{"credsStore": "example"}') + fake_config.write_text('{"credsStore": "example", "currentContext": "colima"}') with mock.patch.object(shutil, "which", return_value="/fake/exe"): assert dockerConfig.check() == (True, "") From 374c2ac3ea1fdbdf3ce3ac1648d45c5d25fc5d43 Mon Sep 17 00:00:00 2001 From: mchen-sentry Date: Tue, 12 Aug 2025 13:27:01 -0700 Subject: [PATCH 5/7] last lint --- tests/checks/test_dockerConfig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/checks/test_dockerConfig.py b/tests/checks/test_dockerConfig.py index 1f0fa9b..50af998 100644 --- a/tests/checks/test_dockerConfig.py +++ b/tests/checks/test_dockerConfig.py @@ -29,7 +29,9 @@ def test_no_credsStore_ok(fake_config: pathlib.Path) -> None: def test_binary_ok(fake_config: pathlib.Path) -> None: - fake_config.write_text('{"credsStore": "example", "currentContext": "colima"}') + fake_config.write_text( + '{"credsStore": "example", "currentContext": "colima"}' + ) with mock.patch.object(shutil, "which", return_value="/fake/exe"): assert dockerConfig.check() == (True, "") From 8d2faf9b5e355c4f231f8e1dc9042996e593253d Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 12 Aug 2025 14:02:09 -0700 Subject: [PATCH 6/7] update --- ci/devenv-bootstrap.sh | 72 ++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 49 deletions(-) diff --git a/ci/devenv-bootstrap.sh b/ci/devenv-bootstrap.sh index 744bee0..af73bf2 100755 --- a/ci/devenv-bootstrap.sh +++ b/ci/devenv-bootstrap.sh @@ -53,58 +53,32 @@ export VIRTUAL_ENV="${HOME}/code/sentry/.venv" # overwrite sentry's devenv config and resync # so we don't break when upstream config is updated cat < "devenv/config.ini" -[venv.sentry] -python = 3.13.1 -path = .venv -requirements = requirements-dev.txt -editable = - . -# sourced by direnv -# bins = - -[python3.13.1] -darwin_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20250106/cpython-3.13.1+20250106-x86_64-apple-darwin-install_only.tar.gz -darwin_x86_64_sha256 = 4c4dafe2d59bb58e8d3ad26af637b7ae9c8141bb79738966752976861bdb103d -darwin_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20250106/cpython-3.13.1+20250106-aarch64-apple-darwin-install_only.tar.gz -darwin_arm64_sha256 = bbfc96038d0b6922fd783f6eb2c9bf9abb648531d23d236bc1a0c16bdd061944 -linux_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20250106/cpython-3.13.1+20250106-x86_64-unknown-linux-gnu-install_only.tar.gz -linux_x86_64_sha256 = bb4696825039a2b5dc7fea2c6aeb085c89fd397016b44165ec73b4224ccc83e2 -linux_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20250106/cpython-3.13.1+20250106-aarch64-unknown-linux-gnu-install_only.tar.gz -linux_arm64_sha256 = d37aef7bdf5c27f7d006918f7cedb31f4ba07c88f61baac4ffbe0bee6d4b5248 +[devenv] +minimum_version = 1.22.1 + +[uv] +darwin_arm64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-aarch64-apple-darwin.tar.gz +darwin_arm64_sha256 = 954d24634d5f37fa26c7af75eb79893d11623fc81b4de4b82d60d1ade4bfca22 +darwin_x86_64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-x86_64-apple-darwin.tar.gz +darwin_x86_64_sha256 = ae755df53c8c2c1f3dfbee6e3d2e00be0dfbc9c9b4bdffdb040b96f43678b7ce +linux_arm64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-aarch64-unknown-linux-gnu.tar.gz +linux_arm64_sha256 = 27da35ef54e9131c2e305de67dd59a07c19257882c6b1f3cf4d8d5fbb8eaf4ca +linux_x86_64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-x86_64-unknown-linux-gnu.tar.gz +linux_x86_64_sha256 = 6dcb28a541868a455aefb2e8d4a1283dd6bf888605a2db710f0530cec888b0ad +# used for autoupdate +version = 0.8.2 [node] -darwin_x86_64 = https://storage.googleapis.com/sentry-dev-infra-assets/node/node-v20.13.1-darwin-x64.tar.xz -darwin_x86_64_sha256 = c83bffeb4eb793da6cb61a44c422b399048a73d7a9c5eb735d9c7f5b0e8659b6 -darwin_arm64 = https://storage.googleapis.com/sentry-dev-infra-assets/node/node-v20.13.1-darwin-arm64.tar.xz -darwin_arm64_sha256 = e8a8e78b91485bc95d20f2aa86201485593685c828ee609245ce21c5680d07ce -linux_x86_64 = https://storage.googleapis.com/sentry-dev-infra-assets/node/node-v20.13.1-linux-x64.tar.xz -linux_x86_64_sha256 = efc0f295dd878e510ab12ea36bbadc3db03c687ab30c07e86c7cdba7eed879a9 -# used for autoupdate -version = v20.13.1 - -[colima] -darwin_x86_64 = https://github.com/abiosoft/colima/releases/download/v0.7.5/colima-Darwin-x86_64 -darwin_x86_64_sha256 = 53f78b4aaef5fb5dab65cae19fba4504047de1fdafa152fba90435d8a7569c2b -darwin_arm64 = https://github.com/abiosoft/colima/releases/download/v0.7.5/colima-Darwin-arm64 -darwin_arm64_sha256 = 267696d6cb28eaf6daa3ea9622c626697b4baeb847b882d15b26c732e841913c -linux_x86_64 = https://github.com/abiosoft/colima/releases/download/v0.7.5/colima-Linux-x86_64 -linux_x86_64_sha256 = a3d440033776b2fb0cdd6139a2dbebf6764aabf78a671d4aa13b45c26df21a8a -linux_arm64 = https://github.com/abiosoft/colima/releases/download/v0.7.5/colima-Linux-aarch64 -linux_arm64_sha256 = 330e11a4b2e5ce69ee6253635308c9f0f49195f236da01718ede35cdb2729901 -# used for autoupdate -version = v0.7.5 - -[lima] -# upstream github releases aren't built for macOS 14, so we use homebrew binaries -# from https://formulae.brew.sh/api/formula/lima.json -darwin_x86_64 = https://ghcr.io/v2/homebrew/core/lima/blobs/sha256:c2e69a572afa3a3cf895643ede988c87dc0622dae4aebc539d5564d820845841 -darwin_x86_64_sha256 = c2e69a572afa3a3cf895643ede988c87dc0622dae4aebc539d5564d820845841 -darwin_arm64 = https://ghcr.io/v2/homebrew/core/lima/blobs/sha256:be8e2b92961eca2f862f1a994dbef367e86d36705a705ebfa16d21c7f1366c35 -darwin_arm64_sha256 = be8e2b92961eca2f862f1a994dbef367e86d36705a705ebfa16d21c7f1366c35 -linux_x86_64 = https://ghcr.io/v2/homebrew/core/lima/blobs/sha256:741e9c7345e15f04b8feaf5034868f00fc3ff792226c485ab2e7679803411e0c -linux_x86_64_sha256 = 741e9c7345e15f04b8feaf5034868f00fc3ff792226c485ab2e7679803411e0c +# upstream (https://nodejs.org/dist/) is not reliable enough +# ask someone in team-devinfra to upload for you +darwin_x86_64 = https://storage.googleapis.com/sentry-dev-infra-assets/node/node-v22.16.0-darwin-x64.tar.xz +darwin_x86_64_sha256 = 5c34638f2c0e3f3aaa7b3a94b58304765a169730da1896ebba8515ea4d987a9c +darwin_arm64 = https://storage.googleapis.com/sentry-dev-infra-assets/node/node-v22.16.0-darwin-arm64.tar.xz +darwin_arm64_sha256 = aaf7fc3c936f1b359bc312b63638e41f258689ac2303966ad932cda18c54ea00 +linux_x86_64 = https://storage.googleapis.com/sentry-dev-infra-assets/node/node-v22.16.0-linux-x64.tar.xz +linux_x86_64_sha256 = f4cb75bb036f0d0eddf6b79d9596df1aaab9ddccd6a20bf489be5abe9467e84e # used for autoupdate -version = 0.23.2 +version = v22.16.0 EOF devenv sync From bc943b5ef84cfa010549a6c0c3017036a71eed27 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 12 Aug 2025 15:13:10 -0700 Subject: [PATCH 7/7] forgot --- ci/devenv-bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/devenv-bootstrap.sh b/ci/devenv-bootstrap.sh index af73bf2..b18db20 100755 --- a/ci/devenv-bootstrap.sh +++ b/ci/devenv-bootstrap.sh @@ -91,7 +91,7 @@ if [[ "$got" != "$expected" ]]; then fi # devenv-bootstrap.sh overrides sentry devenv config.ini with this version -expected="v20.13.1" +expected="v22.16.0" # more rigorous check than node --version got=$(node -e 'console.log(process.version);') if [[ "$got" != "$expected" ]]; then