ci: a rebase ran every path-filtered workflow, because paths: matches the push delta #191
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/pr-diff-path-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Forgejo matches a workflow's
paths:filter against the push delta, not thepull request's diff. A rebase moves a branch across every commit main has
gained, so its delta touches nearly every path — and every path-filtered
workflow in the repo fires.
Measured, as a clean natural experiment
Five PRs open right now, all changing only
jcp/ormesh/:Those fifteen include JPEG-AI whole decode,
wai-packon three platforms, andcross-architecture byte-equality on three — none of which a change to
jcp/jcp-rs/crates/jcp-grant/src/checkpoint.rscan affect.Rebasing three PRs put the queue 65 runs deep behind one macOS runner, which
delays everyone's real jobs. And there is no way to rebase without it: merging
main into the branch has the same delta.
The fix
The
paths:filters still gate the trigger. A newrelevantjob gates thework, decided from the pull request's own diff.
It reads the path list out of the workflow file it guards, so there is one
list rather than a third copy to drift from the two
on:blocks. On a push tomain there is no pull-request context, the shas are empty, and the gate answers
true— main runs everything, as before.It fails open, by construction
A gate that decides whether tests run is load-bearing in the dangerous
direction: a wrong
falsesilently skips a whole workflow — the "passes buttested nothing" failure. Every way the script can fail to decide prints
true:The self-test pins all six, both directions of the real decision, and that
**spans a path separator while
*does not.Writing that self-test caught one of its own cases. The single-star case
first created a top-level
.mdalongside the nested one, so the glob matchedlegitimately and the case proved nothing. It now changes only the nested file,
and asserts separately that the glob does match at its own level — so it
cannot pass by never matching anything.
Scoped to one workflow on purpose
Applied to
wai-pack.ymlalone, not all eighteen.The open question is what a skipped job reports as a commit status on this
forge. A required context that never reports would make PRs unmergeable. That
failure is at least loud rather than silent, but it is worth learning on the
most expensive workflow — six job instances across three platforms — before
changing the rest. If skipped jobs report cleanly, rolling out to the other
seventeen is mechanical.
Validated against real branches before touching any workflow: every WAI workflow
answers
falsefor #165's jcp-only diff andtruefor a WAI branch, andstandards-build.ymlcorrectly answerstruefor #165 because it builds everyworkspace.
conformance.ymlanswersfalse— correctly, it is smart-byte'sgate.
The hygiene workflow runs the self-test, so the gate cannot regress silently,
and its own
paths:filter now lists the scripts it checks.🤖 Generated with Claude Code
paths:matches the push delta