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.

ci: scope sample builds on push to main, switch off two always-red schedules (CUA-3571) (#6617)

cua-agents[bot]d1feb2242ca7
diff --git a/.github/scripts/ci_swift_samples_scope.py b/.github/scripts/ci_swift_samples_scope.py
index f99365612d..f703898e2b 100644
--- a/.github/scripts/ci_swift_samples_scope.py
+++ b/.github/scripts/ci_swift_samples_scope.py
@@ -13,7 +13,9 @@ Usage:
The workflows have no event-level `paths:` filter: a cheap ubuntu scope job is
the only thing that always runs, so the `ci:full` label, pushes to main and the
-nightly schedule reach it whatever changed. `scope` writes GitHub Actions
+nightly schedule reach it whatever changed. A push to main is scoped like a pull
+request, by the paths the push changed (the workflow lists them for the openkoalabot
+lane; an empty listing fails closed to the full build). `scope` writes GitHub Actions
outputs (`run`, plus `typescript` for the openkoalabot lane, and `reason`).
`check-manifests` fails when the dependency map below no longer matches the
repository.
@@ -37,10 +39,10 @@ vmm, spaces, host, ...). A change there that alters the Swift API must
regenerate libs/cua/swift/Sources/CuaSDK, which the `bindings drift` job of
ci-cua-sdk.yml enforces on every libs/cua pull request, and that path is a
trigger here. A change that only alters runtime behavior is covered by the
-full run on every push to main and the nightly schedule.
+nightly full run.
-Always the full build: any event other than pull_request (every push to main,
-the schedule, a manual run), a pull request labelled `ci:full`, a change to the
+Always the full build: any event other than pull_request or push (the nightly
+schedule, a manual run), a pull request labelled `ci:full`, a change to the
workflow or this script, and a file listing that is empty or may be truncated
(fail closed). The file listing carries both names of a renamed file, so moving
a dependency out of a mapped directory still counts. Release-please branches
@@ -153,7 +155,7 @@ def decide(
"""
inert = INERT if inputs is None else re.compile(r"(?!)")
inputs = LANES[lane]["inputs"] if inputs is None else inputs
- if event != "pull_request":
+ if event not in ("pull_request", "push"):
return True, f"{event} runs the full build"
if "ci:full" in labels:
return True, "ci:full label"
diff --git a/.github/scripts/tests/test_ci_swift_samples_scope.py b/.github/scripts/tests/test_ci_swift_samples_scope.py
index bb9826fa18..1a87e8ab6e 100644
--- a/.github/scripts/tests/test_ci_swift_samples_scope.py
+++ b/.github/scripts/tests/test_ci_swift_samples_scope.py
@@ -108,8 +108,11 @@ class ScopeTests(unittest.TestCase):
def test_full_build_everywhere_else(self):
for lane in LANES:
- for event in ("push", "schedule", "workflow_dispatch"):
+ for event in ("schedule", "workflow_dispatch"):
self.assertTrue(run(lane, ["docs/a.md"], event=event), (lane, event))
+ # A push to main is scoped like a pull request; no listing fails closed.
+ self.assertFalse(run(lane, ["docs/a.md"], event="push"), lane)
+ self.assertTrue(run(lane, [], event="push"), lane)
self.assertTrue(run(lane, ["docs/a.md"], labels=["ci:full"]), lane)
self.assertFalse(run(lane, ["docs/a.md"], labels=["agent", "bug"]), lane)
@@ -156,7 +159,8 @@ class ScopeTests(unittest.TestCase):
self.assertTrue(run_typescript([f]), f)
for f in ("docs/content/docs/other.mdx", "apps/cua-spaces/src/a.ts", "examples/infinite-canvas-swift/Package.swift"):
self.assertFalse(run_typescript([f]), f)
- self.assertTrue(run_typescript(["docs/a.md"], event="push"))
+ self.assertFalse(run_typescript(["docs/a.md"], event="push"))
+ self.assertTrue(run_typescript([], event="push"))
self.assertTrue(run_typescript(["docs/a.md"], labels=["ci:full"]))
self.assertTrue(run_typescript([]))
@@ -197,6 +201,8 @@ class CommandTests(unittest.TestCase):
out = self.scope("openkoalabot", ["docs/other.md"], EVENT="pull_request")
self.assertEqual((out["run"], out["typescript"]), ("false", "false"))
out = self.scope("openkoalabot", ["docs/other.md"], EVENT="push")
+ self.assertEqual((out["run"], out["typescript"]), ("false", "false"))
+ out = self.scope("openkoalabot", ["docs/other.md"], EVENT="schedule")
self.assertEqual((out["run"], out["typescript"]), ("true", "true"))
out = self.scope("infinite-canvas", ["docs/other.md"], EVENT="pull_request", LABELS='["ci:full"]')
self.assertEqual(out, {"run": "true", "reason": "ci:full label"})
@@ -270,7 +276,7 @@ class WorkflowWiringTests(unittest.TestCase):
self.assertIn("./.github/actions/setup-protoc", uses)
self.assertIn("./.github/actions/rust-cache", uses)
- def test_full_run_on_main_and_nightly(self):
+ def test_scoped_on_main_full_nightly(self):
for lane in LANES:
on = self.load(lane)[True]
self.assertEqual(on["push"], {"branches": ["main"]})
diff --git a/.github/workflows/ci-cua-compat.yml b/.github/workflows/ci-cua-compat.yml
index 21106bcf77..c97e461ec3 100644
--- a/.github/workflows/ci-cua-compat.yml
+++ b/.github/workflows/ci-cua-compat.yml
@@ -34,8 +34,7 @@ on:
- "libs/cua/crates/cua-spacesd-client/src/testing.rs"
- "tests/compat/**"
- ".github/workflows/ci-cua-compat.yml"
- schedule:
- - cron: "41 6 * * 1"
+ # Weekly schedule off: it has failed on every run since it was added. Re-enable the cron once the lane is green.
workflow_dispatch:
permissions:
diff --git a/.github/workflows/ci-openkoalabot-example-samples.yml b/.github/workflows/ci-openkoalabot-example-samples.yml
index 60147761db..844d813dbf 100644
--- a/.github/workflows/ci-openkoalabot-example-samples.yml
+++ b/.github/workflows/ci-openkoalabot-example-samples.yml
@@ -13,9 +13,10 @@ name: "CI: openkoalabot-example (TypeScript and Swift)"
# composite actions it runs (the map and the reasons are in
# .github/scripts/ci_swift_samples_scope.py). There is no event-level `paths:`
# filter: the cheap ubuntu `scope` job always runs and decides, so the `ci:full`
-# label, every push to main and the nightly schedule reach it. Rust-internal
-# changes that leave the binding alone are covered by the full run on every
-# push to main and by the nightly schedule. Release-please branches skip both
+# label, every push to main and the nightly schedule reach it. A push to main
+# is scoped by the paths it changed, like a pull request (the macOS build is
+# 10x runner minutes); Rust-internal changes that leave the binding alone are
+# covered by the nightly full run. Release-please branches skip both
# jobs as they always have. The TypeScript job keeps the trigger paths this
# workflow had before; the scope job evaluates them too.
@@ -23,7 +24,8 @@ on:
pull_request:
push:
branches: [main]
- # Drift check: the full build on main, whatever changed.
+ # The full build on main, whatever changed (a push builds only when it touches
+ # the sample or its dependencies).
schedule:
- cron: "53 5 * * *"
workflow_dispatch:
@@ -138,6 +140,8 @@ jobs:
LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
+ BEFORE: ${{ github.event.before }}
+ SHA: ${{ github.sha }}
run: |
set -euo pipefail
# Fails when the dependency map no longer matches the Swift manifests.
@@ -147,6 +151,10 @@ jobs:
# Both names of a renamed file: moving a dependency out of a mapped
# directory is still a change to the dependency.
files=$(gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/files?per_page=100" --jq '.[] | .filename, (.previous_filename // empty)')
+ elif [[ "$EVENT" == push && "$BEFORE" =~ [1-9a-f] ]]; then
+ # Same for the commits a push to main brought in. A new branch (all-zero
+ # BEFORE) or a failed listing leaves `files` empty, which runs the full build.
+ files=$(gh api --paginate "repos/$REPO/compare/$BEFORE...$SHA?per_page=100" --jq '.files[] | .filename, (.previous_filename // empty)' || true)
fi
python3 .github/scripts/ci_swift_samples_scope.py scope openkoalabot <<< "$files" | tee -a "$GITHUB_STEP_SUMMARY"
diff --git a/.github/workflows/ci-openkoalabot-example-tauri.yml b/.github/workflows/ci-openkoalabot-example-tauri.yml
index 094f395e06..f765dc7108 100644
--- a/.github/workflows/ci-openkoalabot-example-tauri.yml
+++ b/.github/workflows/ci-openkoalabot-example-tauri.yml
@@ -14,13 +14,11 @@ on:
- "libs/cua/**"
- "libs/cua-spacesd/**"
- ".github/workflows/ci-openkoalabot-example-tauri.yml"
- push:
- branches: [main]
- paths:
- - "examples/openkoalabot-example-tauri/**"
- - "libs/cua/**"
- - "libs/cua-spacesd/**"
- - ".github/workflows/ci-openkoalabot-example-tauri.yml"
+ # Not on every push to main: the pull request above already built the same
+ # paths. A breakage from a change that raced in after the PR shows up in the
+ # nightly build.
+ schedule:
+ - cron: "37 5 * * *"
workflow_dispatch:
permissions:
diff --git a/.github/workflows/ci-vm-density.yml b/.github/workflows/ci-vm-density.yml
index 5e31fbeea5..4baad9a70a 100644
--- a/.github/workflows/ci-vm-density.yml
+++ b/.github/workflows/ci-vm-density.yml
@@ -28,8 +28,7 @@ on:
- "libs/cua/crates/cua-daemon/tests/qemu_resize.rs"
- "libs/cua/bench/spaces-startup/**"
- ".github/workflows/ci-vm-density.yml"
- schedule:
- - cron: "17 6 * * *"
+ # Nightly schedule off: it has failed on every run since it was added. Re-enable the cron once the lane is green.
workflow_dispatch:
permissions: