Skip to content

Commit fc2aaae

Browse files
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

File tree

‎.github/workflows/ci.yml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3244,6 +3244,21 @@ jobs:
32443244
--filter='./ui/examples/*'
32453245
fi
32463246
3247+
# ui/tsconfig.vitest-setup.json resolves five @object-ui packages through
3248+
# their built declarations (its `paths` comment measures the from-source
3249+
# route at 484 errors). The step above builds them only when they are in
3250+
# its affected scope, and a pull_request whose ui scope is empty builds
3251+
# nothing, so the next step failed with TS2882/TS2307. Turbo replays
3252+
# them from the cache when the step above or main's cache already built them.
3253+
- name: Build the ui packages the vitest setup files import
3254+
run: |
3255+
pnpm exec turbo run build --concurrency=4 \
3256+
--filter=@object-ui/components \
3257+
--filter=@object-ui/fields \
3258+
--filter=@object-ui/plugin-dashboard \
3259+
--filter=@object-ui/plugin-grid \
3260+
--filter=@object-ui/i18n
3261+
32473262
- name: Type-check ui repo-root vitest setup files
32483263
run: pnpm --dir ui run type-check:vitest-setup
32493264

0 commit comments

Comments
 (0)