Repository navigation
Commit fc2aaae
ci(ui-merge): Type Check UI builds the five vitest-setup packages before that step, so an empty ui scope no longer reds it (#25856)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoUqBFG9nWD6Kb5AeR2Y5SNR)_
Fixes #25855
Part of #25677 (cutover aftercare, bill item 49).
Clause-②: no
Metadata-protocol: none
## What was red
`Type Check UI` on PR B #25827 head `f973a4f3fd` (run 40245604632, job
121326496328): the step "Run type-check over the ui packages" took 0 s —
its `turbo run type-check --filter=...[base]` affected scope was empty,
so no task ran and nothing under `ui/packages/*/dist` was built. The
next step, `pnpm --dir ui run type-check:vitest-setup`, then failed:
`ui/tsconfig.vitest-setup.json` maps `@object-ui/components`,
`@object-ui/fields`, `@object-ui/plugin-dashboard`,
`@object-ui/plugin-grid` to their package directories and
`@object-ui/i18n/*` to `packages/i18n/dist/*`, and all of them resolve
through built declarations.
The same job is green on a diff that changes ui packages (#25852 head
`6015709368`, run 40248884869), because there the type-check step's
`^build` built them first. The red follows the diff, not the tree.
## The fix
One step in `ci.yml` `type-check-ui`, directly before the vitest-setup
step:
```
- name: Build the ui packages the vitest setup files import
run: |
pnpm exec turbo run build --concurrency=4 \
--filter=@object-ui/components --filter=@object-ui/fields \
--filter=@object-ui/plugin-dashboard --filter=@object-ui/plugin-grid \
--filter=@object-ui/i18n
```
Turbo's `build` task `dependsOn: ["^build"]`, so their dependencies
build too. The step is unconditional. When the type-check step (or
`main`'s turbo cache, which the job already restores) has built these
packages, turbo replays them from cache.
The job's `if:` is unchanged, and no step is skipped.
**Why not resolve from source instead.** The card asked for both routes
to be measured. `ui/tsconfig.vitest-setup.json`'s own `paths` comment
already records the measurement: mapping the four packages to `src/`
gives 484 errors across 318 foreign source files, and mirroring the full
42-entry alias map still leaves 30 errors, 24 of them `noImplicitAny`
residue inside `packages/components/src`. Fixing that route would mean
turning `noImplicitAny` off for the four files this program exists to
check. So the build route is the only one that can be green, and it
costs no wall-clock on a cache hit.
## Cost
Durations of the `Type Check UI` job, before this change:
| run | shape | job | type-check step | vitest-setup step |
|---|---|---|---|---|
| 40245604632 (PR B) | empty ui scope | 7m22s, red | 0 s | 2 s, red |
| 40248884869 (#25852) | ui scripts changed | 12m20s, green | 7m43s | 4
s |
| 40247794069 (main push 90a34e2) | full scope, cache hit | 3m30s,
green | 1 s | 5 s |
After this change: this PR's own run (an empty ui scope by construction)
gives the number. It goes into the os-dev report on #25855 once the run
completes.
## Verification
- Proof run: this PR. It changes no `ui/` package, so `Type Check UI`
green here is the fix.
- Local derived gates (`node scripts/pm/dispatch-gates.mjs --commands`,
56 commands): results are in the os-dev report on #25855.
## 维护者速读(草稿)
- **改了什么**:`ci.yml` 的 `Type Check UI` 任务里,在 vitest setup 类型检查之前加了一步,用
turbo 构建它依赖的五个 `@object-ui` 包。
- **为什么改**:PR 如果没改 `ui/` 包,上一步什么都不构建,这一步就会因为找不到这五个包的类型声明而变红。这个红跟 PR
内容无关,所以 `Type Check UI` 一直没法加进必需检查。
- **风险与代价(含回滚)**:有缓存时这一步只是回放,几乎不花时间。没缓存时要多构建五个包和它们的依赖。回滚就是删掉这一步。
- **席位意见**:
- **你要做的**:批准这个 PR。合并后,在仓库设置里把 `Type Check UI` 加进必需检查。
---
_Generated by [Claude
Code](https://claude.ai/code/session_01DoFgrZuLrgVbaH4Z7Fb3Mu)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent b9063ce commit fc2aaae
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3244 | 3244 | | |
3245 | 3245 | | |
3246 | 3246 | | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
3247 | 3262 | | |
3248 | 3263 | | |
3249 | 3264 | | |
| |||
0 commit comments