Skip to content

ci(frontend): filter pushes to main, not just PRs - #209

Merged
athvin merged 2 commits into
mainfrom
ci/frontend-detect-push
Oct 20, 2026
Merged

athvin merged 2 commits into
mainfrom
ci/frontend-detect-push

Conversation

@athvin

@athvin athvin commented Oct 20, 2026

Copy link
Copy Markdown
Owner

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 detect only filtered pull_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:

success  detect changes
success  lint + types + unit
success  pnpm audit + licenses
success  semgrep (static analysis)
running  playwright functional tier     <- on a Rust-only change

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.yml always 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

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.

pull_request, schedule and workflow_dispatch are 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:

event changed →
push frontend (#206) true
push rust only (#207) false ← the saving
push all-zeroes before true (fail-safe)
push unresolvable before true (fail-safe)
pull_request frontend true
pull_request rust only false ← what makes required checks work
schedule — true
workflow_dispatch — true

Done 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

bmoore813 and others added 2 commits October 20, 2026 03:03
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]>
@athvin

athvin commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

Pushed a second commit (c5a97b2) for a related finding from the same root cause.

Adding cargo Dependabot in #187 is what started timing out fmt + clippy + docs. It opened five cargo PRs at once; each carries a different Cargo.lock, so Swatinem/rust-cache misses and the workspace compiles near-cold. Five in parallel starved the runners past the job's 30-minute timeout — on the dependabot branches and on main.

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 cancelled, which is why they read as concurrency cancels at a glance.

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 arrow 59.3.1, rand 0.10.3 and two datafusion 55.2.0 bumps all landed in the same week.

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.

@athvin
athvin merged commit 52a789e into main Oct 20, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants