From fc072c7a5d9ca2434bedcbfb86a2f75cb124560a Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Mon, 5 Oct 2026 13:24:31 +0800 Subject: [PATCH] perf(ci): bound worker job overlap without extending the critical path --- .../process/2026-10-05-pr-artifact-typechecks.i18n.yaml | 4 ++-- .../process/2026-10-05-pr-artifact-typechecks.md | 2 +- .../process/2026-10-05-pr-artifact-typechecks.zh.md | 2 +- .github/workflows/ci.yml | 2 ++ scripts/ci-workflow.spec.ts | 9 +++++++++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.i18n.yaml b/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.i18n.yaml index d8ebf5838e..27081297cb 100644 --- a/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.i18n.yaml +++ b/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.i18n.yaml @@ -9,8 +9,8 @@ en: e5c984fa32cc5e69 zh: 25d5742b2106d830 /agent-note-pr-artifact-builds-and-aggregate-typescript-checks/decision: - en: f4ae626ef54d10e0 - zh: c2e8c30930832e12 + en: 6168548a8ff1dd62 + zh: e297d62de0bc4c40 /agent-note-pr-artifact-builds-and-aggregate-typescript-checks/alternatives-considered: en: f61da066f9ddcd62 zh: 816fd6e0063017cd diff --git a/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.md b/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.md index ea5e5b19ff..19f6767c0d 100644 --- a/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.md +++ b/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.md @@ -16,7 +16,7 @@ PR artifact builds compile every existing project reference from each compiler f CI invokes the internal build helpers directly and keeps the root package manifest unchanged. Root manifest edits activate the separate native-addon platform matrix even when only build aliases change; avoiding that trigger preserves the existing workflow set and concurrent-job ceiling without weakening native validation. -Job inventory, runner selectors, gate budgets, worker counts, and benchmark sample counts stay fixed. Coverage partitions reuse compact file-cost metadata within their platform and runner pool. Parallel release packing uses pnpm's existing bounded scheduler; serial publication keeps family order. +Job inventory, runner selectors, gate budgets, worker counts, and benchmark sample counts stay fixed. The three compatibility cases use at most two concurrent jobs; the two-target Python runtime matrix follows their completion. Before that matrix, four Linux lanes, two compatibility jobs, the Python SDK, and three Windows lanes permit at most ten worker jobs. Afterwards, the remaining eight lanes and two runtime targets keep the same ceiling. Coverage partitions reuse compact file-cost metadata within their platform and runner pool. Parallel release packing uses pnpm's existing bounded scheduler; serial publication keeps family order. ## Alternatives considered diff --git a/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.zh.md b/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.zh.md index 0342b28f4a..94dd2581c9 100644 --- a/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.zh.md +++ b/.agents/notes/implemented/process/2026-10-05-pr-artifact-typechecks.zh.md @@ -16,7 +16,7 @@ PR 产物构建通过一个串行 `tsc -b` 进程编译各 compiler face 的全 CI 直接调用内部 build helper,并保持 root package manifest 不变。即使只修改 build alias,root manifest 改动也会激活独立的 native-addon 平台矩阵;避免这一触发条件,可以在不削弱 native 验证的情况下保留现有 workflow 集合与并发 job 上限。 -job 清单、runner 选择、gate 预算、worker 数量和 benchmark sample 数量保持固定。覆盖率分区在各自的平台和 runner pool 内复用精简的文件成本元数据。并行 release 打包使用 pnpm 现有的有界调度器;串行发布保持 family 顺序。 +job 清单、runner 选择、gate 预算、worker 数量和 benchmark sample 数量保持固定。三个 compatibility case 最多并发两个 job;双目标 Python runtime 矩阵等待它们完成。该矩阵之前,四个 Linux lane、两个 compatibility job、Python SDK 和三个 Windows lane 最多占用十个 worker job。随后剩余八个 lane 加上两个 runtime target 保持相同上限。覆盖率分区在各自的平台和 runner pool 内复用精简的文件成本元数据。并行 release 打包使用 pnpm 现有的有界调度器;串行发布保持 family 顺序。 ## Alternatives considered diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da803ffe1a..4202a78ea5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -398,6 +398,7 @@ jobs: DSH_GATE_FAIL_FAST: '1' strategy: fail-fast: false + max-parallel: 2 matrix: include: - node: '22.19' @@ -498,6 +499,7 @@ jobs: # Linux ARM64 and both macOS architectures run in ci-master.yml. python-runtime: if: github.event_name == 'pull_request' + needs: node-compat name: python runtime / release-shaped matrix uses: ./.github/workflows/build-exe-for-python-sdk.yml with: diff --git a/scripts/ci-workflow.spec.ts b/scripts/ci-workflow.spec.ts index 9568057334..48de1fc116 100644 --- a/scripts/ci-workflow.spec.ts +++ b/scripts/ci-workflow.spec.ts @@ -14,6 +14,15 @@ const runnerPrivatePnpmDestination = /^\$\{\{ runner\.temp \}\}\/setup-pnpm-\$\{ const nativeWindowsPnpmDestination = '${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}' describe('CI workflow', () => { + it('bounds compatibility jobs before the two runtime targets start', () => { + const ci = loadWorkflow('.github/workflows/ci.yml') + const compatibility = workflowJob(ci, 'node-compat') + const runtime = workflowJob(ci, 'python-runtime') + expect(compatibility.strategy).toMatchObject({ 'max-parallel': 2 }) + expect(runtime.needs).toBe('node-compat') + expect(runtime.with).toMatchObject({ targets: 'node24-linux-x64,node24-win-x64' }) + }) + it('retains aggregate diagnostics in required builds and protected publication', () => { const ci = loadWorkflow('.github/workflows/ci.yml') for (const [name, command] of [