diff --git a/.github/ci-policy.md b/.github/ci-policy.md index d7b2b9f4b7..3a902df900 100644 --- a/.github/ci-policy.md +++ b/.github/ci-policy.md @@ -45,6 +45,7 @@ also scans the full workflow directory. Main and manual venues are explicit: | workflow-lint | none | yes | | proxy-port-fallbacks | none | yes | | fleet-search-parity-guard | none | yes | +| fleet-rust-tests | main push, path gated | yes | | opencode-config-guard | main push | yes | | mcpx fix-test guard | main push contract tests | yes | | production-line guard | main push, path gated | yes | diff --git a/.github/scripts/check-fleet-rust-tests.sh b/.github/scripts/check-fleet-rust-tests.sh index e052f1a944..6a913d30f7 100755 --- a/.github/scripts/check-fleet-rust-tests.sh +++ b/.github/scripts/check-fleet-rust-tests.sh @@ -4,8 +4,9 @@ # The contract: the fleet.rust row of .github/test-suite-registry.json # counts as covered only while all of these agree — # 1. .github/workflows/fleet-rust-tests.yml exists, is basic-tier, -# and runs on pull_request (pkgs/fleet/** paths), push to main, -# and workflow_dispatch; +# and runs on push to main (pkgs/fleet/** paths) and +# workflow_dispatch — and declares no pull_request trigger +# (main-only CI policy, .github/ci-policy.md, 2026-11-13); # 2. its test step runs the locked workspace test command with the # toolchain channel pinned in pkgs/fleet/rust-toolchain.toml; # 3. the registry row fleet.rust is status "mapped" and names this @@ -38,12 +39,19 @@ if [ "$fail" -ne 0 ]; then exit 1 fi -# 1. Triggers and tier shape. -for trigger in pull_request push workflow_dispatch; do +# 1. Triggers and tier shape. Main-only CI policy (2026-11-13): the +# workflow runs on push to main and workflow_dispatch only; a +# pull_request trigger is a contract violation, not a requirement. +for trigger in push workflow_dispatch; do if ! grep -qE "^ ${trigger}:" "$WF"; then err "workflow does not declare the ${trigger} trigger" fi done +for trigger in pull_request pull_request_target merge_group; do + if grep -qE "^ ${trigger}:" "$WF"; then + err "workflow declares the ${trigger} trigger - main-only CI policy forbids PR triggers" + fi +done if ! grep -qF '"pkgs/fleet/**"' "$WF"; then err "workflow path filter does not cover pkgs/fleet/** — a Fleet change could silently skip the suite" fi diff --git a/.github/scripts/check-fleet-rust-tests.test.sh b/.github/scripts/check-fleet-rust-tests.test.sh index ae0e273ae7..35416bbf48 100755 --- a/.github/scripts/check-fleet-rust-tests.test.sh +++ b/.github/scripts/check-fleet-rust-tests.test.sh @@ -58,6 +58,16 @@ make_fixture "$MUT" sed -i '/pkgs\/fleet\/\*\*/d' "$MUT/.github/workflows/fleet-rust-tests.yml" expect_fail "$MUT" "workflow without the pkgs/fleet path filter" +MUT="$TMP/pr-trigger" +make_fixture "$MUT" +sed -i 's/^ workflow_dispatch:/ pull_request:\n workflow_dispatch:/' "$MUT/.github/workflows/fleet-rust-tests.yml" +expect_fail "$MUT" "workflow with a pull_request trigger (main-only policy)" + +MUT="$TMP/no-push" +make_fixture "$MUT" +sed -i 's/^ push:/ pushx:/' "$MUT/.github/workflows/fleet-rust-tests.yml" +expect_fail "$MUT" "workflow without the push trigger" + MUT="$TMP/registry-uncovered" make_fixture "$MUT" python3 - "$MUT/.github/test-suite-registry.json" <<'PYEOF' diff --git a/.github/workflows/fleet-rust-tests.yml b/.github/workflows/fleet-rust-tests.yml index 65aa6bfedd..865ebbe66f 100644 --- a/.github/workflows/fleet-rust-tests.yml +++ b/.github/workflows/fleet-rust-tests.yml @@ -31,9 +31,9 @@ permissions: concurrency: # Push-to-main runs are keyed by run_id so every merged tree gets - # its own completed run (the scripts-test/nix-ci contract); - # pull-request runs share a per-ref group so a new push supersedes - # the stale one. + # its own completed run (the scripts-test/nix-ci contract); manual + # dispatch runs share a per-ref group so a new dispatch supersedes + # the stale one. (Main-only CI policy: no PR runs exist.) group: fleet-rust-tests-${{ github.event_name == 'push' && github.run_id || github.ref }} cancel-in-progress: true @@ -51,7 +51,7 @@ jobs: bash .github/scripts/check-fleet-rust-tests.test.sh - name: Install Rust toolchain - run: rustup toolchain install 1.99.0 --profile minimal + run: rustup toolchain install 1.99.1 --profile minimal - name: Test the fleet Rust workspace - run: cargo +1.99.0 test --manifest-path pkgs/fleet/Cargo.toml --workspace --all-targets --locked + run: cargo +1.99.1 test --manifest-path pkgs/fleet/Cargo.toml --workspace --all-targets --locked