Repository navigation
perf(ci): run only the jobs and contract cells a change affects - #192
Merged
Merged
Conversation
ci.yml ran all or nothing. Any file under scripts/, probes/,
.github/deploy/ or tools/oracle-v1/, or any workflow (deploy.yml,
flake-hunt.yml included), started all 32 jobs and the 23 cells. A
change to web/ alone skipped the browser journeys' cell, which drives
that build (G-30).
- .github/scripts/plan-ci.py replaces classify-changes.sh and the
`plan` job. The `changes` job gives it the changed paths, Cargo's
graph of the workspace (cargo metadata --no-deps; normal, dev and
build dependencies) and the matrix (plan-cells.sh). It names the
jobs and the cells to run:
- A crate change affects the crate and every crate that depends on
it. A target's cells run when the binary they start is affected
(native-* start thrust-server, worker-* start thrust-worker).
- pg-adapter runs when thrust-adapters-selfhosted is affected.
mutants runs when thrust-server is affected.
- A pass runs on its own inputs: tools/oracle-v1/ runs the oracle
cells; e2e/ and web/ run worker-cf e2e.
- Files that tests read from outside their crate have their own
rules: tools/oracle-v1/ and .github/deploy/.
- A path whose readers the planner does not know runs everything.
So does an unknown target.
- ci.yml:
- Every job runs on `contains(jobs, '<job>')`.
- The matrix comes from `changes`.
- A merge-queue entry runs everything, as does a release candidate,
a manual run and a new nightly run on main (03:23 UTC). The
nightly run catches a new advisory or stable toolchain.
deploy.yml ignores it.
- assert-gate.sh checks the planner's job set:
- An expected job must be `success`; every other must be `skipped`.
- The gate and the planner must name the same nine jobs.
- The inputs must be JSON arrays of strings.
- The cell rules are unchanged.
- .config/branding/ (the book's palette) no longer runs everything.
- Docs: cicd.md, running.md, status.md (G-30's gap 2),
book-theme.md, e2e-schedule.yml's header, and the plan's as-built
notes.
Tests:
- test_plan_ci.py, 4885 checks:
- 300 generated crate graphs, against an independent
reverse-reachability;
- the union of plans;
- each rule is first matched by its own sample, and matches a
tracked file;
- the fail-open cases;
- this repository's graph and targets;
- no script kept out of the cells is called by what runs a cell.
- test-ci-scripts.sh, 101 checks: the gate over every job, expected or
not, with each of the four results.
- 34 hand mutants of the planner and the gate, each caught.
Refs: #49
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 16, 2026
Closed
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.
PR 4 of the CI/CD review (
.agents/plans/cicd-review/PLAN.md):cinow runs only the jobs and contract cells a change affects.Before
rustregex started all 32 jobs and 23 cells. That included:probes/, which no job runs;.github/deploy/;cidoes not run;web/alone skipped theworker-cf e2ecell, which drives that build (G-30).After
.github/scripts/plan-ci.pyreplacesclassify-changes.shand theplanjob. Thechangesjob gives it three things:cargo metadata --no-deps, with every kind of dependency;plan-cells.shstill parses fromcontract-all.sh.It returns
jobsandcells.web/web,contractworker-cf e2ethrust-adapters-cloudflareci-scriptsdepslinthermeticcontractworker-*thrust-adapters-selfhosted/Cargo.tomldeny,pg-adapterandmutantsnative-*thrust-contracts(everything depends on it)denyandwebtools/oracle-v1/depshermeticcontractoraclescripts/smoke-deploy.shci-scriptsdocs/Fails open. Everything runs in these cases:
ci.yml, the planner or gate, the cells' harness);cargo metadata;main(03:23 UTC).The nightly run is how a new RustSec advisory or a new
stableshows up without waiting for a pull request.deploy.ymlignores it, becauseplan-deploy.shdeploys only after a pull request or a push.Files that tests read from outside their crate get their own rules, because Cargo's graph can't see them:
tools/oracle-v1/is read by the tests of four crates..github/deploy/is read by the TLS tests of adapters-postgres.The gate (
assert-gate.sh) now checks the planner's job set:success, and every other job must beskipped.EXPECTED_JOBSandPLANNEDmust be JSON arrays of strings. A mutant showed that{}would otherwise read as "no jobs".Tests
test_plan_ci.py(new, 4,885 checks):contract-all.shis known, and the named crates exist.test-ci-scripts.sh(101 checks): the gate over each of the nine jobs, expected or not, with each of the four results, plus the cell, input and name cases.ci-scriptstest anddepsguard under dash (37/37), andactionlint.Not verified until CI runs it
This PR changes
ci.ymland the gate, so its own run is a full one: it shows the new wiring with all nine jobs expected. The narrowed plans first run on later pull requests. The plan's verification step covers that: draft PRs touching docs, one Worker crate,scripts/smoke-deploy.shandweb/.Built-ins considered
cargo-rail,affectedandcargo-deltacompute the affected crates. None of them knows the jobs, the cells or the gate's expected set, and each would add a binary to the required check's path.dorny/paths-filtermaps paths to flags, but its filters would be YAML that no test runs.The graph itself comes from
cargo metadata.Not in this PR
The smaller fixes from the review each get their own PR:
lint-workflow.shover every workflow;--lockedonhermeticandpg-adapter;docsjob;rust-toolchain.toml.Refs: #49
🤖 Generated with Claude Code