Skip to content

fix(ci): stop tier-1 guards from skipping test/static-gates on non-PR events (#2901) - #2907

Closed
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-12_ci-push-test-skip
Closed

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-12_ci-push-test-skip

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

#2901 建议修法第 3 条:恢复非 PR 事件(master push / release push / dispatch)上的真实测试运行。第 ①② 条(LIVE_FILES 登记)已由 #2898 在重复报告 issue #2896 下处理,本 PR 刻意不含该 diff。

Root cause

#2637(commit 6b0c7b4,fail-fast tiering)给 test/static-gates 加了含四个 if: github.event_name == 'pull_request' 守卫的 needs:。提交注释假设 "skipped needs count as satisfied" —— GitHub Actions 的实际行为相反:被 if 跳过的 needed job 会连带跳过其依赖者。本仓实证:

Fix

移除四个守卫的 if: pull_request 门,让全部 8 个 needs 在每个事件上都执行。非 PR 事件下守卫按构造即 inert:

  • 所有检查都是对 origin/master 的三点 diff(master push 上为空 → 通过);
  • version-guard / kernel-guard:BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" —— push/dispatch 下 GITHUB_HEAD_REF 为空,回退到被推分支名,保住 *_release-v* / bugfix-release/* / *_release-kernel-v* 豁免(one-click fallback 分支命名 YYYY-MM-DD_release-v{VER}[-HHMMSS],匹配该模式);
  • PR 流程零变化:GITHUB_HEAD_REF 优先,守卫其余逻辑逐字节未动。

Behavior change(old → new)

Event old new
pull_request 守卫跑 → test+static-gates 跑 不变
push to master 守卫 skip → test+static-gates skip 守卫跑(平凡通过)→ 完整矩阵跑
push to release/bugfix/kernel-release 分支 同样静默 skip 守卫跑(豁免保留)→ 完整矩阵跑
workflow_dispatch(含 #1744 one-click fallback) 同样静默 skip 完整矩阵跑——#772/#1744 文档化的补偿路径自 #2637 后首次真正产出真实 check runs

代价:每次非 PR 运行多 4 个 ~10s 零依赖守卫 job。附带效果:scripts/release-ci-gate.mjs --wait(严格:只看 run 级 success)过去在 one-click publish sha 上是零测试覆盖就放行(腿被 skip);此后要求 publish sha 有真实绿套件——这是第 ③ 条意图内的收紧。

Verification

Config surface: none(CI workflow only).

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-12_ci-push-test-skip (ecdeced)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3238-pr.2907.262e320

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr2907.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei force-pushed the 2026-10-12_ci-push-test-skip branch from c4fdfa5 to b03db93 Compare October 12, 2026 09:48
… events (#2901)

#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 bc6e327 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.
@ranxianglei
ranxianglei force-pushed the 2026-10-12_ci-push-test-skip branch from b03db93 to ecdeced Compare October 12, 2026 09:52
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

PR #2907 review 结论(核对代码 + 确认 CI;未重做,仅按「CI 失败→修正」补了一次 rebase)

先说做了什么:这是 ework-agent-pr 标记的已完成 agent PR,我拉分支逐行核对了代码并确认 CI。发现 test 腿在旧 head(c4fdfa5ef)上 6 腿全红,但红因与本 diff 无关——本 PR 只动 .github/workflows/ci.yml,不可能让测试挂;红的根因是 master 侧已知 tripwire:#2782 新增的 tests/issue2752-forward-partial-outcome.test.ts 未在 scripts/run-ci-tests.mjs 的 LIVE_FILES 登记,自检把它当未登记 spawner 判红(此前一直被「test 腿被 skip」掩盖,恰是本 bug 的症状)。#2898 已合并该登记修复。我把本 PR rebase 到当前 master(新 head ecdeced)并 force-push;rebase 后重跑:13 个 guard/build/docs 腿已全绿,test 腿从「tripwire 秒红」转为真实矩阵运行中(不再 fail-fast),static-gates 6 腿同步运行。本地也复现了 LIVE_FILES 自检逻辑(非递归、顶层 tests/*.test.ts):rebase 后树上 622 文件、33 登记、0 未登记 spawner,自检通过。

按结构化八问:

  1. 是什么问题:CI 排队与执行时间优化:不降低质量的前提下大幅节省(数据+方案清单) #2637 给 test/static-gates 加了带 if: github.event_name == 'pull_request' 守卫的 needs:,误以为「被跳过的 needed job 算满足」;实际 GitHub Actions 里被 if 跳过的 needed job 会连带跳过其依赖者,导致所有非 PR 事件(master push / release push / dispatch)上 test+static-gates 静默 skip。

  2. 什么原因导致的:提交注释里的错误假设(skipped-needs-count-as-satisfied 与 GH Actions 实际语义相反)。因果分层:直接原因是那 4 个 if: 守卫;根因是对 GH Actions needs: 级联语义的误解。

  3. 影响范围与严重程度:所有非 PR 事件上 CI 零真实测试覆盖(只有 guard 跑)——「master 自坏、PR 代偿」,正是 fix: propagate compress outcome/blocksCreated through host forwarding lanes (#2752) #2782 未登记 spawner 能无声合入 master 的盲区。严重度:特定条件下完全失效(一切非 PR 事件),PR 事件不受影响。

  4. 怎么修复的:移除 4 个 if: pull_request 门,让全部 8 个 needs 在每个事件上都执行;非 PR 事件下守卫按构造即 inert(三点 diff 对 origin/master 为空→平凡通过),version/kernel-guard 加 GITHUB_REF 回退保住 *_release-v* / bugfix-release/* / *_release-kernel-v* 豁免。修法打在源头(决策点=守卫是否执行),不是过滤症状。

  5. 是否有回归问题:PR 流程零变化(GITHUB_HEAD_REF 优先,守卫其余逻辑逐字节未动);负路径不变(feature 分支改 version 仍红,bump 检测行逐字节相同)。高危模式逐项过:无 fail-fast 变吞错、无阈值/时序漂移、无输出格式变化。唯一行为收紧见下。

  6. 是否破坏缓存:不涉及(纯 CI workflow,无缓存/重试/增量游标/去重键)。

  7. 是否改了设计方向:无架构转向,只是恢复 CI 应有的完整覆盖。附带效果(有意收紧):scripts/release-ci-gate.mjs --wait(严格模式只看 run 级 success)过去在 one-click publish sha 上是零测试覆盖就放行(腿被 skip);此后要求 publish sha 有真实绿套件——这是第③条意图内的收紧,属预期收益而非回归。

  8. 是否引入了新的配置:不涉及(Config surface: none,纯 CI workflow,无新 env/config/默认值)。

诚实标注无法本地证明的一点:needs 级联真正修复的最终证明需合并后的一次 master push 显示腿真实执行——本地无法模拟 GH Actions 的 push 事件,PR 本身也注明了这点。当前证据链:代码逐行核对正确 + 8 个 job 按各事件类型逐一推演通过 + rebase 后 CI 实跑中 guard/static-gates 全绿、test 腿真实运行(tripwire 已解除)。

判定:diff 干净(单文件 ci.yml)、方向正确、stale-base 已修、tripwire 已由 #2898 落地。待本次 CI(ecdeced72)全绿即可合并——目前 13 腿已绿、test/static-gates 矩阵运行中,预期转绿。合并请人工操作(按规约我不 merge)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

CI 更新(rebase 后 head ecdeced):18 腿中已 17 绿 —— 8 guard + build-artifact + docs-sync/docs-coverage + config-surface-guard + 全部 static-gates 矩阵腿 + test(ubuntu/22)、test(windows/22)、test(windows/24) 全过;仅剩 test (ubuntu-latest, 24) 在跑同一套件(其三个同胞组合已绿,落地即全绿)。

这直接证实了 stale-base 修复有效:rebase 到当前 master(含 #2898 的 LIVE_FILES 登记)后,test 腿从「tripwire 秒红」转为真实运行并通过,与本地自检(0 未登记 spawner)一致。

判定不变:diff 干净(单文件 ci.yml)、方向正确、CI 实质全绿。可合并 —— 合并请人工操作(按规约我不 merge)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant