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(cua-driver): run the desktop E2E gate in the nightly build (#4355)

Francesco Bonaccife9b0c6d3c03
diff --git a/.github/scripts/tests/test_cua_driver_release_safety_wiring.py b/.github/scripts/tests/test_cua_driver_release_safety_wiring.py
index 01d22a613c..6385be66be 100644
--- a/.github/scripts/tests/test_cua_driver_release_safety_wiring.py
+++ b/.github/scripts/tests/test_cua_driver_release_safety_wiring.py
@@ -30,6 +30,8 @@ DO_NOTARIZE = "${{ startsWith(github.ref, 'refs/tags/cua-driver-rs-v') || inputs
TAG_PUSH = "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')"
CAN_PUBLISH = "${{ " + TAG_PUSH + " }}"
E2E_GATES = {"e2e-linux", "e2e-windows", "e2e-macos", "e2e-standalone-browsers"}
+# The same suites gate the stable tag push and nightly builds.
+E2E_GATE_IF = f"({TAG_PUSH}) || inputs.channel == 'nightly'"
SIGNATURE_GATES = {"verify-macos-release-signatures", "verify-windows-release-signatures"}
STATUS_OVERRIDES = ("always()", "failure()", "cancelled()", "!cancelled()")
@@ -140,7 +142,7 @@ def test_release_job_needs_signature_verification(cd: dict) -> None:
release = cd["jobs"]["release"]
assert {"verify-release-artifacts"} | SIGNATURE_GATES | E2E_GATES <= needs(release)
for gate in E2E_GATES:
- assert cd["jobs"][gate]["if"] == TAG_PUSH
+ assert cd["jobs"][gate]["if"] == E2E_GATE_IF
assert not any(override in release["if"] for override in STATUS_OVERRIDES)
publish = step(release, "Publish the verified Release Please draft")
assert release["steps"].index(step(release, "Refuse to publish unverified or unnotarized artifacts")) < release["steps"].index(publish)
diff --git a/.github/scripts/tests/test_cua_driver_release_wiring.py b/.github/scripts/tests/test_cua_driver_release_wiring.py
index 262ae812ca..d6c3f4fd64 100644
--- a/.github/scripts/tests/test_cua_driver_release_wiring.py
+++ b/.github/scripts/tests/test_cua_driver_release_wiring.py
@@ -826,20 +826,22 @@ fi
self.assertNotIn("publish recovery", workflow.lower())
# The Release Please tag push calls every canonical hosted E2E suite
- # against the exact tag SHA, after the attribution preflight.
+ # against the exact tag SHA, after the attribution preflight. Nightly
+ # builds call the same suites against their exact source_ref.
+ gate_sha = "${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}"
gates = {
- "e2e-linux": ("e2e-rust-linux.yml", "ref: ${{ github.sha }}"),
- "e2e-windows": ("e2e-rust-windows.yml", "ref: ${{ github.sha }}"),
- "e2e-macos": ("e2e-rust-macos.yml", "source_sha: ${{ github.sha }}"),
+ "e2e-linux": ("e2e-rust-linux.yml", f"ref: {gate_sha}"),
+ "e2e-windows": ("e2e-rust-windows.yml", f"ref: {gate_sha}"),
+ "e2e-macos": ("e2e-rust-macos.yml", f"source_sha: {gate_sha}"),
"e2e-standalone-browsers": (
"e2e-rust-standalone-browsers.yml",
- "ref: ${{ github.sha }}",
+ f"ref: {gate_sha}",
),
}
for job, (called, sha_input) in gates.items():
block = workflow.split(f"\n {job}:\n", 1)[1].split("\n\n", 1)[0]
self.assertIn(" needs: release-attribution-preflight\n", block)
- self.assertIn(f" if: {tag_push}\n", block)
+ self.assertIn(f" if: ({tag_push}) || inputs.channel == 'nightly'\n", block)
self.assertIn(f" uses: ./.github/workflows/{called}\n", block)
self.assertIn(sha_input, block)
self.assertIn(" actions: read\n", block)
diff --git a/.github/scripts/tests/test_nightly_release_wiring.py b/.github/scripts/tests/test_nightly_release_wiring.py
index c2abf33931..4461ad2641 100644
--- a/.github/scripts/tests/test_nightly_release_wiring.py
+++ b/.github/scripts/tests/test_nightly_release_wiring.py
@@ -28,16 +28,35 @@ def test_driver_stable_publish_gate_and_workflow_name_are_frozen():
assert 'workflows: ["CD: Cua Driver (cross-platform)"]' in sdk
-def test_driver_nightly_grants_reusable_e2e_gate_permissions_without_running_it():
+def test_driver_nightly_publishes_only_after_the_desktop_e2e_gate():
nightly = source("nightly-cua-driver.yml")
driver = source("cd-rust-cua-driver.yml")
- # The builder declares stable-tag E2E gate jobs with actions: read; the
- # nightly caller must grant it even though those jobs are skipped.
+ # The builder's E2E gate jobs need actions: read from the nightly caller.
assert "permissions:\n # actions: read" in nightly
assert "\n actions: read\n" in nightly
- for job in ("e2e-linux", "e2e-windows", "e2e-macos", "e2e-standalone-browsers"):
+ # Nightly builds run the same suites as the stable tag push, against the
+ # exact nightly source rather than the caller's workflow revision.
+ build = nightly.split("\n build:\n", 1)[1].split("\n\n", 1)[0]
+ assert " channel: nightly\n" in build
+ assert " source_ref: ${{ inputs.source_sha || github.sha }}\n" in build
+ gate_sha = "${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}"
+ for job, sha_input in (
+ ("e2e-linux", "ref"),
+ ("e2e-windows", "ref"),
+ ("e2e-macos", "source_sha"),
+ ("e2e-standalone-browsers", "ref"),
+ ):
block = driver.split(f"\n {job}:\n", 1)[1].split("\n\n", 1)[0]
- assert f" if: {TAG_PUSH}" in block
+ assert f" if: ({TAG_PUSH}) || inputs.channel == 'nightly'\n" in block
+ assert f"\n {sha_input}: {gate_sha}" in block
+ # A failed suite fails the reusable build, and publish requires a
+ # successful build with no status-function bypass.
+ publish = nightly.split("\n publish:\n", 1)[1].split(" steps:\n", 1)[0]
+ assert " needs: [plan, build]\n" in publish
+ assert "needs.build.result == 'success'" in publish
+ for override in ("always()", "failure()", "cancelled()", "continue-on-error"):
+ assert override not in publish
+ assert override not in build
def test_lume_stable_publish_gate_remains_tag_only():
diff --git a/.github/workflows/cd-rust-cua-driver.yml b/.github/workflows/cd-rust-cua-driver.yml
index 35a5ee5a4a..4892898732 100644
--- a/.github/workflows/cd-rust-cua-driver.yml
+++ b/.github/workflows/cd-rust-cua-driver.yml
@@ -15,7 +15,9 @@ name: "CD: Cua Driver (cross-platform)"
# release. That tag push runs this workflow, which builds every artifact, runs
# the canonical desktop E2E suites against the exact tag SHA, and publishes the
# draft only when the builds, release checks, and E2E gates all pass.
-# Nightly workflow_call runs and manual dispatches build candidates only.
+# Nightly workflow_call runs build candidates and run the same E2E suites
+# against their exact source; the nightly caller publishes only when this
+# whole workflow succeeds. Manual dispatches build candidates only.
on:
workflow_call:
@@ -1142,51 +1144,54 @@ jobs:
# the attribution preflight and run in parallel with the artifact builds.
# Under a tag push, github.sha is the tagged commit; `release` re-verifies
# that the published tag resolves to that same SHA. Nightly workflow_call
- # runs inherit the caller's non-push event name and skip the gate.
+ # runs certify their exact source_ref with the same suites. A failed suite
+ # fails this reusable workflow, so the nightly caller's publish job, which
+ # needs this build to succeed, never runs. Manual build-only dispatches have
+ # no channel input and still skip the gate.
e2e-linux:
name: release gate / Linux E2E
needs: release-attribution-preflight
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')
+ if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || inputs.channel == 'nightly'
permissions:
actions: read
contents: read
uses: ./.github/workflows/e2e-rust-linux.yml
with:
- ref: ${{ github.sha }}
+ ref: ${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}
e2e-windows:
name: release gate / Windows E2E
needs: release-attribution-preflight
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')
+ if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || inputs.channel == 'nightly'
permissions:
actions: read
contents: read
uses: ./.github/workflows/e2e-rust-windows.yml
with:
- ref: ${{ github.sha }}
+ ref: ${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}
e2e-macos:
name: release gate / macOS hosted E2E
needs: release-attribution-preflight
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')
+ if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || inputs.channel == 'nightly'
permissions:
actions: read
contents: read
pull-requests: read
uses: ./.github/workflows/e2e-rust-macos.yml
with:
- source_sha: ${{ github.sha }}
+ source_sha: ${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}
e2e-standalone-browsers:
name: release gate / standalone browser E2E
needs: release-attribution-preflight
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')
+ if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || inputs.channel == 'nightly'
permissions:
actions: read
contents: read
uses: ./.github/workflows/e2e-rust-standalone-browsers.yml
with:
- ref: ${{ github.sha }}
+ ref: ${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}
# ── Release signature gate ──────────────────────────────────────────────────
# Release safety (#4109): verify the exact uploaded archives the way the
diff --git a/.github/workflows/nightly-cua-driver.yml b/.github/workflows/nightly-cua-driver.yml
index 34760c9fae..58d6cb1bb2 100644
--- a/.github/workflows/nightly-cua-driver.yml
+++ b/.github/workflows/nightly-cua-driver.yml
@@ -6,7 +6,7 @@ on:
workflow_dispatch:
inputs:
source_sha:
- description: "Exact main SHA (defaults to the workflow revision)"
+ description: "Exact main SHA (defaults to, and for the macOS E2E gate must equal, the workflow revision)"
required: false
type: string
force:
@@ -16,8 +16,9 @@ on:
type: boolean
permissions:
- # actions: read lets the reusable builder declare its stable-tag E2E gate
- # jobs; nightly runs skip those jobs and never publish a stable release.
+ # actions: read lets the reusable builder run its desktop E2E gate jobs.
+ # Nightly builds run them against source_sha; a failed suite fails `build`,
+ # so `publish` never runs. Nightly runs never publish a stable release.
actions: read
contents: write
id-token: write
diff --git a/scripts/ci/README.md b/scripts/ci/README.md
index 88af44b7fd..12d72b3152 100644
--- a/scripts/ci/README.md
+++ b/scripts/ci/README.md
@@ -175,8 +175,10 @@ Stable Cua Driver releases need no manual E2E or publish dispatch. The
`.github/workflows/cd-rust-cua-driver.yml`, which calls the Linux, Windows,
hosted macOS, and standalone-browser E2E workflows through `workflow_call`
against the exact tag SHA. The draft release is published only when those
-suites, the builds, and the release artifact checks pass. Nightly builds skip
-this gate. The logged-in macOS Lume matrix is not part of the automatic gate;
+suites, the builds, and the release artifact checks pass. Nightly builds run
+the same four suites against the nightly source SHA whenever the nightly plan
+builds. A failed suite fails the nightly run and its prerelease is not
+published. The logged-in macOS Lume matrix is not part of the automatic gate;
it remains pre-merge evidence. Manual dispatch of the same workflows stays the
way to certify a pull request candidate.