Commit e26d659
fix(ci): stop running benchmarks on docs-only and CI-config-only PRs
## Why
Bencher kept posting benchmark results on PRs that can't possibly affect
runtime performance. Two reported cases:
-
**[#3717](#3717 (comment)
— a markdown/agent-tooling PR whose only non-`.md` file was a new
`.claude/skills` symlink.
-
**[#3697](#3697 (comment)
— a CI-config-only PR (`.github/workflows/pro-integration-tests.yml` +
the detector's own test harness).
Both slipped through because the change detector
(`script/ci-changes-detector`) is the single gate feeding every test
workflow **and** the benchmark matrix.
### Root cause 1 — non-`.md` repo metadata hits the catch-all (#3717)
The extensionless `.claude/skills` symlink matched no detector category
→ fell into the `*` catch-all ("run everything for safety") →
`non_runtime_only=false` → full suite + benchmarks. Same class as #3597.
### Root cause 2 — benchmarks piggyback on the test run-flags (#3697)
`benchmark.yml` derived which suites to run from the test `run_*` flags.
Those flags are intentionally inflated by CI plumbing: the
CI-infrastructure catch-all (`script/`, `bin/`, actions) runs the full
suite, and the suite-specific workflow YAMLs map to test categories
(`pro-integration-tests.yml` → `PRO_DUMMY`, `node-renderer-tests.yml` →
`PRO_NODE_RENDERER`, …). None of that moves runtime performance, but it
all dragged in benchmarks.
## Fix
**Commit 1 — agent/editor tooling is non-runtime.** Categorize
`.claude/**`, `.agents/**`, `.cursor/**` alongside
docs/`internal/**`/issue-templates, so agent-tooling PRs are
`non_runtime_only` (no tests, no benchmarks).
**Commit 2 — decouple benchmark selection from test selection.**
- The detector tracks `BENCH_CORE` / `BENCH_PRO` /
`BENCH_PRO_NODE_RENDERER`, set **only** by genuine product-source arms
(gem/app/package/dummy code) and the uncategorized catch-all. CI
plumbing (new `CI_INFRA_CHANGED` flag) and the suite-workflow YAMLs
(`is_benchmark_irrelevant_path` guard) set no `BENCH` flag — they still
run their **tests** but never benchmarks. The targeted per-workflow test
mapping (`ci-optimization.md`) is preserved.
- The detector emits `run_core_benchmarks` / `run_pro_benchmarks` /
`run_pro_node_renderer_benchmarks`; `benchmark.yml` reads them directly
instead of re-deriving from `run_*`. The mapping mirrors the old
derivation **exactly** for every genuine-source category, so legitimate
benchmark runs are unchanged — only CI-plumbing-triggered runs are
dropped.
- `push`-to-main, `workflow_dispatch`, and the `benchmark` PR label
still run suites regardless (the label is the escape hatch for
validating `benchmark.yml`/workflow edits).
## Verification
- Replayed both PRs' exact file sets against the patched detector: #3717
→ `non_runtime_only: true`; #3697 → all three `run_*_benchmarks: false`
while tests still run.
- Confirmed legit benchmark behavior is unchanged: core source → all 3
suites; node-renderer source → pro + node-renderer; pro-ruby → pro only;
a suite-workflow-only edit → its tests but no benchmark.
- `script/ci-changes-detector-test.bash`: **43 run, 0 failed** (added
regressions for both root causes). `actionlint` clean on
`benchmark.yml`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* CI now separates benchmark gating from test-selection, treats
additional agent/editor/tooling paths as docs/non-runtime-only, treats
CI-infrastructure edits as infra-only (forcing tests but suppressing
benchmarks), and exposes per-suite benchmark run flags in CI outputs
while preventing docs-only when CI infra changes.
* **Tests**
* Added regression tests covering docs/tooling paths, CI-infra-only
edits, suite-specific gating, combined infra+runtime edits, and
node-renderer benchmark behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes central CI gating logic for all workflows and benchmarks;
behavior is heavily regression-tested but misclassification could skip
needed benchmarks or still run Bencher on non-runtime PRs.
>
> **Overview**
> Stops Bencher from running on PRs that only touch docs, agent tooling,
or CI config by tightening **what counts as non-runtime** and **when
benchmarks are selected**.
>
> **`script/ci-changes-detector`** now treats `.claude/**`,
`.agents/**`, and `.cursor/**` like docs (fixes extensionless paths such
as `.claude/skills` hitting the catch-all). CI plumbing uses a dedicated
**`CI_INFRA_CHANGED`** flag: it still forces the full **test** matrix
but does **not** set benchmark flags. Benchmark gating is decoupled from
test `run_*` flags via **`BENCH_*`** flags and new outputs
**`run_core_benchmarks`**, **`run_pro_benchmarks`**, and
**`run_pro_node_renderer_benchmarks`**; workflow YAML under
`.github/workflows/*` is excluded from benchmark relevance via
**`is_benchmark_irrelevant_path`**.
>
> **`.github/workflows/benchmark.yml`** drops inline benchmark
derivation and reads those detector outputs directly.
**`ci-commands.yml`** aligns the docs-only heuristic with the same
agent/editor paths.
>
> Regression coverage in **`script/ci-changes-detector-test.bash`**
covers agent tooling, CI-only vs workflow-only edits, mixed CI + source,
and node-renderer benchmarks.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
92ba2bd. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## Codex Decision Log
- Full-matrix validation: accepted CodeRabbit's current-head nit and
added the existing `full-ci` label so detector/benchmark-gating changes
receive full CI coverage before merge.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ccc7609 commit e26d659
4 files changed
Lines changed: 267 additions & 46 deletions
File tree
- .github/workflows
- script
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 113 | + | |
| 114 | + | |
144 | 115 | | |
145 | 116 | | |
146 | 117 | | |
| |||
157 | 128 | | |
158 | 129 | | |
159 | 130 | | |
160 | | - | |
161 | | - | |
162 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
163 | 134 | | |
164 | 135 | | |
165 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
| |||
243 | 254 | | |
244 | 255 | | |
245 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
246 | 269 | | |
247 | 270 | | |
248 | 271 | | |
| |||
260 | 283 | | |
261 | 284 | | |
262 | 285 | | |
263 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
264 | 292 | | |
265 | 293 | | |
266 | 294 | | |
| |||
271 | 299 | | |
272 | 300 | | |
273 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
274 | 307 | | |
275 | 308 | | |
276 | 309 | | |
| |||
281 | 314 | | |
282 | 315 | | |
283 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
284 | 322 | | |
285 | 323 | | |
286 | 324 | | |
| |||
291 | 329 | | |
292 | 330 | | |
293 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
294 | 339 | | |
295 | 340 | | |
296 | 341 | | |
| |||
314 | 359 | | |
315 | 360 | | |
316 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
317 | 367 | | |
318 | 368 | | |
319 | 369 | | |
| |||
324 | 374 | | |
325 | 375 | | |
326 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
327 | 383 | | |
328 | 384 | | |
329 | 385 | | |
| |||
334 | 390 | | |
335 | 391 | | |
336 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
337 | 396 | | |
338 | 397 | | |
339 | 398 | | |
| |||
344 | 403 | | |
345 | 404 | | |
346 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
347 | 409 | | |
348 | 410 | | |
349 | 411 | | |
| |||
354 | 416 | | |
355 | 417 | | |
356 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
357 | 423 | | |
358 | 424 | | |
359 | 425 | | |
| |||
364 | 430 | | |
365 | 431 | | |
366 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
367 | 439 | | |
368 | 440 | | |
369 | 441 | | |
| |||
374 | 446 | | |
375 | 447 | | |
376 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
377 | 455 | | |
378 | 456 | | |
379 | 457 | | |
| |||
389 | 467 | | |
390 | 468 | | |
391 | 469 | | |
392 | | - | |
393 | | - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
394 | 480 | | |
395 | 481 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 482 | + | |
404 | 483 | | |
405 | 484 | | |
406 | 485 | | |
| |||
409 | 488 | | |
410 | 489 | | |
411 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
412 | 496 | | |
413 | 497 | | |
414 | 498 | | |
| |||
430 | 514 | | |
431 | 515 | | |
432 | 516 | | |
| 517 | + | |
433 | 518 | | |
434 | 519 | | |
435 | 520 | | |
| |||
456 | 541 | | |
457 | 542 | | |
458 | 543 | | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
459 | 547 | | |
460 | 548 | | |
461 | 549 | | |
| |||
507 | 595 | | |
508 | 596 | | |
509 | 597 | | |
| 598 | + | |
510 | 599 | | |
511 | 600 | | |
512 | 601 | | |
| |||
584 | 673 | | |
585 | 674 | | |
586 | 675 | | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
587 | 694 | | |
588 | 695 | | |
589 | 696 | | |
| |||
598 | 705 | | |
599 | 706 | | |
600 | 707 | | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
601 | 718 | | |
602 | 719 | | |
603 | 720 | | |
| |||
608 | 725 | | |
609 | 726 | | |
610 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
611 | 731 | | |
612 | 732 | | |
613 | 733 | | |
| |||
624 | 744 | | |
625 | 745 | | |
626 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
627 | 750 | | |
628 | 751 | | |
629 | 752 | | |
| |||
644 | 767 | | |
645 | 768 | | |
646 | 769 | | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
647 | 773 | | |
648 | 774 | | |
649 | 775 | | |
| |||
0 commit comments