Repository navigation
Commit 487056b
ci(ui-merge): queue builds decide the four ui lanes from the merged diff against merge_group.base_sha (#25881)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoMenwthdt1JYWvY79ZDjVL8)_
Fixes #25867
Part of #25677 (post-cutover CI speed, item 1).
Clause-②: no
Metadata-protocol: none
## What changed
`ci.yml` `filter` job, nothing else in the workflow:
- The `dorny/paths-filter` step's allow-list gains `merge_group`. At the
pinned v4.0.3 (`ceb8a2b8`) the action resolves that event itself:
`src/main.ts` takes `merge_group.base_sha` / `merge_group.head_sha` from
the payload when `base` / `ref` are unset, and `src/git.ts` fetches the
base sha at depth 1 and diffs the two trees (`base..head`). So the queue
build reads the same filter block, with the same globs, as the
`pull_request` run. There is no second copy of the globs to keep in
step.
- On `merge_group` the step is `continue-on-error`, so a base that
cannot be fetched leaves the outputs empty, `|| 'true'` fills them in
and every ui lane runs (fail-open). On `pull_request` / `push` a failure
stays red, as before.
- `docs`, `core` and `crosspkg` ignore the step on `merge_group`: they
are spelled `github.event_name != 'merge_group' &&
steps.changes.outputs.X || 'true'`, so Build Core, Build Docs and Test
Core keep running on every queue entry exactly as today. Only `ui` and
`ui_consumers` read the queue diff.
- `schedule` / `workflow_dispatch` still skip the step and widen
everything to `'true'` (full battery, ruling Q6-b). `push` is unchanged.
The four ui lanes' `if:` lines are untouched.
`scripts/pm/check-expected-skips.mjs`: the header and the four ui roster
reasons now say that a queue build skips the ui lanes when the merged
diff touches no ui path, rather than "every output widens to 'true' on
merge_group". `scripts/pm/dispatch-gates.self-test.mjs`: the
marker-census row for that file moves 133 to 137 (the header grew four
lines).
Resulting outputs per event (step value, then output):
| event | step `ui` | `ui` | step `core` | `core` |
|---|---|---|---|---|
| pull_request / push | from the diff | as the step said | from the diff
| as the step said |
| merge_group | from base_sha..head_sha | as the step said | ignored |
`'true'` |
| merge_group, step failed | empty | `'true'` | ignored | `'true'` |
| schedule / workflow_dispatch | step skipped | `'true'` | step skipped
| `'true'` |
## Verification
Replayed the pinned action's `dist/index.js` locally with a synthetic
`merge_group` event payload (`GITHUB_EVENT_NAME=merge_group`, `base_sha`
/ `head_sha` set, `INPUT_FILTERS` = the filter block read out of this
branch's `ci.yml`):
| entry | base..head | `ui` | `ui_consumers` | ui lanes |
|---|---|---|---|---|
| `.claude/` + `scripts/` only (abebc4e) | 17f8217..abebc4e | false |
false | all four skip |
| spec + lint (b00fc55) | abebc4e..b00fc55 | false | true | Type
Check UI and Build & E2E UI run; Test UI and Lint UI skip |
| `ui/` scripts (1210544) | 3fca599..1210544 | true | false | all
four run |
| three-commit group, ui + scripts | 3fca599..c475b45 | true | false |
all four run |
| depth-1 checkout, base absent locally | 1210544..5aa9fcb | true |
false | the action fetched the base by sha at depth 1, then diffed |
| unfetchable base | 000…001..c475b45 | (none) | (none) | action exits
1 with no outputs; with continue-on-error the `'true'` fallback runs all
four |
This PR's own queue entry changes `ci.yml`, which is in the `ui` filter,
so it runs all four ui lanes. The first non-ui entry after it lands is
the live evidence the card asks for (four ui lanes `skipped`, `Lint UI`
and `Build & E2E UI` reported as skipped, which a required check
accepts). It will be posted on #25867.
Local gates at head `be2cff5e`: `node scripts/pm/dispatch-gates.mjs
--commands` derives 67 commands; all 67 exit 0, and `--ran` reconciles
67 derived, 67 run, 0 NOT-MEASURED (a derived zero: every row carries
its exit code). That includes `check:pm-dispatch-gates` (fast tier, 1917
cases) and the four `dist/`-reading Build Core guards, which ran after
that battery's build. The gates the card names: `check-ci-filter-parity`
(scan and `--self-test`), `check:pm-expected-skips`,
`check-step-collectors` (scan and `--self-test`) all exit 0. The only
failure on the way was the `dispatch-gates` marker census pinning
`check-expected-skips.mjs:133`, fixed in the second commit.
## Acceptance notes
- Route differs from the card's wording: the card says `git diff
--name-only` with the same globs. Running the action itself on the event
gives the same globs by construction and keeps
`check-ci-filter-parity`'s one-step rule intact.
- `docs` / `core` / `crosspkg` could read the queue diff the same way
(Build Core and Build Docs would then skip on queue entries outside
their paths). Not done here: the card scopes the ui outputs only, and
the filter comment's "the queue build is the last validation before
main" reasoning still governs those jobs. Carrier: none.
## 维护者速读(草稿)
**改了什么:** 合并队列里,ui 的四个作业(Test UI、Type Check UI、Build & E2E UI、Lint
UI)改成按"这批改动相对队列基点到底动没动 ui"来决定跑不跑。判定用的是 PR 上同一套路径规则。core、docs
那几个作业在队列里照旧全跑。
**为什么改:** 合并 ui 之后,每个排队条目都会把四个 ui 作业跑一遍,哪怕只改了文档或脚本。小条目从 4–10 分钟变成 16–18
分钟,每条多花约 220 runner-min。
**风险与代价(含回滚):** 判定失败(比如取不到基点)时按"全跑"处理,不会因此漏跑。动了 ui 或那七个被 ui 使用的包,队列里照样会跑
ui 作业。回滚只需 revert 这一个 PR。
**席位意见:**
**你要做的:** 这个 PR 改了 `.github/workflows/ci.yml`,属于 Tier
H,需要你批准后由席位落地。落地后第一个非 ui 条目进队时,席位会在 #25867 贴出前后耗时对比。
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Suqt7vsGh5kE2NhDZyqeh6)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 744900d commit 487056b
3 files changed
Lines changed: 70 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
149 | 155 | | |
150 | 156 | | |
151 | | - | |
| 157 | + | |
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| |||
158 | 164 | | |
159 | 165 | | |
160 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
161 | 175 | | |
162 | 176 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
168 | 182 | | |
169 | 183 | | |
170 | 184 | | |
| |||
216 | 230 | | |
217 | 231 | | |
218 | 232 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
226 | 242 | | |
227 | 243 | | |
228 | 244 | | |
| |||
231 | 247 | | |
232 | 248 | | |
233 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
234 | 256 | | |
235 | 257 | | |
236 | | - | |
| 258 | + | |
| 259 | + | |
237 | 260 | | |
238 | 261 | | |
239 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
| |||
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
187 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
216 | 222 | | |
217 | 223 | | |
218 | 224 | | |
| 225 | + | |
| 226 | + | |
219 | 227 | | |
220 | 228 | | |
221 | 229 | | |
| |||
335 | 343 | | |
336 | 344 | | |
337 | 345 | | |
338 | | - | |
| 346 | + | |
339 | 347 | | |
340 | 348 | | |
341 | 349 | | |
342 | 350 | | |
343 | 351 | | |
344 | 352 | | |
345 | | - | |
| 353 | + | |
346 | 354 | | |
347 | 355 | | |
348 | 356 | | |
349 | 357 | | |
350 | 358 | | |
351 | 359 | | |
352 | | - | |
| 360 | + | |
353 | 361 | | |
354 | 362 | | |
355 | 363 | | |
356 | 364 | | |
357 | 365 | | |
358 | 366 | | |
359 | | - | |
| 367 | + | |
360 | 368 | | |
361 | 369 | | |
362 | 370 | | |
| |||
373 | 381 | | |
374 | 382 | | |
375 | 383 | | |
376 | | - | |
377 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
378 | 387 | | |
379 | 388 | | |
380 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7502 | 7502 | | |
7503 | 7503 | | |
7504 | 7504 | | |
7505 | | - | |
| 7505 | + | |
| 7506 | + | |
7506 | 7507 | | |
7507 | 7508 | | |
7508 | 7509 | | |
| |||
0 commit comments