Repository navigation
ci: run the provider plan's classifier, lookup and choice in one job - #2394
Merged
Merged
Conversation
The plan ran three GitHub-hosted jobs in a chain (Detect Component Changes, Find an earlier test of this tree, Choose the components to test) before the route job, and no macOS job starts before the route ends. One job now runs the same steps in order: the classifier (continue-on-error; its outcome is changes_result), the tree lookup only when the classifier succeeded, and the choice unless cancelled. Every output keeps its name and meaning. component-changes.yml had no other caller and is deleted. The structural tests check the new job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dev added the `commit` job (a dispatch's ref, resolved once) that the classifier waited for. The one plan job now needs `commit` and runs the checkout and the classifier only when it succeeded, as the classifier job did; the tree and lookup steps keep dev's dispatch-aware env. The tests check the new `needs`, the step conditions, and scope the no-API check to the classifier step (dev's tree step reads a dispatch's tree through the API). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Summary
CI's plan (
.github/workflows/provider-plan.yml, called by CI (dev) and CI (master)) ran five GitHub-hosted jobs one after another, and no macOS job starts before the last one ends:commit("Resolve the commit to test", from ci: PR workflows run on request only; dispatch CI against one commit #2399): resolves a dispatch'sref. It does nothing on other events.changes("Detect Component Changes", the reusablecomponent-changes.yml): the classifier.tested("Find an earlier test of this tree"): the tree lookup.components("Choose the components to test"): the choice.route("Select Runners").This PR folds jobs 2 to 4 into one job,
components("Plan the components to test"). It runs the same steps in the same order.commitandroutestay separate jobs.routechanges only itsneeds(nowcomponents).darkbloom-route.ymlis not touched. The plan goes from 5 jobs in a chain to 3.Why
Each job in the chain adds a runner start and a gap between dependent jobs, about 2 to 5 s each. Every macOS job (the build jobs, then all test shards) waits for the plan. So the time the plan saves moves the start of every macOS job, and with it the end of every CI run.
What changed, per file
.github/workflows/provider-plan.yml: one jobcomponents:needs: commit,if: ${{ !cancelled() }},ubuntu-24.04,timeout-minutes: 10, permissionscontents: readandactions: read(the union of the old jobs; both callers grant exactly these). Steps:fetch-depth: 0,filter: blob:none,persist-credentials: false(the classifier's checkout; the lookup script is in it). It runs only wheninputs.run_testsis true andcommitsucceeded, as thechangesjob did.paths:python3 scripts/ci-component-paths.py, withcontinue-on-error: true, under the same condition. Its outcome is thechanges_resultoutput, asneeds.changes.resultwas:success,failure, orskipped(withoutrun_tests, or when a dispatch'srefwas refused). TheProvider Testsgate still requiressuccess.treeandlookup: the same commands and env as dev, dispatch handling included (EVENTread once,SHAfromcommit,SELECTEDfrom the classifier's outputs). They run only whensteps.paths.outcome == 'success', astestedran only whenchangessucceeded.choose: the same script, withif: ${{ !cancelled() }}. It runs after a failed lookup or classifier, as the separatecomponentsjob (if: !cancelled()) did. A failed or skipped lookup leavesskipempty, which tests.All 14 outputs of the workflow keep their names and meanings. The 12 that the old jobs produced now read
jobs.components.outputs.*;routesandshaare unchanged..github/workflows/component-changes.yml: deleted. The plan was its only caller.scripts/ci-component-paths.py,scripts/docs-impact-rules.json: drop the deleted file from the path lists.scripts/test-ci-component-paths.py,test_expensive_jobs_depend_on_successful_classifier, checks the new job:if,id,continue-on-error(the job's only one) and command, andchanges_resultfrom its outcome;tree/lookupcondition andSELECTED;needs: commitwith!cancelled(), thechoosecondition andSKIP,routeneedingcomponents, and the component outputs;github.event_namein the classifier step and exactly one in the lookup step;choosestep.scripts/test-ci-component-paths.py,test_detector_has_full_history...: checks the plan job's checkout (fetch-depth: 0, blobless, no persisted credentials, not sparse), that the classifier step uses no API, that the classifier outputs reachSELECTEDandchoose, and thatcomponent-changes.ymlis gone. The forbidden-content file lists checkprovider-plan.ymlin place of the deleted file.scripts/test-darkbloom-route.py: updates the classified workflow set, the GitHub-hosted job list and the write-permission scan.test_classifier_gate_and_route_need_no_routed_runnerchecks that route needscomponentsand that the classifier runs in the GitHub-hosted plan job.plan_countreads every input,skipincluded, from the plan job.scripts/test-provider-ci-workflow.py: the checkout test checks the gate's sparse checkout and the plan job's full blobless checkout (no.gitcache) separately. Dev'scommitchecks are kept.docs/developer/build.md(CI Workflows, CI runner routing): describes the plan's three jobs.Before
After
flowchart LR classDef gh fill:#e1ecfd,stroke:#1f5fbf,color:#000 classDef wait fill:#fde2e1,stroke:#c0392b,color:#000 classDef mac fill:#e3f2e1,stroke:#2e7d32,color:#000 K["commit: Resolve the commit"]:::gh --> W0["job start"]:::wait --> P subgraph P["components: Plan the components to test"] S1["checkout full history"]:::gh --> S2["classify, continue-on-error"]:::gh --> S3["lookup, if classify succeeded"]:::gh --> S4["choose, unless cancelled"]:::gh end P --> W["job start"]:::wait --> R["route: Select Runners"]:::gh --> M["macOS build and test jobs"]:::macMeasured
Plan wall time is the time from the first plan job's start to the route job's end. No macOS job starts before then. "Checkout" is the classifier's full-history checkout step; its time varies a lot from run to run. "Rest" is the wall time minus the checkout: the job starts, the gaps between jobs, the lookup, the choice and the route. This PR changes only the rest.
Before, median of 5 runs: 44 s wall time (41 to 52 s); the rest took 26 s (25 to 32 s). After, 2 runs: 31 s and 50 s wall time; the rest took 15 s and 20 s.
commit), the old shape had 4 plan jobs. There, 6 runs had a median of 40 s with a rest of 24 s; this PR's run 44671742766 took 40 s with a rest of 17 s.Follow-up (not in this PR)
The classifier reads only the event JSON and runs git on commits and trees (
git rev-parse,merge-base,diff --name-only). The lookup reads onlyscripts/ci-tested-tree.py. A sparse checkout of the two scripts (history unchanged) would skip about 20 s of file downloads, which is most of the plan's remaining time. It changes the checkout this PR keeps as it was, so it is left to a separate change.Validation
Provider Testsgate. The gate receivedCHANGES_RESULT: successandSKIP: falsefrom the new job.ClusterOrphanReaperTests;HardwareLoadMonitorTestsandFanStartupDiscoveryTeststimeouts on test-provider-1;GLM5NextResidentRuntimeTests"requires a GPU device and its recommended working set" on test-cluster-1.ref/pr) and therun_tests: falsepath of CI (master). A PR run on dev is neither. Both were checked by reading the code: the step conditions give the same results as the old job conditions.Limitations
continue-on-error, as ordered). The failure shows in the classifier step and in theProvider Testsgate, which still fails onchanges_result != success. Before, thechangesjob itself turned red.changes_resultisskipped(the classifier step did not run), notfailure. The gate fails either way, and the plan job is red.Refactor pass
A refactor reviewer subagent traced every updated assertion through the test helpers (
step_blocks,field,run_command,checkout_options,continues_on_error,jobs) against the new YAML. It also checked the invariants: the outputs,run_tests: false, the lookup env, the permissions, and thatunlabelanddarkbloom-route.ymlare untouched. It made no change and noted the two limitations above; the first is the ordered design. It reviewed the change before the merges of dev. The merge adaptation (needs: commit, the two step conditions, the no-API check narrowed to the classifier step because dev's tree step uses the API) was not reviewed again by a subagent.Documentation impact
docs/developer/build.mddescribes the plan's jobs.docs/developer/test.mddoes not describe them, so it is unchanged. No changelog fragment (CI-only change).Done on David's direct order (2026-11-20, 'high prioritize the test optimization') from the CI-routing session; the d-inference session (layr-labs-2d) owns this repo's other dev work.
🤖 Generated with Claude Code