Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(release): sync libs/cua/Cargo.lock on cua-sdk release PRs (#5612)

Francesco Bonacci39b24aa6a50e
diff --git a/.github/scripts/sync_sdk_release_locks.py b/.github/scripts/sync_sdk_release_locks.py
index 728cb387d8..a5e8570e6e 100644
--- a/.github/scripts/sync_sdk_release_locks.py
+++ b/.github/scripts/sync_sdk_release_locks.py
@@ -10,8 +10,8 @@ manifests" (scripts/ci/check-lockfiles.sh). Those are:
libs/cua/typescript;
- every Cargo.lock that locks crates of the libs/cua workspace by path
(cua-proto, cua-spacesd-client, cua-hotspot, ...): the workspace releases
- at the SDK version, so those entries follow it. Release Please bumps
- libs/cua/Cargo.lock's own entries through the workspace version.
+ at the SDK version, so those entries follow it. That includes
+ libs/cua/Cargo.lock itself: Release Please bumps only Cargo.toml files.
Only that one recorded version changes. Rewriting the field instead of
relocking keeps the diff independent of the uv and npm versions on the runner
@@ -115,7 +115,7 @@ def main(argv: list[str] | None = None) -> int:
changed += [
lock
for lock in tracked(root, "Cargo.lock")
- if lock != "libs/cua/Cargo.lock" and sync_cargo_lock(root / lock, entries, version)
+ if sync_cargo_lock(root / lock, entries, version)
]
print("\n".join(changed))
return 0
diff --git a/.github/scripts/tests/test_sync_sdk_release_locks.py b/.github/scripts/tests/test_sync_sdk_release_locks.py
index 7f762415c5..cebfc6ad7b 100644
--- a/.github/scripts/tests/test_sync_sdk_release_locks.py
+++ b/.github/scripts/tests/test_sync_sdk_release_locks.py
@@ -93,6 +93,8 @@ def test_cargo_locks_follow_the_published_sdk_crates(tmp_path: Path, capsys: pyt
+ crate("cua-proto", "0.5.0")
+ "\n"
+ crate("cua-spacesd-client", "0.5.0"),
+ # The workspace's own lock: Release Please does not bump it.
+ "libs/cua/Cargo.lock": "version = 4\n\n" + crate("cua-proto", "0.5.0"),
# From crates.io, and another workspace crate: left alone.
"samples/x/Cargo.lock": "version = 4\n\n" + crate("cua-proto", "0.5.0", registry) + "\n" + crate("cua-sdk", "0.1.0"),
}
@@ -106,7 +108,8 @@ def test_cargo_locks_follow_the_published_sdk_crates(tmp_path: Path, capsys: pyt
assert main(["--repo-root", str(tmp_path)]) == 0
- assert capsys.readouterr().out.split() == ["libs/cua-spacesd/Cargo.lock"]
+ assert capsys.readouterr().out.split() == ["libs/cua-spacesd/Cargo.lock", "libs/cua/Cargo.lock"]
+ assert '"0.5.0"' not in (tmp_path / "libs/cua/Cargo.lock").read_text()
spacesd = (tmp_path / "libs/cua-spacesd/Cargo.lock").read_text()
assert spacesd.count('version = "0.6.0"') == 2 and '"0.5.0"' not in spacesd
assert (tmp_path / "samples/x/Cargo.lock").read_text() == before