ci: path-gate single-surface jobs on changed files - #1560
Closed
RohanK6 wants to merge 1 commit into
Closed
Conversation
RohanK6
force-pushed
the
feat/path-gated-ci
branch
2 times, most recently
from
August 5, 2026 11:47
15d21d5 to
4b0ea47
Compare
Every PR currently runs the full ~20-job matrix regardless of what it touches -- a frontend-only diff runs 8 backend test shards, and a backend-only diff runs the frontend suite, Electron tests, and the Playwright E2E. Each fork-PR push also costs a maintainer approval click that buys one mostly-irrelevant run. Add a cheap first-stage 'changes' job (dorny/paths-filter, SHA-pinned per repo convention) computing backend/frontend/meta flags, and gate only the clearly single-surface jobs on them: backend lint + all backend test shards (Linux/Windows/sandbox) run when backend or meta paths changed; frontend lint/tests, Electron shell tests, and the stub-ACP E2E run when frontend or meta paths changed. Workflow, script, and dependency-manifest changes set 'meta' and run everything. Cross-cutting gates (SAST-adjacent lints, brand/scrub/docs/cfn, macOS gateway tests) stay unconditional. Coverage Gate keeps its fail-closed spirit: path-skipped upstreams pass only when the corresponding flag is false AND the changes job itself succeeded; dependency-failure skips, cancellations, and a failed path-filter job all still fail the gate. Closes kirodotdev#1556
RohanK6
force-pushed
the
feat/path-gated-ci
branch
from
August 5, 2026 12:07
4b0ea47 to
5f27d2f
Compare
Collaborator
|
Thanks for this, @RohanK6 — the path-gating design is clean (single decision point, meta-forces-full, symmetric fail-closed Coverage Gate) and we want it. Fork PRs can't reach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A first-stage
changesjob computes one decision output per surface —run_backend/run_frontend— and the clearly single-surface jobs gate on that single flag. Path policy lives in exactly one place (thedecidestep); no other job re-derives it.run_backendrun_backendrun_backendrun_frontendrun_frontendA surface runs when its own paths changed, when meta paths changed (
.github/**,scripts/**— when in doubt, run everything), or when the PR carries theci-full-runlabel (escape hatch to force the complete matrix).Always-on (cross-cutting or too cheap to gate): De-Amazon Scrub Lint, Brand Name Gate, Docs Lint, CloudFormation Lint, Inclusive Language, Gateway Tests (macOS), Coverage Gate.
Coverage Gate safety
The gate keeps its fail-closed contract as a symmetric invariant:
successskipped(anything else — failure, cancellation, dependency-skip, or a job that ran when it shouldn't have — fails)Prior art
This is the pattern home-assistant/core's
ci.yamluses at much larger scale: aninfojob runsdorny/paths-filter, derives decision outputs, downstream jobs gate on single flags, and aci-full-runlabel forces the full suite. Same action version pinned here (v4.0.2, full SHA per this repo's convention). GitHub's own docs confirm workflow-levelpaths:filtering can't work with required checks (skipped workflows leave required checks pending and block merge) — hence job-level filtering with an always-running verdict.Why
From #1556: a recent 5-line
website/src/pages/ChatSidebar.tsxfix ran 8 backend test shards, Electron tests, CloudFormation lint, and Docker smoke — none reachable by the diff. Roughly half of every single-surface PR's CI is unaffectable by its changes, and on fork PRs each push costs a maintainer "Approve and run" click that buys one mostly-irrelevant matrix run.Testing
actionlintv1.7.12: clean on this workflow (only note is a pre-existing style nit in an untouched script)dorny/paths-filterSHA matches the upstream v4.0.2 tag.github/**, so it sets meta ⟹ runs the full matrix on itself — the gating logic exercises its most conservative branch on this very runCloses #1556