Repository navigation
Conversation
There was a problem hiding this comment.
The approach looks right: run just check:drift on PRs that change the generators' TypeScript inputs, with the same setup as check-cli-rs.yml. I checked the path list against the imports in packages/cli-rs/script/gen and script/rust, and against script/drift.ts. I couldn't run the job, because this environment has no rustfmt. This PR's own CI run will be the real test.
Public API: unchanged (CI only).
One gap: packages/httpapi-codegen is a direct generator input, but it's missing here and from the dev push list (inline comment).
| paths: | ||
| - packages/protocol/** | ||
| - packages/schema/** | ||
| - packages/client/** |
There was a problem hiding this comment.
script/gen/api.ts and script/rust/methods.ts import compile / Endpoint from @opencode/httpapi-codegen, so a change in packages/httpapi-codegen can change the generated Rust API. That package isn't listed here or in the dev push paths of check-cli-rs.yml, so drift from it would get past both runs. Worth adding packages/httpapi-codegen/** to both lists.
There was a problem hiding this comment.
The earlier point is fixed: packages/httpapi-codegen/** is now in both the new workflow's PR paths and the dev push list of check-cli-rs.yml. Nothing new to raise. I checked this by reading the diff; I couldn't run the job here because this environment has no rustfmt.
Public API: unchanged (CI only).
Issue for this PR
N/A (CI proposal for the Rust client; no issue exists)
Type of change
What does this PR do?
A proposal for Simon to accept or close.
check-cli-rs.ymlruns on pull requests only when they changepackages/cli-rs, so a PR that changes the server API or config schema passes its own checks and turnsdev's Rust check red until someone regenerates. That happened four times in three days: #68150 (fixed by #68286), #68521 (#68576), #68600 (#68627), and #68625, machine relays (#68683, open).The new
check-cli-rs-drift.ymlruns onlybun run check:drift(setup-bun,rustup toolchain installfor rustfmt, then the check) on PRs that change these paths, which are what the generators inpackages/cli-rs/script/genimport directly:packages/protocol/**,packages/schema/**,packages/client/**(API types, flags, plugin types; all four incidents)packages/httpapi-codegen/**(script/gen/api.tsbuilds the Rust API from itscompileoutput)packages/tui/src/config/**,packages/tui/src/theme/**,packages/theme/**(keybinds, themes)packages/cli/src/commands/**(CLI commands and output)Left out from the dev push list: the rest of
packages/tui,packages/cli/src,packages/utilandpackages/plugin, which the generators reach only through imports or which only the parity oracles read, andbun.lock. Including them would run this on almost every TUI and CLI PR. The dev push run still catches them.The dev push list in
check-cli-rs.ymlgainspackages/httpapi-codegen/**too: it was missing, so drift from that package got past both runs. It is the only workspace package the generators import directly that either list lacked.If the check fails, the author runs
bun run check:driftinpackages/cli-rs(it needsrustfmt) and commits the files it rewrites; the job's error says so. That is the right command, notbun run generate, which doesn't rerun the parity oracles thatcheck:driftchecks and does run two generators thatcheck:driftskips (network grammars, ICU time). Committing the result touchespackages/cli-rs, so the fullcheck-cli-rsthen runs on the PR and shows any hand-written Rust it needs, as #68576 did.Cost per affected PR: about 70 s, measured on this PR's own run (checkout 5 s, cached Bun setup 7 s, toolchain install 6 s,
check:drift50 s). Fork PRs are safe:pull_requestwithcontents: readand no secrets.No feature flag: CI-only.
How did you verify your code works?
bun run check:driftin a fresh worktree oforigin/devwith onlybun installand a systemrustfmt, no cargo build or OpenTUI download: 55 s. It needed nothing beyondnode_modules.actionlint1.7.12 is clean apart from the Blacksmith runner label it doesn't know, whichcheck-cli-rs.ymlgets too.check:driftfails ondevtoday for that reason.Screenshots / recordings
N/A: CI-only change.
Checklist
If you do not follow this template your PR will be automatically rejected.