Commit Graph

4 Commits

Author SHA1 Message Date
leaysgur dad42879c7 chore(ci): run measurement jobs when Cargo.lock or rust-toolchain changes (#24199)
### Summary

The include-mode filter in `check-changes.js` short-circuits to "skip" when no changed files are under `crates/`, so it never reaches the cargo tree dependency check for `Cargo.lock`-only dependency updates or `rust-toolchain.toml` bumps. Conformance, Minsize, Allocations, and Linter timings are all gated on this filter.

This is how #24192 (`num-bigint` 0.4.6 → 0.5.1) landed with a stale parser allocation snapshot: the update changed BigInt-literal parsing allocation counts, the Allocations job never re-measured on main, and the mismatch surfaced on an unrelated PR (#24098). The snapshot itself is fixed in #24198.

This PR treats `Cargo.lock` and `rust-toolchain.toml` changes as affecting every crate, so measurement jobs always re-run on dependency and toolchain updates. The cost is that renovate dependency PRs now run these four jobs; dependency updates are exactly the class of change that can shift measured behavior, so that is the intended behavior. Exclude-mode and paths-only jobs are unaffected (exclude mode already runs on such changes by construction).

### Trade-off

For Conformance specifically this closes a correctness gap, not just a snapshot-staleness one: a dependency update that changes parser/transformer behavior currently skips conformance entirely.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-07-06 07:49:06 +00:00
Boshen 512ecdae67 ci: support paths-only mode in check-changes.js (#20567)
## Summary

- 4 NAPI jobs (`test-napi-oxlint`, `test-napi-oxfmt`, and their Windows
variants) pass only `--paths` without `--packages` or `--exclude`, which
hit the error fallback in `check-changes.js` and always returned `true`
— causing them to run on every PR regardless of changed files
- Add a paths-only code path that checks changed files against trigger
paths without cargo tree dependency resolution
- Estimated savings: ~145s (oxlint) + ~96s (oxfmt) on PRs; ~741s
(oxlint-windows) + ~476s (oxfmt-windows) on main

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 23:53:28 +08:00
Boshen a93de959d0 ci: skip cargo tree in change detection when no crate files changed (#20559) 2026-03-20 21:50:44 +08:00
Boshen 2af70844d4 refactor(ci): replace dorny/paths-filter with cargo tree-based change detection (#20109)
## Summary

- Replace `dorny/paths-filter` in 6 CI jobs with a unified
`check-changes.js` script that uses `cargo tree` to resolve transitive
dependencies, fixing silent CI skips when upstream crates change
- Add a reusable `check-changes` composite action to eliminate
boilerplate across jobs
- Add change detection to Miri workflow to skip expensive steps when
unrelated code changes

### Key improvements over old `dorny/paths-filter`

- **Transitive dependency tracking**: uses `cargo tree` so e.g.
`oxc_parser` changes correctly trigger minification checks
- **Task crate resolution**: uses actual task crates (`oxc_minsize`,
`oxc_track_memory_allocations`) instead of library crates, catching
dev-dependencies like `oxc_codegen` that `cargo tree -e normal` on
`oxc_minifier` alone would miss
- **Self-validation**: `.github/workflows/ci.yml` and
`.github/workflows/miri.yml` are included in trigger paths so workflow
edits exercise the affected jobs

### Modes

**Include mode** (`--packages`): resolves transitive deps via `cargo
tree`, runs if changes affect any dep crate or additional paths.

**Exclude mode** (`--exclude`): skips only if ALL changed files are in
excluded crate directories (intentionally shallow — no `cargo tree`).

### Jobs updated
`test-wasm32-wasip1-threads`, `test-napi`, `test-napi-windows`,
`minification`, `allocs`, `lintgen`, `miri`

### Jobs intentionally unchanged
`conformance` (already uses `cargo tree`), `benchmark` (already uses
`cargo tree`), `ast_changes` (uses auto-generated watch list),
`test-ubuntu` (primary gate, runs everything), `typos`/`lint` (always
run)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:45:38 +08:00