Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
ci(cua-driver): quick desktop E2E lane on PRs, full suite after merge and at release (#6600)
Francesco Bonacci78b0911204d7
diff --git a/.github/scripts/tests/test_cua_driver_e2e_quick_lane.py b/.github/scripts/tests/test_cua_driver_e2e_quick_lane.pynew file mode 100644index 0000000000..d034e2f546--- /dev/null+++ b/.github/scripts/tests/test_cua_driver_e2e_quick_lane.py@@ -0,0 +1,76 @@+"""The Cua Driver desktop E2E has a quick PR lane and a full lane after merge and at release.++Run: python3 .github/scripts/tests/test_cua_driver_e2e_quick_lane.py+"""++import re+import unittest+from pathlib import Path++ROOT = Path(__file__).resolve().parents[3]+WF = ROOT / ".github/workflows"+GATE = (WF / "e2e-cua-driver-release-gate.yml").read_text()+CD = (WF / "cd-rust-cua-driver.yml").read_text()+++def job(text: str, name: str) -> str:+ m = re.search(rf"^ {re.escape(name)}:\n(.*?)(?=^ [a-z0-9-]+:\n|\Z)", text, re.S | re.M)+ assert m, name+ return m.group(1)+++class QuickLane(unittest.TestCase):+ def test_full_suite_runs_after_merge_nightly_and_on_demand(self):+ trigger = GATE.split("permissions:", 1)[0]+ self.assertIn("push:\n branches: [main]", trigger)+ self.assertIn("schedule:", trigger)+ self.assertIn("workflow_dispatch:", trigger)+ self.assertIn("post-merge", job(GATE, "decide"))++ def test_pull_requests_get_the_quick_lane(self):+ decide = job(GATE, "decide")+ self.assertIn('emit true pr "label e2e-gate" quick', decide)+ self.assertRegex(decide, r'emit true pr "gated paths[^\n]*quick')+ # Every other trigger is a full run.+ self.assertIn('lanes=${4:-full}', decide)++ def test_quick_lane_is_the_shared_electron_lane_on_each_os(self):+ for name in ("linux", "windows"):+ body = job(GATE, name)+ self.assertIn("lane: ${{ needs.decide.outputs.lanes == 'quick' && 'shared' || 'all' }}", body)+ self.assertIn("harness_filter: ${{ needs.decide.outputs.lanes == 'quick' && 'electron' || '' }}", body)+ self.assertIn("-f quick=true", job(GATE, "macos-pr"))++ def test_browser_lanes_are_full_only_and_do_not_fail_the_quick_result(self):+ self.assertIn("needs.decide.outputs.lanes != 'quick'", job(GATE, "browsers"))+ self.assertIn('(.key != "browsers" or .value.result != "skipped" or env.LANES_SIZE != "quick")', job(GATE, "result"))++ def test_full_macos_lane_runs_on_push_and_is_not_quick(self):+ macos = job(GATE, "macos")+ self.assertIn("github.event_name != 'pull_request'", macos)+ self.assertNotIn("quick", macos)++ def test_failures_after_merge_open_the_tracking_issue(self):+ report = job(GATE, "nightly-report")+ self.assertIn("needs.decide.outputs.mode == 'post-merge'", report)+ self.assertIn("fix it forward", report)++ def test_release_gate_still_runs_every_lane_on_the_tag_sha(self):+ for wf in ("e2e-rust-linux.yml", "e2e-rust-windows.yml", "e2e-rust-macos.yml", "e2e-rust-standalone-browsers.yml"):+ self.assertIn(f"uses: ./.github/workflows/{wf}", CD)+ for name in ("e2e-linux", "e2e-windows", "e2e-macos", "e2e-standalone-browsers"):+ if re.search(rf"^ {name}:", CD, re.M):+ body = job(CD, name)+ self.assertNotIn("harness_filter", body)+ self.assertNotIn("quick", body)+ self.assertNotRegex(body, r"lane:\s")++ def test_filter_inputs_default_to_everything(self):+ for wf in ("e2e-rust-linux.yml", "e2e-rust-windows.yml"):+ text = (WF / wf).read_text()+ self.assertEqual(len(re.findall(r"harness_filter:\n(?: .*\n)*? default: \"\"", text)), 2, wf)+ self.assertIn("CUA_E2E_HARNESS_FILTER: ${{ inputs.harness_filter }}", text)+++if __name__ == "__main__":+ unittest.main()diff --git a/.github/scripts/tests/test_macos_hosted_e2e_workflow.py b/.github/scripts/tests/test_macos_hosted_e2e_workflow.pyindex a9ecfaa85e..a156651775 100644--- a/.github/scripts/tests/test_macos_hosted_e2e_workflow.py+++ b/.github/scripts/tests/test_macos_hosted_e2e_workflow.py@@ -206,7 +206,10 @@ def test_hosted_macos_probe_is_manual_exact_sha_and_least_privilege() -> None:assert "github.run_id }}-${{ github.run_attempt" in workflowassert "CUA_MACOS_HOSTED_PROBE_DIR: ${{ runner.temp" not in workflowassert 'echo "CUA_MACOS_HOSTED_PROBE_DIR=${artifact_dir}" >> "${GITHUB_ENV}"' in workflow- assert "matrix:\n lane: [shared, native, capture, browser]" in workflow+ # Release gates and manual runs keep all four lanes; only the PR quick lane (quick=true) runs `shared`.+ assert "matrix:\n lane: ${{ fromJSON(inputs.quick && '[\"shared\"]' || '[\"shared\",\"native\",\"capture\",\"browser\"]') }}" in workflow+ assert "CUA_E2E_HARNESS_FILTER: ${{ inputs.quick && 'electron' || '' }}" in workflow+ assert "rust-macos-hosted-${{ inputs.quick && 'quick-result' || 'certification' }}" in workflowassert "fail-fast: false" in workflowassert "needs: probe" in workflowassert "scripts/ci/macos/run-hosted-rust-e2e.sh" in workflowdiff --git a/.github/workflows/e2e-cua-driver-release-gate.yml b/.github/workflows/e2e-cua-driver-release-gate.ymlindex 9a2cc21bf6..e7eedcf4b2 100644--- a/.github/workflows/e2e-cua-driver-release-gate.yml+++ b/.github/workflows/e2e-cua-driver-release-gate.yml@@ -1,25 +1,42 @@name: "E2E: Cua Driver release gate"-# Runs the same desktop E2E lanes the stable tag gate runs (Linux, Windows,-# macOS hosted native, standalone browsers) WITHOUT publishing anything, so a-# gate failure surfaces before a release tags instead of after.+# The desktop E2E lanes the stable tag gate runs (Linux, Windows, macOS hosted+# native, standalone browsers), WITHOUT publishing anything. Two sizes:#-# nightly 06:00 UTC against main's HEAD. Failures (and flaky cases) open or-# update ONE tracking issue; the failed run also reaches #releases-# through the GitHub Slack app workflow-run subscription.-# PR runs when the `e2e-gate` label is present, when the PR touches the-# gated paths (.github/scripts/cua_driver_e2e_gate_paths.py: cursor-# overlay, focus, background input, browser routing, the harness).-# release-please PRs skip the lanes unless labelled: the tag run-# in cd-rust-cua-driver.yml runs every lane on the release commit.-# macOS hosted macOS seeds TCC state, so e2e-rust-macos.yml refuses-# pull_request events. On gated PRs (same-repo only) the `macos-pr`-# job instead dispatches that workflow on the PR head branch with-# the GITHUB_TOKEN (workflow_dispatch is an allowed event), waits-# for it and reports its conclusion into `E2E gate / result`.-# Fork PRs skip it; nightly and tag runs call the lane directly.-# Otherwise the lanes are skipped and `E2E gate / result` passes at once, so-# that one check can be required on every PR (see scripts/ci/README.md).+# full Linux, Windows and macOS full matrices and the standalone browser+# lanes (26 to 47 min per lane). Runs after merge and at release:+# - nightly 06:00 UTC against main's HEAD,+# - every push to main that touches the gated paths (runs queue, a+# burst of merges is one pending run for the newest commit),+# - a manual dispatch,+# - and the stable tag run in cd-rust-cua-driver.yml, which reruns+# every lane on the exact release commit and blocks publishing.+# quick The PR lane. The core paths on each OS, on the Electron harness:+# the shared Windows lane, the shared Linux lane and the shared hosted+# macOS lane (click, type, scroll, drag, focus and background input),+# plus the Linux verification-skill proof that E2E: Rust Linux+# interactive already runs on PRs. The Tauri, WebView2, WPF, WinUI3+# and GTK harnesses, the capture and installer lanes and the standalone+# browser lanes wait for the full run after merge.+#+# A PR gets the quick lane when the `e2e-gate` label is present or it touches the+# gated paths (.github/scripts/cua_driver_e2e_gate_paths.py: cursor overlay,+# focus, background input, browser routing, the harness). release-please PRs+# skip the lanes unless labelled.+#+# A full run that fails on main alerts (workflow-failure-alerts.yml, Alertmanager)+# and opens or updates ONE tracking issue (the nightly-report job). The break is+# already on main, so it is fixed forward: a Windows break is fixed with a new PR,+# and the stable tag gate still blocks publishing until main is green.+#+# macOS hosted macOS seeds TCC state, so e2e-rust-macos.yml refuses+# pull_request events. On gated PRs (same-repo only) the `macos-pr`+# job instead dispatches that workflow with quick=true on the PR head+# branch with the GITHUB_TOKEN (workflow_dispatch is an allowed event),+# waits for it and reports its conclusion into `E2E gate / result`.+# Fork PRs skip it; full runs call the lane directly.+# Otherwise the lanes are skipped and `E2E gate / result` passes at once, so+# that one check can be required on every PR (see scripts/ci/README.md).## Each lane retries a failed case once (scripts/ci/lib/e2e-retry-once.sh): a# pass on the retry is reported as flaky and does not fail the gate; two@@ -28,6 +45,15 @@ name: "E2E: Cua Driver release gate"on:schedule:- cron: "0 6 * * *"+ # After merge: the full suite for a change to the driver, its tests or this gate.+ push:+ branches: [main]+ paths:+ - "libs/cua-driver/**"+ - "scripts/ci/**"+ - ".github/scripts/cua_driver_e2e_gate_paths.py"+ - ".github/workflows/e2e-rust-*.yml"+ - ".github/workflows/e2e-cua-driver-release-gate.yml"pull_request:types: [opened, reopened, synchronize, ready_for_review, labeled, unlabeled]workflow_dispatch:@@ -37,8 +63,8 @@ permissions:actions: readpull-requests: read-# One run per PR (a new push supersedes the old one); nightly and manual runs-# never cancel each other. A label event for an unrelated label gets its own+# One run per PR (a new push supersedes the old one); nightly, push and manual runs+# never cancel each other (a pending push run is replaced by the newest one). A label event for an unrelated label gets its own# group so it cannot cancel a running gate and then skip.concurrency:group: >-@@ -62,6 +88,7 @@ jobs:run: ${{ steps.decide.outputs.run }}mode: ${{ steps.decide.outputs.mode }}reason: ${{ steps.decide.outputs.reason }}+ lanes: ${{ steps.decide.outputs.lanes }}steps:- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4with:@@ -78,19 +105,41 @@ jobs:PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}+ PUSH_BEFORE: ${{ github.event.before }}+ PUSH_AFTER: ${{ github.sha }}REPO: ${{ github.repository }}run: |set -euo pipefail+ # lanes: quick on a PR (core paths per OS), full everywhere else.emit() {- { echo "run=$1"; echo "mode=$2"; echo "reason=$3"; } >> "$GITHUB_OUTPUT"- echo "gate: run=$1 mode=$2 ($3)"+ { echo "run=$1"; echo "mode=$2"; echo "reason=$3"; echo "lanes=${4:-full}"; } >> "$GITHUB_OUTPUT"+ echo "gate: run=$1 mode=$2 lanes=${4:-full} ($3)"}+ if [[ "$EVENT" == push ]]; then+ # Post-merge: the full suite when the pushed commits touch a gated path. The paths+ # filter of the trigger is broad (all of libs/cua-driver); this narrows it to the+ # globs the PR gate uses. Anything we cannot read runs the suite.+ files=$(gh api --paginate "repos/$REPO/compare/${PUSH_BEFORE}...${PUSH_AFTER}" --jq '.files[].filename' 2>/dev/null || true)+ if [[ -z "$files" || "$PUSH_BEFORE" =~ ^0+$ ]]; then+ emit true post-merge "push to ${GITHUB_REF_NAME}, changed files unreadable"; exit 0+ fi+ if [[ ! -f .github/scripts/cua_driver_e2e_gate_paths.py ]]; then+ emit true post-merge "push to ${GITHUB_REF_NAME}, path script missing"; exit 0+ fi+ matched=$(python3 .github/scripts/cua_driver_e2e_gate_paths.py <<< "$files" | head -n 5)+ if [[ -n "$matched" ]]; then+ emit true post-merge "push touching gated paths, e.g. $(head -n 1 <<< "$matched")"+ else+ emit false post-merge "push without gated paths"+ fi+ exit 0+ fiif [[ "$EVENT" != pull_request ]]; thenemit true "$([[ $EVENT == schedule ]] && echo nightly || echo manual)" "$EVENT on ${GITHUB_REF_NAME}"exit 0fiif jq -e 'index("e2e-gate")' <<< "$PR_LABELS" >/dev/null; then- emit true pr "label e2e-gate"; exit 0+ emit true pr "label e2e-gate" quick; exit 0fiif [[ "$PR_DRAFT" == true ]]; thenemit false pr "draft PR without the e2e-gate label"; exit 0@@ -110,7 +159,7 @@ jobs:fimatched=$(python3 .github/scripts/cua_driver_e2e_gate_paths.py <<< "$files" | head -n 5)if [[ -n "$matched" ]]; then- emit true pr "gated paths, e.g. $(head -n 1 <<< "$matched")"; exit 0+ emit true pr "gated paths, e.g. $(head -n 1 <<< "$matched")" quick; exit 0fiemit false pr "no gated paths and no e2e-gate label"@@ -124,6 +173,9 @@ jobs:uses: ./.github/workflows/e2e-rust-linux.ymlwith:ref: ${{ github.sha }}+ # Quick (PR): the shared lane on the Electron harness. Full: every lane.+ lane: ${{ needs.decide.outputs.lanes == 'quick' && 'shared' || 'all' }}+ harness_filter: ${{ needs.decide.outputs.lanes == 'quick' && 'electron' || '' }}windows:name: "gate / Windows E2E"@@ -135,6 +187,8 @@ jobs:uses: ./.github/workflows/e2e-rust-windows.ymlwith:ref: ${{ github.sha }}+ lane: ${{ needs.decide.outputs.lanes == 'quick' && 'shared' || 'all' }}+ harness_filter: ${{ needs.decide.outputs.lanes == 'quick' && 'electron' || '' }}# Hosted macOS seeds TCC state, so it never runs on pull_request events# (the probe rejects them). PRs use `macos-pr` below instead.@@ -191,7 +245,7 @@ jobs:if [[ -n "$run_id" ]]; thenecho "Reusing the hosted macOS run for $HEAD_SHA" | tee -a "$GITHUB_STEP_SUMMARY"else- gh workflow run "$LANE" -R "$REPO" --ref "$HEAD_REF" -f source_sha="$HEAD_SHA" -f mode=hosted+ gh workflow run "$LANE" -R "$REPO" --ref "$HEAD_REF" -f source_sha="$HEAD_SHA" -f mode=hosted -f quick=truefor _ in $(seq 1 30); dosleep 10run_id=$(find_run)@@ -237,7 +291,8 @@ jobs:browsers:name: "gate / standalone browser E2E"needs: decide- if: ${{ !failure() && !cancelled() && needs.decide.outputs.run == 'true' }}+ # Full runs only: the quick PR lane leaves the browser lanes to the run after merge.+ if: ${{ !failure() && !cancelled() && needs.decide.outputs.run == 'true' && needs.decide.outputs.lanes != 'quick' }}permissions:actions: readcontents: read@@ -257,6 +312,7 @@ jobs:- name: Evaluate lanesenv:RUN: ${{ needs.decide.outputs.run }}+ LANES_SIZE: ${{ needs.decide.outputs.lanes }}EVENT: ${{ github.event_name }}DECIDE: ${{ needs.decide.result }}LANES: ${{ toJSON(needs) }}@@ -269,18 +325,19 @@ jobs:echo "Release-gate lanes not required for this change." | tee -a "$GITHUB_STEP_SUMMARY"exit 0fi- bad=$(jq -r 'to_entries[] | select(.key != "decide") | select(.value.result != "success") | select((.key != "macos" or .value.result != "skipped" or env.EVENT != "pull_request") and (.key != "macos-pr" or .value.result != "skipped")) | "\(.key)=\(.value.result)"' <<< "$LANES")+ bad=$(jq -r 'to_entries[] | select(.key != "decide") | select(.value.result != "success") | select((.key != "macos" or .value.result != "skipped" or env.EVENT != "pull_request") and (.key != "macos-pr" or .value.result != "skipped") and (.key != "browsers" or .value.result != "skipped" or env.LANES_SIZE != "quick")) | "\(.key)=\(.value.result)"' <<< "$LANES")if [[ -n "$bad" ]]; thenecho "::error::release-gate lanes not green: $bad"; exit 1fiecho "All release-gate lanes passed." | tee -a "$GITHUB_STEP_SUMMARY"- # Nightly only: keep ONE tracking issue up to date (same pattern as- # release-pipeline-guard.yml). Fails when the gate failed so the run is red- # in #releases via the GitHub Slack app subscription.+ # Nightly and post-merge full runs: keep ONE tracking issue up to date (same+ # pattern as release-pipeline-guard.yml). Fails when the gate failed so the run is+ # red in #releases via the GitHub Slack app subscription, and workflow-failure-alerts+ # posts it to Alertmanager.nightly-report:name: "E2E gate / nightly report"- if: always() && needs.decide.outputs.mode == 'nightly'+ if: always() && (needs.decide.outputs.mode == 'nightly' || needs.decide.outputs.mode == 'post-merge')needs: [decide, linux, windows, macos, macos-pr, browsers]runs-on: ubuntu-latesttimeout-minutes: 10@@ -305,6 +362,7 @@ jobs:LANES: ${{ toJSON(needs) }}RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}SHA: ${{ github.sha }}+ MODE: ${{ needs.decide.outputs.mode }}run: |set -euo pipefailTITLE="Cua Driver release gate failing on main (nightly)"@@ -315,16 +373,16 @@ jobs:--jq "[.[]|select(.title==\"$TITLE\")][0].number // empty")if [[ -z "$failed" && -z "$flaky" ]]; thenecho "Release gate green." | tee -a "$GITHUB_STEP_SUMMARY"- [[ -z "$existing" ]] || gh issue close "$existing" -R "$REPO" -c "Nightly release gate is green on ${SHA:0:12} ($RUN_URL)."+ [[ -z "$existing" ]] || gh issue close "$existing" -R "$REPO" -c "The release gate is green on ${SHA:0:12} ($RUN_URL)."exit 0fiif [[ -n "$failed" ]]; then status="FAILING"; else status="passing, with flaky cases"; fi- body="Nightly Cua Driver release gate on main @ \`${SHA:0:12}\` is **${status}** ($(date -u +%FT%TZ), [run]($RUN_URL))."$'\n\n'+ body="Cua Driver release gate (${MODE:-nightly} full run) on main @ \`${SHA:0:12}\` is **${status}** ($(date -u +%FT%TZ), [run]($RUN_URL))."$'\n\n'if [[ -n "$failed" ]]; then- body+="### Failed lanes"$'\n\n'"$failed"$'\n\n'"A case counts as failed only after a retry also failed. Fix main before the next release tags; the tag gate runs these same lanes."$'\n\n'+ body+="### Failed lanes"$'\n\n'"$failed"$'\n\n'"A case counts as failed only after a retry also failed. This suite runs after merge, so the break is already on main: fix it forward with a new PR (a Windows break included). The tag gate runs these same lanes on the release commit and blocks publishing until main is green."$'\n\n'fi[[ -z "$flaky" ]] || body+="$flaky"$'\n\n'- body+="This issue is updated by \`.github/workflows/e2e-cua-driver-release-gate.yml\` and closes itself on the first fully clean nightly."+ body+="This issue is updated by \`.github/workflows/e2e-cua-driver-release-gate.yml\` and closes itself on the first fully clean full run."printf '%s\n' "$body" >> "$GITHUB_STEP_SUMMARY"if [[ -n "$existing" ]]; thengh issue edit "$existing" -R "$REPO" --body "$body"diff --git a/.github/workflows/e2e-rust-linux.yml b/.github/workflows/e2e-rust-linux.ymlindex f48dfac1f7..a73dbcd7dd 100644--- a/.github/workflows/e2e-rust-linux.yml+++ b/.github/workflows/e2e-rust-linux.yml@@ -24,6 +24,11 @@ on:required: falsetype: stringdefault: ""+ harness_filter:+ description: "Comma list of harness hosts for the shared lane (the PR quick lane passes electron); empty runs them all"+ required: false+ type: string+ default: ""workflow_dispatch:inputs:ref:@@ -46,6 +51,10 @@ on:description: "Optional shared-cell substring for targeted diagnostics"required: falsedefault: ""+ harness_filter:+ description: "Comma list of harness hosts for the shared lane (for example electron); empty runs them all"+ required: false+ default: ""permissions:contents: read@@ -155,6 +164,7 @@ jobs:env:CUA_E2E_SOURCE_SHA: ${{ needs.source.outputs.sha }}CUA_E2E_CELL_FILTER: ${{ inputs.cell_filter }}+ CUA_E2E_HARNESS_FILTER: ${{ inputs.harness_filter }}steps:- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4with:diff --git a/.github/workflows/e2e-rust-macos.yml b/.github/workflows/e2e-rust-macos.ymlindex c99b386e57..335092a323 100644--- a/.github/workflows/e2e-rust-macos.yml+++ b/.github/workflows/e2e-rust-macos.yml@@ -23,6 +23,11 @@ on:description: "Full 40-character commit SHA to certify"required: truetype: string+ quick:+ description: "PR quick lane: only the shared lane, on the Electron harness (not a certification)"+ required: false+ type: boolean+ default: falsemode:description: "Supplemental GitHub-hosted matrix or registration of a direct Lume console run"required: false@@ -143,12 +148,14 @@ jobs:strategy:fail-fast: falsematrix:- lane: [shared, native, capture, browser]+ lane: ${{ fromJSON(inputs.quick && '["shared"]' || '["shared","native","capture","browser"]') }}env:CUA_E2E_SOURCE_SHA: ${{ inputs.source_sha }}CUA_E2E_WORKFLOW_SHA: ${{ github.sha }}CUA_E2E_REBUILD: ${{ inputs.rebuild_of_released_source && 'true' || 'false' }}CUA_E2E_INTERNAL_LANE: ${{ matrix.lane }}+ # The PR quick lane runs the core Electron cells only; empty runs every host.+ CUA_E2E_HARNESS_FILTER: ${{ inputs.quick && 'electron' || '' }}steps:- name: Validate requested source SHA@@ -241,6 +248,7 @@ jobs:SOURCE_SHA: ${{ inputs.source_sha }}PROBE_RESULT: ${{ needs.probe.result }}MATRIX_RESULT: ${{ needs.matrix.result }}+ QUICK: ${{ inputs.quick && 'true' || 'false' }}WORKFLOW_REF: ${{ github.workflow_ref }}WORKFLOW_SHA: ${{ github.sha }}steps:@@ -257,12 +265,14 @@ jobs:--arg workflow_sha "${WORKFLOW_SHA}" \--arg probe "${PROBE_RESULT}" \--arg matrix "${MATRIX_RESULT}" \+ --arg quick "${QUICK}" \'{schema: $schema, source_sha: $source_sha,github: {run_id: $run_id, run_attempt: $run_attempt,workflow_ref: $workflow_ref, workflow_sha: $workflow_sha},jobs: {probe: $probe, matrix: $matrix},lanes: ["shared", "native", "capture", "browser"],standalone_browser: true,+ quick: ($quick == "true"),passed: ($probe == "success" and $matrix == "success")}' \| tee certification.jsonjq -e '.passed == true' certification.json >/dev/null@@ -271,7 +281,8 @@ jobs:if: always()uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.2with:- name: rust-macos-hosted-certification-${{ github.run_id }}-${{ github.run_attempt }}+ # A quick run is not a certification: keep it out of the name consumers look for.+ name: rust-macos-hosted-${{ inputs.quick && 'quick-result' || 'certification' }}-${{ github.run_id }}-${{ github.run_attempt }}path: certification.jsonif-no-files-found: errorretention-days: 14diff --git a/.github/workflows/e2e-rust-windows.yml b/.github/workflows/e2e-rust-windows.ymlindex 5fc8e00e66..36defa87ab 100644--- a/.github/workflows/e2e-rust-windows.yml+++ b/.github/workflows/e2e-rust-windows.yml@@ -19,6 +19,11 @@ on:required: falsetype: stringdefault: all+ harness_filter:+ description: "Comma list of harness hosts for the shared lane (the PR quick lane passes electron); empty runs them all"+ required: false+ type: string+ default: ""workflow_dispatch:inputs:ref:@@ -40,6 +45,10 @@ on:- native- capture- installer+ harness_filter:+ description: "Comma list of harness hosts for the shared lane (for example electron); empty runs them all"+ required: false+ default: ""permissions:contents: read@@ -92,6 +101,7 @@ jobs:timeout-minutes: 90env:CUA_E2E_SOURCE_SHA: ${{ needs.source.outputs.sha }}+ CUA_E2E_HARNESS_FILTER: ${{ inputs.harness_filter }}steps:- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4with:diff --git a/scripts/ci/README.md b/scripts/ci/README.mdindex 8ea7811b96..089f00df8a 100644--- a/scripts/ci/README.md+++ b/scripts/ci/README.md@@ -440,16 +440,23 @@ Use this runbook when the canary issue opens, or when users report that default4. **Merge it.** The branded endpoints serve `main`. The canary runs on the push, so compare its installed version with the rollback version. To recheck the public one-liners after the endpoints refresh, dispatch `Monitor branded installer endpoints`.5. **Ship the fix as a new Release Please release.** Its tag run bakes the installers forward automatically once the published assets pass verification. Leave the withdrawn release and its assets in place for audit.-## Cua Driver release gate before merge and nightly+## Cua Driver desktop E2E: quick lane on PRs, full suite after merge and at release-The stable tag run certifies the exact tag commit with the desktop E2E lanes. `E2E: Cua Driver release gate` (`.github/workflows/e2e-cua-driver-release-gate.yml`) runs the same lanes earlier, without publishing:+The stable tag run certifies the exact tag commit with every desktop E2E lane (Linux, Windows, macOS hosted, standalone browsers). `E2E: Cua Driver release gate` (`.github/workflows/e2e-cua-driver-release-gate.yml`) runs the same lanes earlier, without publishing. It has two sizes:-| Trigger | When | Result |-| --- | --- | --- |-| Nightly, 06:00 UTC | main's HEAD | A failure opens or updates one issue, "Cua Driver release gate failing on main (nightly)". The failed run also posts to #releases through the GitHub Slack app workflow-run subscription. The first fully clean nightly closes the issue. |-| Pull request | The `e2e-gate` label is present, or the PR touches the cursor overlay, focus, background input or browser routing paths (globs in `.github/scripts/cua_driver_e2e_gate_paths.py`). release-please PRs skip the lanes (the tag gate runs them on the release commit) unless labelled | The four lanes run on the PR merge commit. |-| Other pull requests | Everything else | The lanes are skipped and `E2E gate / result` passes at once. |+- **Quick lane (pull requests).** The core paths on each OS, on the Electron harness: the `shared` lane on Windows, Linux and hosted macOS (click, type, scroll, drag, focus, background input), plus the Linux verification-skill proof that `E2E: Rust Linux interactive` already runs on PRs. The Tauri, WebView2, WPF, WinUI3 and GTK harnesses, the capture and installer lanes and the standalone browser lanes are left to the full run. The quick lane passes `lane: shared` and `harness_filter: electron` to the Windows and Linux workflows, and `quick=true` to the hosted macOS dispatch (not a certification: its result artifact is named `rust-macos-hosted-quick-result-*`).+- **Full suite.** Every lane, 26 to 47 minutes each. It runs after merge and at release.++| Trigger | When | Size | Result |+| --- | --- | --- | --- |+| Push to `main` | The pushed commits touch a gated path (`.github/scripts/cua_driver_e2e_gate_paths.py`). Runs queue; a burst of merges leaves one pending run for the newest commit | full | A failure alerts (`workflow-failure-alerts.yml`, Alertmanager) and opens or updates the issue below |+| Nightly, 06:00 UTC | main's HEAD | full | Same. The first fully clean full run closes the issue |+| Stable tag run | The exact release commit (`cd-rust-cua-driver.yml`) | full | Blocks publishing until every lane is green |+| Pull request | The `e2e-gate` label is present, or the PR touches the cursor overlay, focus, background input or browser routing paths. release-please PRs skip the lanes (the tag gate runs them on the release commit) unless labelled | quick | The quick lanes run on the PR merge commit. |+| Other pull requests | Everything else | none | The lanes are skipped and `E2E gate / result` passes at once. |++A failed full run opens or updates one issue, "Cua Driver release gate failing on main (nightly)" (the title predates the post-merge run). The failed run also posts to #releases through the GitHub Slack app workflow-run subscription. A break the quick lane could not see, a Windows break included, is already on `main` when the full run finds it, so it is **fixed forward** with a new PR; the stable tag gate blocks a release until `main` is green again.**Retry once.** Inside each lane a failed case is rerun once (`lib/e2e-retry-once.sh`, and `Invoke-CargoTest` in the Windows runner). A pass on the retry is flaky: it is listed under "Flaky cases" in the job summary and in the tracking issue, and does not fail the gate. Two failures are a real failure. The first attempt's rows, videos and log are kept under `retried-attempts/` in the lane artifact.-**Required check.** Branch protection cannot require a check by path, so the workflow always runs and `E2E gate / result` is the one check to require on `main`. It is green when the lanes are not needed. A repository admin has to add it under Settings, Branches. Until then the gate is advisory on pull requests; the label, path and release-PR triggers still run the lanes.+**Required check.** Branch protection cannot require a check by path, so the workflow always runs and `E2E gate / result` is the one check to require on `main`. It is green when the lanes are not needed. A repository admin has to add it under Settings, Branches. Until then the gate is advisory on pull requests; the label, path and release-PR triggers still run the quick lanes.diff --git a/scripts/ci/windows/run-rust-e2e.ps1 b/scripts/ci/windows/run-rust-e2e.ps1index 9feb0e26ca..9253d1d92b 100644--- a/scripts/ci/windows/run-rust-e2e.ps1+++ b/scripts/ci/windows/run-rust-e2e.ps1@@ -44,6 +44,16 @@ if ($null -eq $ffmpeg -or $null -eq $ffprobe) {& (Join-Path $scriptDir "verify-user-session.ps1")if ($RequireGui) { $env:CUA_REQUIRE_GUI = "1" }+# Harness hosts named by CUA_E2E_HARNESS_FILTER (the Rust test reads the same+# variable and keeps only those hosts); empty means every host. The fixture+# target "webview" is the host "webview2".+function Test-HarnessWanted([string]$Name) {+ $selected = @(([string]$env:CUA_E2E_HARNESS_FILTER).Split(",") | ForEach-Object { $_.Trim() } | Where-Object { $_ })+ if ($selected.Count -eq 0) { return $true }+ if ($Name -eq "webview") { $Name = "webview2" }+ return $selected -contains $Name+}+$env:CUA_TEST_WORKSPACE_ROOT = $rustRoot$env:CUA_TEST_DRIVER_BIN = Join-Path $rustRoot "target\release\cua-driver.exe"$env:CUA_TEST_APPS_ROOT = Join-Path $rustRoot "test-apps"@@ -83,7 +93,9 @@ if (-not $NoBuild) {}if ($buildExit -ne 0) { throw "Rust driver build failed" }$fixtureTargets = switch ($suite) {- "shared" { @("electron", "tauri", "webview") }+ # The PR quick lane sets CUA_E2E_HARNESS_FILTER=electron: build only the+ # harnesses it names, like the Linux runner does. Empty builds them all.+ "shared" { @(@("electron", "tauri", "webview") | Where-Object { Test-HarnessWanted $_ }) }"native" { @("wpf", "winui3", "webview", "electron") }"capture" { @("wpf", "electron") }default { @("wpf", "winui3", "webview", "electron", "tauri") }@@ -96,13 +108,13 @@ if (-not (Test-Path $env:CUA_TEST_DRIVER_BIN)) {}$requiredFixtures = @()$requiredFixtures += Join-Path $env:CUA_TEST_APPS_ROOT "harness-electron\CuaTestHarness.Electron.exe"-if ($suite -in @("shared", "all")) {+if (($suite -in @("shared", "all")) -and (Test-HarnessWanted "tauri")) {$requiredFixtures += Join-Path $env:CUA_TEST_APPS_ROOT "harness-tauri\CuaTestHarness.Tauri.exe"}if ($suite -in @("native", "capture", "all")) {$requiredFixtures += Join-Path $env:CUA_TEST_APPS_ROOT "harness-wpf\CuaTestHarness.Wpf.exe"}-if ($suite -in @("shared", "native", "all")) {+if (($suite -in @("shared", "native", "all")) -and (Test-HarnessWanted "webview")) {$requiredFixtures += Join-Path $env:CUA_TEST_APPS_ROOT "harness-webview\CuaTestHarness.WebView.exe"}if ($suite -in @("native", "all")) {