Repository navigation
ci: run only the lanes a change affects in local CI and the validation gate - #589
Merged
Merged
Conversation
Add scripts/ci-lane-map.txt, one path-to-lane table, and scripts/ci-select-lanes.sh, which reads it. ci-local.sh --affected lists the change since the merge base, prints the lanes it selected and skipped and the rule each path matched, and runs the selected ones; several ports run as parallel lanes like the full run, one stays serial. Unknown paths, an unreadable map and an unresolvable base all select every lane. ci-affected-ports.sh reads the same map, so the gate and the hosted workflows agree. docs/recipes is executed by port tests and no longer counts as docs. .no-mistakes.yaml: the test command is --affected, and test.instructions and test.path_instructions scope the evidence agent by the paths a change touches.
…e lane map once Review follow-ups for affected-lane selection: docs/ maps to every lane because port tests read those pages (only the root prose files select none), the selector CLI uses the same base rule as the gate, the map is parsed once per selection without per-line forks, and the selected-port lanes call the shared step functions directly.
…t pr-ci docs comment
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 Changed
scripts/ci-local.sh --affected: it lists the paths changed since the merge base with the base branch (committed, uncommitted and untracked), maps them to lanes with one table,scripts/ci-lane-map.txt(read by the newscripts/ci-select-lanes.sh), prints the lanes it selected, the lanes it skipped and the rule each path matched, and runs only the selected lanes. When more than one port is selected their lanes run in parallel, like the full run's, so a shared change is not serialized. Mutation stays diff-scoped insidets-fast.MO_CI_FULL=1forces every lane,MO_CI_AFFECTED_BASE=<ref>picks the base, and the flagless run is unchanged and is what releases use.ts-fast+ts-unitfor TypeScript and the web client,java-slow,python,csharp);fixtures/,spec/,scripts/(this map included),.github/,agent-context/and everything underdocs/run every lane, because port tests read those files; only the rootREADME.md,CHANGELOG.md,CONTRIBUTING.md,AGENTS.mdandCLAUDE.mdrun none. Any path no rule claims, an unreadable or invalid map, an unresolvable base and a git failure all select every lane (unknown means full).scripts/ci-affected-ports.sh(port detection forpr-ci.ymlandlocal-ci.yml), with--no-renamesso a rename's old path still selects the port it left, and the gate and the hosted workflows share one base-ref rule..no-mistakes.yaml:testis nowscripts/ci-local.sh --affected --strict-toolchains(it was--only ts-fast --only ts-unit, so a Java, Python or C# change was validated by TypeScript tests only);lintstays--only gates. Atest:block scopes the evidence agent by changed path.scripts/test-ci-lane-selection.sh(in thegateslane) pins what each kind of change selects, the fail-open cases, a throwaway-git end to end, the parallel plan, and rename handling. Docs:CONTRIBUTING.md,AGENTS.md,.no-mistakes.yaml, thepr-ci.ymlheader comment.Wall times
scripts/ci-local.shon one warm tree, one run each, on a busy shared host (load average 15 to 50 on 32 threads), so read them as rough. Before is the old Test command,--only ts-fast --only ts-unit, which ran for every change. After is--affected --strict-toolchains.gateslane still runs in Lint)fixtures/,scripts/, ...)No change type got slower, and a shared change now covers every port in less wall time than the old TypeScript-only command took.
Caveats
.no-mistakes.yamlis read from the default branch, so this run's Test step still executed the old command (4m00s);--affectedand the newtest:block take effect after merge. The times above are local measurements of the new command.test.instructionsandtest.path_instructions, which also take effect after merge). That narrows what it is told to do and does not bound it. A hard bound needs a lower hosttest_agent_timeout, or a no-mistakes feature to skip the evidence agent for given paths, roughly one to two days of work in that repository.docs/now runs every lane in the hosted workflows as well, where it used to run none, because Java, TypeScript and Python tests read those pages.--affectednever runs the docker half, so a change confined to one port skips that port's docker integration suites, which still run on release tags and on manual dispatch.Pipeline
One no-mistakes run: the review step raised two findings, both fixed in that run.