Repository navigation
Commit fd3dc6e
ci: schedule the ui jobs, Build Docs and Test Core for the root inputs they read (package.json, five ui test inputs) (#28089)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoQw2SaxD3ZKQgJ2Det3rETu)_
Fixes #27717
Fixes #27961
Clause-②: no
Metadata-protocol: none
Tier H: the diff touches `.github/workflows/ci.yml` and
`.github/workflows/lint.yml`. The maintainer approves in this PR.
## 维护者速读
- **改了什么:** 根 `package.json` 进入 `ci.yml` 的 `ui:` 和 `docs:` 过滤列表;五个 ui
测试输入进入 `core:`;`check-ci-filter-parity` 增加第四个对账主题(通用 `test`
任务的根输入);`lint.yml` 一个步骤的名称、注释和结尾文字不再写死成员个数。
- **为什么改:** 只升级 pnpm 版本(`packageManager` 字段)的 PR 现在一个 UI 任务、Build Docs
都不跑;改 `ui/vitest.config.mts` 这类文件的 PR 不跑 Test Core。两种情况都要等到合并队列才第一次运行。
- **风险与回滚:** 只多调度、不少调度。30 天回放:UI 任务多 11/3683 次,Build Docs 多 18/3683
次,Test Core 多 2/3683 次。回滚 = revert 本 PR。
- **先看:** ① `.github/workflows/ci.yml` 的 `ui:` / `docs:` / `core:`
三处新增行;② `scripts/check-ci-filter-parity.mjs` 的 `judgeTestInputs` 和
`judgeBuildInputs` 里 `reasons` 那一行;③ `.github/workflows/lint.yml` 的
shared-module self-tests 步骤。
- **两分钟验证:** `node scripts/check-ci-filter-parity.mjs --self-test &&
node scripts/check-ci-filter-parity.mjs`,预期 138 条断言通过,三个 OK 行,其中一行是 "all
8 root input(s) of `test` / `test:repo`"。
- **需要你做的:** 在本 PR 上批准(Tier H)。
## What changes
**#27717: the root manifest schedules every job that reads its
`packageManager` field.** `.github/actions/setup-pnpm/action.yml` reads
`$GITHUB_WORKSPACE/package.json`'s `packageManager` to pick the pnpm it
materialises. Measured which `ci.yml` jobs run it, at `origin/main`
`2e955dde`:
| filter list | jobs that run setup-pnpm | `package.json` row before |
|:--|:--|:--|
| `core` | every core job, through `setup-workspace` | yes |
| `ui` | `ui-deps`, `type-check-ui`, `test-ui`, `lint-ui`,
`build-e2e-ui`, `live-e2e-ui` (directly) | no |
| `docs` | `build-docs`, through `setup-workspace` | no |
`ui` is the narrowest list that starts all six ui jobs (`ui_consumers`
starts four of them and is held to the seven packages objectui
installs), so the row goes there. **Declared increment, approved by the
dispatching seat:** the same row joins `docs:`, because Build Docs has
the same hole, in the same file, the same gate family and the shape
#27673 used for `.nvmrc` and the setup actions. No other list changes.
The parity gate header named setup-pnpm as "today's one" local composite
action the guard recognizer does not follow, and said every job in every
workflow runs it. Build Core's step `uses:` setup-workspace (which calls
setup-pnpm), and 18 of 30 workflows use either action. The bound now
names setup-workspace, states that neither action's `run:` steps name a
repository script (what the self-test's bound-2 case already pins
against the real job), and says the files they read are `core:` rows of
their own.
**#27961: Test Core starts on a diff confined to a generic test input.**
turbo.json's generic `test` task has eight `$TURBO_ROOT$` inputs. Three
were already covered (`vitest.preset.mts` by hand,
`ui/scripts/vite-*.ts` and `ui/scripts/vitest-invocation-guard.mjs` by
the #27283 build rows). The five below matched no list Test Core's `if:`
reads, and now sit in `core:` beside the six ui build rows:
- `ui/vitest.config.mts`
- `ui/vitest.setup.*`
- `ui/scripts/test-shard-*`
- `ui/apps/console/vitest.config.ts`
- `ui/apps/console/vite.config.ts`
The `ci.yml` authorisation precedent is ruling 6513291766 on #27283
(letter A, maintainer 「其他同意」), which this card inherits per triage
6516081082 ("Item 1 is the same shape as ruling `6513291766` (the six
`build` inputs), one task over. It adds no gate"):
> **What the ruling binds (letter A):** the six ui-root build inputs
that PR #27571 adds to the root `turbo.json` [...] also enter
`.github/workflows/ci.yml`'s `core:` path filter, in the same PR, so a
diff confined to one of them schedules Build Core and Test Core on the
PR instead of first in the merge queue, and `check-ci-filter-parity` is
green by parity, not by blindness.
**The fourth parity subject, and why it is required rather than
optional.** With the five rows added and the gate unchanged,
`check:ci-filter-parity` went RED: the third subject's leftover rule
reported `ui/vitest.config.mts` as a leftover `core:` row. That rule
judges a literal row in any directory holding a literal build input,
`ui/` holds `ui/tsconfig.json`, and no reason it knew covered the new
row. (`ui/vitest.setup.*` and `ui/scripts/test-shard-*` carry wildcards
and are not judged; `ui/apps/console/` holds no build input.) So the
gate now:
- derives the root inputs of turbo.json's generic `test` and `test:repo`
tasks (the pair Test Core's `turbo run test test:repo` names, pinned
against the real job) and judges them with the existing pure-string rule
against `core` + `crosspkg`, read back out of the `test` job's `if:`
exactly as the first subject reads them. Remedy: a `core:` row, never
`crosspkg:`, which the first subject holds to the cross-package
declarations;
- counts those inputs as reasons for the third subject's leftover rule,
so a `core:` row kept for a test input is no leftover.
This strengthens an existing gate; no new gate, no new CI step.
Per-package `#test` inputs stay the first subject's population
(measured: with this diff, every `$TURBO_ROOT$` input of every `test` /
`test:repo` task in turbo.json is covered by `core` + `crosspkg`, 0
uncovered).
**#27961 item 2: `lint.yml`'s shared-module self-test step.** It runs
five self-tests since #27571 added `ui/scripts/invoked-as.mjs
--self-test`, but its name listed four modules, its comment said "The
four modules" and its last line printed "all four ran and passed". The
name now lists the members (`parse · entry predicate, root and ui ·
comment mask · prerequisite frame`), the comment explains why the ui
twin is there and pins no count, and the last line reads "every one ran
and passed". The comment's "~0.6 s combined" for the in-process
self-tests is re-measured at ~0.9 s for the four of them (four node
starts, this container). Nothing reads the step name or the message
(`git grep` outside `lint.yml`: no hits); the step `id` is unchanged.
## Tests
`scripts/check-ci-filter-parity.mjs --self-test` gains battery (11), 18
cases, and the roster floor goes 9 → 10 batteries: a `test` and a
`test:repo` root input each reported by path and task; an input covered
only by `crosspkg` covered; package-task and negated inputs left out;
five refusals (turbo.json unreadable, not JSON, no `tasks`, no generic
`test` task, the `test` job's `if:` dropping `crosspkg`); the leftover
rule keeping and then losing a `core:` row as its test input appears and
disappears; the real tree clean; the real `ci.yml` with the five rows
dropped reporting exactly those five, through `main()` too; and the task
pair pinned to the real `test` job. Total 120 → 138 assertions, all
passing.
## Acceptance notes
- What Test Core runs on such a diff is the existing shard plan's answer
(`turbo ls --affected` unioned with declarations); this PR only makes
the job start. Not measured here.
- Scheduling price, replayed through picomatch 4.0.7 over the 3683
first-parent commits of `main` in the 30 days to `2e955dde`, current
filters against current filters plus these rows: `ui` 690 → 701, `docs`
1037 → 1055, `core` 2758 → 2760, Test Core (`core` or `crosspkg`) 3255 →
3257.
## Verification
All readings on head `115b9df6f` (`objectstack-ai/objectstack`), merge
base `2e955dde6`.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 66 commands over 3 paths. Each was run with
stdin from `/dev/null` and its exit code recorded before any pipe: **66
exit 0**. `check:type-check-debt` first hit my 280 s per-command cap
(exit 124) and was re-run uncapped: exit 0. The four dist-reading Build
Core guards (`check:dts-closure`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure`, `check:sourcemap-no-sources-content`) ran
after the type-check-debt closure build and each swept real `dist/`
(e.g. "76 built package(s) swept - 235/235 declared declaration file(s)
present").
- `dispatch-gates --ran`: "66 derived famil(ies) accounted for — 66 run,
0 NOT-MEASURED (a DERIVED zero — all 66 recorded an exit code and none
of them is 3)".
- In that set: `check:ci-filter-parity` (self-test 138 assertions, three
OK lines), `check:pm-expected-skips`, `check:required-contexts`,
`check:workflow-status-functions`, `check:self-test-wired`,
`check:step-collectors`, `check:node-version`, `check:pnpm-acquisition`,
`check:pm-dispatch-gates`: all exit 0.
- Red before green, on a scratch copy of this head with only the five
#27961 rows removed from `ci.yml`: `check-ci-filter-parity` exit 1, "5
root input(s) of `test` / `test:repo` in turbo.json are covered by
NEITHER `core` nor `crosspkg`", naming exactly the five. With the five
rows and the gate as it was on `main`: exit 1, "`ui/vitest.config.mts`"
reported as a leftover `core:` row (the reason the fourth subject is
required).
- `eslint --no-inline-config scripts/check-ci-filter-parity.mjs`: exit
0.
- No package source changed, so no package build or test is owed; no
changeset (`skip-changeset`: `.github/workflows/**` and a root
`scripts/` gate publish nothing).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibxnVpxAbqTXMwJU6LM)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 48c7780 commit fd3dc6e
3 files changed
Lines changed: 280 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
283 | 288 | | |
284 | 289 | | |
285 | 290 | | |
| |||
361 | 366 | | |
362 | 367 | | |
363 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
364 | 382 | | |
365 | 383 | | |
366 | 384 | | |
| |||
533 | 551 | | |
534 | 552 | | |
535 | 553 | | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
536 | 559 | | |
537 | 560 | | |
538 | 561 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
793 | | - | |
794 | | - | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
795 | 800 | | |
796 | 801 | | |
797 | 802 | | |
798 | 803 | | |
799 | 804 | | |
800 | 805 | | |
801 | 806 | | |
802 | | - | |
| 807 | + | |
803 | 808 | | |
804 | 809 | | |
805 | 810 | | |
806 | 811 | | |
807 | 812 | | |
808 | 813 | | |
809 | | - | |
810 | | - | |
811 | | - | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
812 | 819 | | |
813 | 820 | | |
814 | 821 | | |
815 | 822 | | |
816 | 823 | | |
817 | 824 | | |
818 | | - | |
| 825 | + | |
819 | 826 | | |
820 | | - | |
| 827 | + | |
821 | 828 | | |
822 | 829 | | |
823 | 830 | | |
| |||
850 | 857 | | |
851 | 858 | | |
852 | 859 | | |
853 | | - | |
| 860 | + | |
854 | 861 | | |
855 | 862 | | |
856 | 863 | | |
| |||
0 commit comments