Repository navigation
ci(frontend): filter pushes to main, not just PRs - #209
Conversation
Dropping the `paths:` filter was necessary to make the frontend jobs required status checks — a workflow a path filter skips never reports, so a required check sits pending forever. But `detect` only filtered `pull_request`, so every push to main ran the whole gate, and the first Rust-only merge after #206 duly spent ~5 minutes in the Playwright container to re-test a tree it had already tested: a squash commit and the PR head it came from are near-identical, and that PR ran this exact gate to green minutes earlier. rust.yml always runs on main for a good reason — it IS the gate protecting that branch, so it must never self-skip there. That reasoning does not transfer to this workflow, which was copied from it. `push` now diffs `event.before...event.after` through the same `^frontend/` filter the PR case uses. It fails SAFE: an all-zeroes `before` (a branch's first push) or one git cannot resolve (after a force-push) runs the gate rather than skipping it — a wasted run beats a silent one. Nightly and manual runs are unchanged, and so is the `pull_request` path, so required checks keep behaving exactly as verified. All eight event paths were exercised against real commits before pushing — #206 as a frontend-touching merge, #207 as a Rust-only one — covering push/PR × touching/not-touching plus the two degenerate `before` values and schedule/dispatch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Adding the cargo ecosystem in #187 closed a real gap — the repo's own security notes flagged that nothing bumped Rust advisories — but it opened five PRs at once, and that turned out to matter. Each cargo PR carries a different Cargo.lock, so Swatinem/rust-cache (keyed on the lockfile) misses and the workspace compiles near-cold. Five of those in parallel starved the runners enough to push `fmt + clippy + docs` past its 30-minute timeout — on the dependabot branches and on main. The job takes ~16 minutes uncontended; #206 took 28m39s under this load, so the timeout was already marginal and the burst tipped it over. The grouping config batches minor/patch into one PR, but majors are deliberately separate — a major is a migration to schedule, not a bump to merge on green — so a week with several major releases is exactly when this happens. arrow 59.3.1, rand 0.10.3 and two datafusion 55.2.0 bumps all landed together. Capping at 2 fixes the cause rather than the symptom; Dependabot queues the rest and opens them as these merge, so no update is lost. npm stays at 5, since those PRs do not compile Rust. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Pushed a second commit ( Adding cargo Dependabot in #187 is what started timing out The job takes ~16 min uncontended; #206 took 28m39s under this load, so the timeout was already marginal and the burst tipped it. Timeouts surface as The grouping config batches minor/patch into one PR but deliberately splits majors — a major is a migration to schedule, not a bump to merge on green — and Capped cargo at 2 open PRs. That addresses the cause rather than raising the timeout to accommodate cache thrash; Dependabot queues the rest and opens them as these merge, so nothing is lost. npm stays at 5 — those PRs don't compile Rust. |
Follow-up to #187/#206 — a cost I introduced and should not have left.
The problem
Dropping the
paths:filter was necessary to make the frontend jobs required status checks: a workflow a path filter skips never reports, so a required check sits pending forever on a backend-only PR.But
detectonly filteredpull_request. So every push to main ran the whole gate — and the first Rust-only merge after #206 (#207, "reclaim runner disk") duly spent ~5 minutes in the Playwright container:It was re-testing a tree it had already tested. A squash commit and the PR head it came from are near-identical, and that PR ran this exact gate to green minutes earlier.
rust.ymlalways runs on main for a good reason — it is the gate protecting that branch, so it must never self-skip there. I copied the pattern without noticing the reasoning doesn't transfer to a workflow whose main run is purely a repeat.The change
pushnow diffsevent.before...event.afterthrough the same^frontend/filter the PR case uses.It fails safe. An all-zeroes
before(a branch's first push) or one git cannot resolve (after a force-push) runs the gate rather than skipping it — a wasted run beats a silent one.pull_request,scheduleandworkflow_dispatchare untouched, so required checks behave exactly as verified in #187.Verification
All eight event paths exercised against real commits before pushing — #206 as a frontend-touching merge, #207 as a Rust-only one:
pushtruepushfalse← the savingpushbeforetrue(fail-safe)pushbeforetrue(fail-safe)pull_requesttruepull_requestfalse← what makes required checks workscheduletrueworkflow_dispatchtrueDone by extracting the
run:block from the YAML and executing it with each event's env, rather than by reading it and reasoning — same discipline as the rest of this program (docs/frontend-testing.md§"Proving a gate works").Note this PR touches
.github/workflows/frontend.yml, which the filter itself matches — so the frontend gate runs on it, which is the behaviour you want when editing the gate.🤖 Generated with Claude Code