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(ci): run the release-gate lanes when the PR-only quick job is skipped (#6540)

injaneitye358a8236de3
diff --git a/.github/scripts/tests/test_e2e_rust_linux_workflow.py b/.github/scripts/tests/test_e2e_rust_linux_workflow.py
index 698b07e80e..79a94dca0a 100644
--- a/.github/scripts/tests/test_e2e_rust_linux_workflow.py
+++ b/.github/scripts/tests/test_e2e_rust_linux_workflow.py
@@ -13,7 +13,9 @@ def test_canonical_certification_is_fail_closed_and_complete() -> None:
certification = workflow.split("\n certify:\n", 1)[1]
# Manual dispatches and stable-tag release-gate calls both certify.
- assert "if: success() && inputs.lane == 'all'" in certification
+ assert "!failure() && !cancelled() && inputs.lane == 'all'" in certification
+ for job in ("source", "shared", "native", "capture", "installer"):
+ assert f"needs.{job}.result == 'success'" in certification
assert "needs: [source, shared, native, capture, installer]" in certification
assert 'schema "cua-driver/e2e-certification/v1"' in certification
assert 'platform "linux"' in certification
@@ -45,7 +47,7 @@ class VerifySkillTests(unittest.TestCase):
self.assertIn(" - verify", workflow)
job = workflow.split("\n verify-skill:\n")[1].split("\n shared:\n")[0]
for setting in (
- "if: inputs.lane == '' || inputs.lane == 'verify'",
+ "if: ${{ !failure() && !cancelled() && (inputs.lane == '' || inputs.lane == 'verify') }}",
"timeout-minutes: 25",
'CUA_E2E_RETRY_ONCE: "0"',
"key: e2e-shared",
diff --git a/.github/scripts/tests/test_quick_skip_propagation.py b/.github/scripts/tests/test_quick_skip_propagation.py
new file mode 100644
index 0000000000..8ceff14cb4
--- /dev/null
+++ b/.github/scripts/tests/test_quick_skip_propagation.py
@@ -0,0 +1,43 @@
+"""A PR-only `quick` job must not skip the jobs behind it on other events.
+
+GitHub skips a job whose `needs` chain contains a skipped job unless its `if:`
+calls a status function. When `quick` only runs on pull_request, a job without
+one is skipped on schedule, push and workflow_call runs.
+"""
+
+import re
+from pathlib import Path
+
+import pytest
+import yaml
+
+ROOT = Path(__file__).resolve().parents[3]
+WORKFLOWS = (
+ "e2e-cua-driver-release-gate.yml",
+ "e2e-rust-linux.yml",
+)
+STATUS = re.compile(r"\b(always|failure|cancelled|success)\(\)")
+
+
+def _needs(job: dict) -> list[str]:
+ needs = job.get("needs") or []
+ return [needs] if isinstance(needs, str) else list(needs)
+
+
[email protected]("name", WORKFLOWS)
+def test_jobs_behind_pr_only_quick_survive_its_skip(name: str) -> None:
+ jobs = yaml.safe_load((ROOT / ".github/workflows" / name).read_text())["jobs"]
+ assert "pull_request" in jobs["quick"]["if"]
+
+ def behind_quick(job: str, seen: set[str]) -> bool:
+ for dep in _needs(jobs[job]):
+ if dep == "quick" or (dep not in seen and behind_quick(dep, seen | {dep})):
+ return True
+ return False
+
+ missing = [
+ job
+ for job, spec in jobs.items()
+ if job != "quick" and behind_quick(job, set()) and not STATUS.search(str(spec.get("if", "")))
+ ]
+ assert not missing, f"{name}: jobs skipped whenever quick is skipped: {missing}"
diff --git a/.github/workflows/e2e-cua-driver-release-gate.yml b/.github/workflows/e2e-cua-driver-release-gate.yml
index a17f7b30a9..9a2cc21bf6 100644
--- a/.github/workflows/e2e-cua-driver-release-gate.yml
+++ b/.github/workflows/e2e-cua-driver-release-gate.yml
@@ -117,7 +117,7 @@ jobs:
linux:
name: "gate / Linux E2E"
needs: decide
- if: needs.decide.outputs.run == 'true'
+ if: ${{ !failure() && !cancelled() && needs.decide.outputs.run == 'true' }}
permissions:
actions: read
contents: read
@@ -128,7 +128,7 @@ jobs:
windows:
name: "gate / Windows E2E"
needs: decide
- if: needs.decide.outputs.run == 'true'
+ if: ${{ !failure() && !cancelled() && needs.decide.outputs.run == 'true' }}
permissions:
actions: read
contents: read
@@ -141,7 +141,7 @@ jobs:
macos:
name: "gate / macOS hosted E2E"
needs: decide
- if: needs.decide.outputs.run == 'true' && github.event_name != 'pull_request'
+ if: ${{ !failure() && !cancelled() && needs.decide.outputs.run == 'true' && github.event_name != 'pull_request' }}
permissions:
actions: read
contents: read
@@ -156,6 +156,7 @@ jobs:
name: "gate / macOS hosted E2E (dispatched)"
needs: decide
if: >-
+ !failure() && !cancelled() &&
needs.decide.outputs.run == 'true' && github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
@@ -236,7 +237,7 @@ jobs:
browsers:
name: "gate / standalone browser E2E"
needs: decide
- if: needs.decide.outputs.run == 'true'
+ if: ${{ !failure() && !cancelled() && needs.decide.outputs.run == 'true' }}
permissions:
actions: read
contents: read
diff --git a/.github/workflows/e2e-rust-linux.yml b/.github/workflows/e2e-rust-linux.yml
index a54f1621f1..f48dfac1f7 100644
--- a/.github/workflows/e2e-rust-linux.yml
+++ b/.github/workflows/e2e-rust-linux.yml
@@ -98,7 +98,7 @@ jobs:
echo "sha=${sha,,}" >> "$GITHUB_OUTPUT"
verify-skill:
- if: inputs.lane == '' || inputs.lane == 'verify'
+ if: ${{ !failure() && !cancelled() && (inputs.lane == '' || inputs.lane == 'verify') }}
name: "Linux / verification skill proof"
needs: source
runs-on: ubuntu-latest
@@ -145,7 +145,7 @@ jobs:
retention-days: 14
shared:
- if: inputs.lane == 'all' || inputs.lane == 'shared'
+ if: ${{ !failure() && !cancelled() && (inputs.lane == 'all' || inputs.lane == 'shared') }}
name: "Linux / shared Electron + Tauri"
needs: source
runs-on: ubuntu-latest
@@ -200,7 +200,7 @@ jobs:
retention-days: 14
native:
- if: inputs.lane == 'all' || inputs.lane == 'native'
+ if: ${{ !failure() && !cancelled() && (inputs.lane == 'all' || inputs.lane == 'native') }}
name: "Linux / GTK3 + GTK4 native harnesses"
needs: source
runs-on: ubuntu-latest
@@ -250,7 +250,7 @@ jobs:
retention-days: 14
capture:
- if: inputs.lane == 'all' || inputs.lane == 'capture'
+ if: ${{ !failure() && !cancelled() && (inputs.lane == 'all' || inputs.lane == 'capture') }}
name: "Linux / capture and desktop scope"
needs: source
runs-on: ubuntu-latest
@@ -300,7 +300,7 @@ jobs:
retention-days: 14
installer:
- if: inputs.lane == 'all' || inputs.lane == 'installer'
+ if: ${{ !failure() && !cancelled() && (inputs.lane == 'all' || inputs.lane == 'installer') }}
name: "Linux / install-local.sh smoke"
needs: source
runs-on: ubuntu-latest
@@ -460,7 +460,11 @@ jobs:
# combined with the lane=='all' check this keeps certification fail-closed
# against both lane failures and diagnostic-lane dispatches. Manual
# dispatches and release-gate calls certify the same complete matrix.
- if: success() && inputs.lane == 'all'
+ if: >-
+ !failure() && !cancelled() && inputs.lane == 'all' &&
+ needs.source.result == 'success' && needs.shared.result == 'success' &&
+ needs.native.result == 'success' && needs.capture.result == 'success' &&
+ needs.installer.result == 'success'
needs: [source, shared, native, capture, installer]
name: "Linux / canonical certification"
runs-on: ubuntu-latest