From ecdeced7264b44a3028f6dcbee238edcf4bc81f5 Mon Sep 17 00:00:00 2001 From: ework-agent Date: Mon, 12 Oct 2026 17:30:58 +0800 Subject: [PATCH] fix(ci): stop tier-1 guards from skipping test/static-gates on non-PR events (#2901) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #2637's fail-fast tiering gated version/kernel/pi-subagents/lane-guard with 'if: pull_request' on the assumption that skipped needs count as satisfied. That is not what GitHub Actions does: a needed job skipped via if blocks its dependents, so since bc6e3274b every master push, release-branch push and workflow_dispatch showed test+static-gates = skipped — master's own CI never ran the suite (the blind spot through which #2782's unregistered spawner shipped undetected; #2896/#2901). Remove the four event gates so all eight needs run on every event. The guards are inert by construction on non-PR events: their checks are three-dot diffs against origin/master (empty on a push to master), and version-guard/kernel-guard fall back from GITHUB_HEAD_REF to GITHUB_REF so *_release-v*, bugfix-release/* and *_release-kernel-v* branches keep their exemptions. PR flow is unchanged (GITHUB_HEAD_REF takes precedence). Behavior change: non-PR runs execute the full test + static-gates matrix again (pre-#2637 behavior restored) plus four ~10s zero-dep guard jobs. --- .github/workflows/ci.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a5eebf577..6a1762127b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,9 +34,18 @@ concurrency: jobs: # #2637 plan #8 (owner-approved): fail-fast tiering — the ~0-1m guards gate # the four platform legs so a broken commit stops in tier 1 instead of - # paying 4x(install+typecheck+suites+build). Guards with `if: pull_request` - # skip on push/dispatch (skipped needs count as satisfied). Behavior change: - # on guard failure the required legs show pending (not red); merge blocked. + # paying 4x(install+typecheck+suites+build). Behavior change: on guard + # failure the required legs show pending (not red); merge blocked. + # #2901: the guards run on EVERY event, not just pull_request. A needed job + # skipped via `if` blocks its dependents (they skip too) — #2637's original + # `if: pull_request` gates therefore silently skipped test/static-gates on + # every master push, release-branch push and workflow_dispatch ("master + # self-breaks, PRs pay"; that blind spot is how #2782's unregistered + # spawner reached master undetected). On non-PR events the guards are inert + # by construction: their checks are three-dot diffs against origin/master + # (empty on a push to master), and version-guard/kernel-guard fall back to + # GITHUB_REF so release branches keep their exemptions. Cost: four ~10s + # zero-dep jobs per non-PR run; benefit: master is actually tested again. test: needs: [version-guard, kernel-guard, pi-subagents-guard, lane-guard, docs-sync, docs-coverage, unused-exports, lock-sync] strategy: @@ -98,7 +107,6 @@ jobs: version-guard: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 with: @@ -106,7 +114,10 @@ jobs: - name: Verify version field only changes on release branches run: | set -euo pipefail - BRANCH="${GITHUB_HEAD_REF}" + # #2901: GITHUB_HEAD_REF is empty outside pull_request; fall back to + # the pushed branch so release/bugfix branches keep their exemption + # and master takes the non-release path with an empty three-dot diff. + BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" # Release + bugfix carve-out branches (#2851/#2853) may bump version — one isolated 'release v{VERSION}' commit each. if [[ "$BRANCH" == *_release-v* || "$BRANCH" == bugfix-release/* ]]; then echo "✓ release branch ($BRANCH) — version changes allowed" @@ -122,7 +133,6 @@ jobs: kernel-guard: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 with: @@ -132,7 +142,8 @@ jobs: PR_BODY: ${{ github.event.pull_request.body }} run: | set -euo pipefail - BRANCH="${GITHUB_HEAD_REF}" + # #2901: same GITHUB_REF fallback as version-guard (runs on every event). + BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" # Kernel release branches bump kernel/package.json alone by design. if [[ "$BRANCH" == *_release-kernel-v* ]]; then echo "✓ kernel release branch ($BRANCH) — kernel version changes allowed" @@ -175,7 +186,6 @@ jobs: # load-bearing core compression). pi-subagents-guard: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 with: @@ -251,7 +261,6 @@ jobs: # mechanical: lane logic moves ⇔ a side-lane suite moves with it. lane-guard: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 with: