Skip to content

ci: trim CI queue load without quality loss (#2637) - #2641

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-10_ci-scheduling-trim
Oct 10, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-10_ci-scheduling-trim

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What

Implements #2637 plans #2 + #3 + #8 plus the promised concurrency top-up
(pr-artifact, windows-codex). Owner approved 2026-10-10 in-thread: 先做大头不
改变效果明显可优化的,「一个失败都停止的」可以做. One commit, workflow files only
(13 files, +220/-11), no source/test content touched.

  • fix: address all code review findings (condense, routing, session-id, dead code) #2 path filters on the eight unfiltered heavy lanes (e2e-fake,
    codex-persona, dsh-native, native-opencode, native-pi, pi-ws, registry,
    windows-codex): request-pipeline hot files (AGENTS.md §3 set) + each lane's
    own test subjects (persona: cli/launcher — it drives BOTH URL and launcher
    mode; dsh-native: src/dsh-channel.ts; native-pi: pi-subagents/**; registry:
    update/advisory/plugin-install per AGENTS.md §3 pairing; windows-codex:
    win-cmd-argv test + mcp-check script + cli/launcher). windows-codex filters
    BOTH pull_request and push (shape follows ci-zcode-real.yml).
  • Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 nightly cron '30 16 * * *' UTC (Beijing 00:30) on all eleven heavy
    e2e lanes (the eight above + already-filtered ci-e2e / ci-e2e-dsh /
    ci-zcode-real). Schedule fires on master only and ignores paths → daily
    full-regression backstop for the new filters. workflow_dispatch fallback
    kept everywhere (zcode version falls back to its pinned default).
  • feat: release CI (npm auto-publish on release branch) #8 fail-fast tiering in ci.yml: the seven ~0-1m guards now gate the
    four platform legs (needs:); a broken commit stops in tier 1 instead of
    paying 4x(install+typecheck+suites+build). Guards with if: pull_request
    skip on push/dispatch events; skipped needs count as satisfied, so release
    branch pushes are unaffected.
  • concurrency top-up: pr-artifact and windows-codex get same-ref
    cancel-in-progress (pattern of merged ci: cancel superseded same-ref CI runs (concurrency, cancel-in-progress) #2635). All eleven nightly lanes get a
    schedule-safe group branch so routine master pushes never cancel the day's
    nightly run; same-ref supersede semantics unchanged.

Behavior changes (old → new, mandatory disclosure)

  1. Heavy e2e lane trigger surface: old = every PR to any branch runs all
    lanes → new = only when the lane's path set hits, plus nightly (daily,
    full) plus manual dispatch. Reason: queue reduction; coverage at any point
    in time is preserved by the nightly backstop. Required checks untouched
    — verified via branch-protection API that master requires exactly the four
    ci.yml test legs, which still run on every PR/push as before.
  2. windows-codex push trigger: old = every master push runs 3 Windows jobs
    (~10-12m each) → new = path-hit pushes only + nightly. Same reason as 1.
  3. ci.yml guard failure: old = legs run concurrently with guards and show
    RED when they fail → new = legs never start and show PENDING (grey) when a
    guard fails. Merge stays blocked either way (strict required checks); the
    signal changes from red to pending-plus-red-guard. Approved explicitly.
  4. New scheduled activity: 11 workflows fire once daily at 16:30 UTC —
    one bounded pool burst per day at off-peak (Beijing 00:30). No other
    timing/schedule changes anywhere.
  5. pr-artifact / windows-codex same-ref reruns: old = queued behind their
    predecessor → new = cancelled in favor of the latest (identical to the
    ci: cancel superseded same-ref CI runs (concurrency, cancel-in-progress) #2635 pattern already merged for ci.yml). pr-artifact safety: temp versions
    are monotonic per run_number (Design: PR artifact publishing — stop dist-tag growth with single rolling tag + monotonic 0.0.x-pr versions #1385), a cancelled mid-publish run simply
    never publishes its version string.

No config surface change (no config fields / env vars / CLI flags added).
No test/assertion removed or modified. Release branches keep their full
push-triggered coverage (#2637 plan #4, untouched).

Why this PR validates itself

Every edited workflow lists its own file in its path set (and ci.yml /
pr-artifact run unconditionally), so this PR's own CI run exercises ALL new
trigger definitions end-to-end before merge.

Not included (per thread decision)

Closes #2637

Plan #2: path-filter the eight unfiltered heavy lanes (e2e-fake,
codex-persona, dsh-native, native-opencode, native-pi, pi-ws, registry,
windows-codex) to request-pipeline hot files (AGENTS.md §3) plus each
lane's own test subjects; windows-codex filters BOTH pull_request and
push (shape follows ci-zcode-real.yml) so routine master merges stop
paying for three Windows jobs. Required checks (the four ci.yml test
legs, verified via branch-protection API) are untouched.

Plan #3: nightly '30 16 * * *' UTC full regression on master for all
eleven heavy e2e lanes (schedule ignores paths = daily backstop for the
new filters); workflow_dispatch fallback kept everywhere. Concurrency
groups gain a schedule-safe branch so master pushes never cancel the
day's nightly run; same-ref supersede-cancel semantics unchanged.

Plan #8: ci.yml fail-fast tiering — the ~0-1m guards gate the four
platform legs so a broken commit stops in tier 1 (owner-approved).
Behavior change: on guard failure the required legs show pending
instead of red; merge stays blocked.

Also: pr-artifact and windows-codex get same-ref cancel-in-progress
concurrency (pattern of merged #2635); pr-artifact temp versions are
monotonic per run_number (#1385), so a cancelled mid-publish run leaves
no residue.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-10_ci-scheduling-trim (6b0c7b4)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2858-pr.2641.3f31909

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-pr2641.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 已完成对 #2641(实现 #2637 的 #2 路径过滤 + #3 nightly + #8 fail-fast 分层 + concurrency 补齐)的审查。纯 workflow 改动(13 文件,+220/-11,零源码/零测试)。核对证据:head 6b0c7b4 上 27/27 check runs 全绿;base = 当前 master(mergeable: clean,无需 rebase);branch-protection API 显示 master 的 required checks 恰好只有 4 条 ci.yml test 腿。按结构化八问给结论:

1. 是什么问题 — CI 排队/执行时间优化(#2637):托管 runner 无优先级(FIFO)、每个 PR/push 无条件全量跑所有 lane、同 ref 旧 run 不取消,高峰连 tiny job 都排队 25+ 分钟。本 PR 用「削需求侧 + 消冗余 run + nightly 兜底」落地,不动任何质量门。

2. 什么原因导致的 — 供给侧(唯一杠杆是减池内 job 数)× 需求侧(全量触发)。PR 打的是需求侧:路径过滤(#2)把日常 PR 的重型 e2e 从「全跑」降到按需;same-ref cancel 消除自排自;nightly(#3)把省下的即时覆盖收回成每日全量。方向对准根因,非治标;#5 分片 / #6 缓存 / #7 砍 node 版本按 thread 决定明确排除,纪律正确。

3. 影响范围与严重程度 — 触发面收窄:8 个原「每 PR 必跑」的重型 e2e lane 改路径命中才跑,windows-codex 的 push 触发同样收窄。关键安全点已核实:master 的 required checks 只有 4 条 test 腿,所有 e2e lane 都不是 required → 路径跳过不会阻塞合并。单元级回归仍由每 PR 必跑的 ci.yml test(npm test 全套 + kernel/pi-subagents suite + build)兜住,真实客户端 e2e 由 nightly(≤24h)兜底。严重度:无功能回归,属有意调度变更且已全部披露。

4. 怎么修复的 — 机制:① 8 lane 加 pull_request.paths(复用既有 real-codex lane 的 hot-file 约定并略放宽 + 各 lane 专属对象;registry 三项精确对齐 AGENTS.md §3 配对);② 11 个重型 lane 统一 cron '30 16 * * *' UTC(Beijing 00:30,master-only、忽略 paths)= 每日全量兜底;③ ci.yml 让 4 平台腿 needs: 7 个 guard,tier1 即停;④ concurrency group 换成 schedule-safe 表达式(${{ event=='schedule' && 'nightly' || ref }})使 nightly 脱离 per-ref 取消域。

5. 是否有回归问题 — 逐项过既有行为,无回归:

  • required checks 未动(仅 4 腿,已核实);guard 失败时腿转 pending(skipped),required 未满足 → 合并仍被拦(安全方向),信号 红→灰+红 guard,已披露(Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3)。
  • skipped-needs 语义已核实:GitHub Actions 默认 success() 只对 failed/cancelled 敏感,被跳过的依赖不阻塞下游 → push/release 分支上 4 个带 if: pull_request 的 guard 被跳过后,test 腿仍会运行,release 分支全量 push 覆盖不受影响(plan feat: OpenAI Responses API support (/v1/responses) #4 守住)。
  • 高危模式排查:无 fail-fast 变吞错、无阈值/时序/输出格式漂移、无缓存/重试失效。最易踩坑的 concurrency group 逐条推演确认正确(schedule 组 / ref 组隔离、不同 PR 互不取消、same-ref supersede 保留)。

6. 是否破坏缓存 — 不涉及(运行时缓存/重试/增量游标零改动;#6 setup-node cache 明确 deferred)。

7. 是否改了设计方向 — 否。只改 CI 调度策略;数据流 / wire / 压缩逻辑零改动。

8. 是否引入新配置 — 无新增 env/config/CLI flag(cron / concurrency group 是 CI 内部配置,非用户配置面),符合 Configuration Surface Discipline。

非阻塞观察(留 owner 定夺,均可后续一行处理):

  • 共享 hot-file 集(继承自既有 ci-e2e.yml 边界)未含 src/preflight.ts、src/util.ts、src/nudge-decide.ts、src/codex-compact.ts、src/win-cmd.ts 等管线文件。这是既有约定(real-codex lane 现状如此),非本 PR 新引入;风险有界(单元级每 PR 兜底 + nightly 兜底)。若想让 preflight / win-cmd 类改动即时触发对应 e2e,可各补一行 path —— 但会略增触发面、偏离已批准边界,故不代改。
  • 11 个 nightly 同时刻(16:30 UTC)齐发会在离峰造一个小型池内突发;若要更平滑可错开到 16:30–16:39。非必须。

判定:可合。 方向对、CI 全绿、required checks 不受影响、回归有界且披露完整、diff 干净(每行都服务于本 PR)。合并由人执行(系统规则禁止 agent 合并)。上面两处非阻塞项需要我顺手补上的话说一声即可。

@ranxianglei
ranxianglei merged commit bc6e327 into master Oct 10, 2026
27 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.225-master.bc6e327 (rolling master tag).

npm install -g billion-context@0.0.225-master.bc6e327  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

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.

CI 排队与执行时间优化:不降低质量的前提下大幅节省(数据+方案清单)

1 participant