Repository navigation
chore: pnpm preflight runs the pre-review report and CI's checks for a change - #12755
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 40a4a66 |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
pnpm preflight is a useful addition, but four things need to change before approval.
- The default run prints "ready to flip" and is described as CI-equivalent, yet it leaves out checks CI runs for the same change: the Lab typecheck (which it reports as "CI runs no typecheck on this lane"), the docsite build and tests, the Lint workflow's formatting, import-boundary, probe-theme and CLI README checks, the first UI leg's extra checks and the Storybook build.
- Uncommitted and untracked changes choose the lane, but CI's test listers diff commits only, so an uncommitted record edit passes both Vitest rows without running the tests that read it.
changedChangesinscripts/preflight.mjscopieschangedFilesfromscripts/pre-review.mjs, so export and call the existing one and the report and the checks always plan from the same files.- On a branch with no changes the run crashes with "Cannot read properties of undefined (reading 'length')" and exits 1, because
buildReportreturns nofindingsthen.
Either add the missing lane steps to the default plan or say what it leaves out, as --quick already does; the inline comments point at each spot.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the lane comes from CI's own classifier: verified.
- Claim: the Vitest lists come from CI's own listers, from the merge base: verified for committed changes, false for uncommitted and untracked ones.
- Claim: the typecheck is skipped only where CI's typecheck skips: false for Lab-only changes.
- Claim: the default stays the full CI-equivalent run: false.
- Claim:
--browseradds the Storybook build, the accessibility contracts and the selected Chromium specs: verified in the plan, not run. - Claim: a failing command fails its check and the next check still runs: verified.
- Claim: a pre-review finding counts as a failure: verified.
- Claim: one PASS, FAIL or SKIP line per check, the failing commands, the verdict line and exit 1: verified.
- Claim:
--wrapwraps only the heavy steps: verified; the knowledge check insidecheck:repois not wrapped. - Claim:
--quickchecks only the changed packages, files and tests, ignores--browserand never says "ready to flip": verified. - Claim: the output states that a reviewer still judges the change: verified.
- Claim: the new tests pass (14): verified.
- Claim: an end-to-end run on a loaded machine reported as CI would: not rerun.
- Claim: Prettier clean: verified; ESLint clean too.
- Claim: the guide section, the AGENTS.md line and the package script are added: verified.
- Claim: no CI impact: verified, no workflow changes.
- Claim: preflight is not a required step: verified.
- Claim: no open pull request overlaps: verified by search.
- File
scripts/preflight.mjs: four blocking findings and three non-blocking notes. - File
scripts/preflight.test.mjs: pins the Lab "no typecheck" note (first finding). - File
docs/contributing/pull-requests.md: CI-equivalence wording (first finding). - File
AGENTS.md: "CI's checks scoped to the change" wording (first finding). - File
package.json: clear.
…k and Prettier, names the CI checks it leaves out, and reuses review:pre's changed files
|
/approve-spec 8c47c45 |
There was a problem hiding this comment.
pnpm preflight now checks only committed work, stops cleanly on a branch with no change, reuses review:pre's change list and runs CI's Lab typecheck, but two things still need to change before approval.
- The "Not run here (CI runs them)" line in
scripts/preflight.mjsleaves out checks CI runs for the same change (whole-repo ESLint throughpnpm lint, the public-text and comment-provenance checks, thetest-buildand Node browser-contract jobs, and the visual, WebKit and accessibility jobs), so "ready to flip" still promises more than the plan runs, and the description still calls the default "the full CI-equivalent run". - The new Prettier step checks every changed file while CI's formatting step checks only
*.ts,*.tsxand*.md, so a one-line edit to a script such as.github/scripts/cli-smoke-test.mjs, one of 1,027 tracked files Prettier would rewrite, prints "not ready: 1" where CI passes.
Name the remaining CI checks completely or in general terms, and pass Prettier only the file patterns CI checks; the inline comments point at both spots.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules since the last review: 0.
- Claim: uncommitted or untracked work stops with exit 2, and a branch with no change exits 0: verified.
- Claim: the change list is
review:pre's own, now exported: verified. - Claim: the
review:prereport runs first, in process, on the committed change: verified. - Claim: the lane comes from CI's own classifier: verified.
- Claim: the Vitest lists come from CI's own listers, from the merge base: verified.
- Claim:
--browseruses CI's Chromium selection and the pull-request accessibility contracts: verified in the plan, not run. - Claim: build and typecheck of the changed packages and their dependents, CI's Lab typecheck on the Lab lane, none on the spec, docsite and tooling lanes: verified.
- Claim: ESLint on the changed files and
pnpm check:repo: verified. - Claim: Prettier on the changed files, scoped the way CI scopes it: false; CI checks only
*.ts,*.tsxand*.md. - Claim: the reached UI and Node tests,
check:knowledgeandcheck:changesets: verified. - Claim: a failing command fails its check, the next check still runs, and a
review:prefinding counts as a failure: verified. - Claim: one PASS, FAIL or SKIP line per check, the failing commands, the verdict line and exit 1: verified.
- Claim: a line names the CI checks the run leaves out: false; the list is incomplete.
- Claim:
--wrapwraps only the heavy steps: verified; the knowledge check insidecheck:repois not wrapped. - Claim: the output states that a reviewer still judges the change: verified.
- Claim:
--quickchecks only the changed packages, files and tests, ignores--browserand never says "ready to flip": verified. - Claim: the default stays the full CI-equivalent run: false.
- Claim: the new tests pass (16): verified.
- Claim: an end-to-end run on a loaded machine reported as CI would: not rerun.
- Claim: Prettier clean: verified; ESLint clean too.
- Claim: the guide section, the
AGENTS.mdline and the package script are added: verified. - Claim: preflight is not a required step, and there is no CI impact: verified.
- Claim: no open pull request overlaps: verified by search.
- File
scripts/preflight.mjs: two blocking findings and four non-blocking notes. - File
scripts/preflight.test.mjs: pins the not-run text and the Prettier command (both findings). - File
docs/contributing/pull-requests.md: CI-equivalence and Prettier wording (both findings). - File
AGENTS.md: "CI's checks scoped to the change" wording (first finding). - File
scripts/pre-review.mjs: clear. - File
package.json: clear.
… can run more than it does
|
/approve-spec b3619d2 |
There was a problem hiding this comment.
Approved pending CI: pnpm preflight now passes Prettier only the changed TypeScript and Markdown files that CI's formatting step checks, and a passing run says CI can run more and decides, which settles both points from the last review. CI has not run on this head yet; it runs once the pull request is marked ready.
- Non-blocking: the
AGENTS.mdline still calls only--quick"not CI-equivalent", which implies the default run is; saying CI can run more than either would match the guide and the run's own output.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules since the last review (0): none.
- Claim: uncommitted or untracked work stops with exit 2, and a branch with no change exits 0: verified.
- Claim: the change list is
review:pre's own, now exported, so the report and the checks plan from the same files: verified. - Claim: the
review:prereport runs first, in process, on the committed change: verified. - Claim: the lane comes from CI's own classifier: verified.
- Claim: the Vitest lists come from CI's own listers, from the merge base: verified.
- Claim:
--browseruses CI's Chromium selection, scoped by the pattern read from the CI workflow, and the pull-request accessibility contracts against the merge base: verified in the plan, not run. - Claim: build and typecheck of the changed packages and their dependents, CI's Lab typecheck on the Lab lane, and none on the spec, docsite and tooling lanes: verified.
- Claim: ESLint on the changed files, Prettier on the changed
*.ts,*.tsxand*.mdfiles except on the docsite and spec lanes, andpnpm check:repo: verified. - Claim: the reached UI and Node tests,
check:knowledgeandcheck:changesets: verified. - Claim: a failing command fails its check, the next check still runs, and a
review:prefinding counts as a failure: verified. - Claim: one PASS, FAIL or SKIP line per check, the failing commands, the verdict line, a line saying CI can run more, and exit 1 on a failure: verified.
- Claim:
--wraporPREFLIGHT_WRAPwraps the build, test and knowledge steps: verified; the knowledge check insidecheck:repois not wrapped. - Claim: the output states that a reviewer still judges the change: verified.
- Claim:
--quickchecks only the changed packages, files and tests, ignores--browserand never says "ready to flip": verified. - Claim: the default is the scoped run of CI's main checks: verified.
- Claim: the tests pass (18): verified.
- Claim: an end-to-end run on a loaded machine reported failures as CI would: not rerun.
- Claim: Prettier clean: verified; ESLint is clean too.
- Claim: the guide section, the
AGENTS.mdline and the package script are added: verified. - Claim: preflight is not a required step, and there is no CI impact: verified.
- Claim: no open pull request overlaps: verified by search.
- File
scripts/preflight.mjs: clear; five non-blocking notes in the review. - File
scripts/preflight.test.mjs: clear. - File
docs/contributing/pull-requests.md: clear. - File
AGENTS.md: one non-blocking note. - File
scripts/pre-review.mjs: clear. - File
package.json: clear.
| `pnpm review:pre` and its checklist from a fresh session. | ||
| - Before you mark a pull request ready: `pnpm preflight` runs `pnpm review:pre` | ||
| and CI's checks scoped to the change (`--browser` adds the browser specs; | ||
| `--quick` is a fast subset, not CI-equivalent). |
There was a problem hiding this comment.
Non-blocking: calling only --quick "not CI-equivalent" implies the default run is, while the guide and the run's own last line say CI can run more. Suggest: (--browser adds the browser specs; --quick is a faster subset; CI can run more than either).
Who this helps
Contributors and agents who want to know, before they mark a pull request ready, whether CI will pass and what the pre-review checklist says. Today that means running
pnpm review:preand then guessing which of CI's checks apply to the change, or waiting for CI to find out.What changes
scripts/preflight.mjs(pnpm preflight [--base <ref>] [--browser | --quick] [--wrap <command>]):pre-review.mjs's ownchangedFiles(now exported), so the report and the checks always plan from the same files;pnpm review:pre's report, in-process (buildReport, atHEAD), then the checks CI runs for this change, scoped the way CI scopes them;change-scope.cjsclassifyChangesdecides the lane (spec-only, docsite-only, tooling-only, Lab-only, full suite or scoped); the Vitest lists come from the samevitest list --changedandfs-guard-tests.mjscommands the test legs run, from the merge base;--browserusesplaywright-legs.mjs select-chromiumwith the scope pattern read fromci.yml's selection step, andpnpm test:a11y-contract:prwithBASE_SHAset to the merge base;pnpm buildand the typecheck of the changed packages and their dependents (on the Lab lane, CI'spnpm -F @astryxdesign/lab -F @astryxdesign/storybook typecheck; skipped on the spec, docsite and tooling lanes, as in CI), ESLint on the changed files, Prettier on the changed*.ts,*.tsxand*.mdfiles (the set CI's formatting step checks, skipped on the docsite and spec lanes as there) andpnpm check:repo, the UI and Node Vitest tests the change reaches,pnpm check:knowledgeandpnpm check:changesets. With--browser, it also builds Storybook and runs the accessibility and Chromium interaction specs the change selects;--wrap <command>(orPREFLIGHT_WRAP) runs each heavy step (build, test, knowledge) as<command> <kind> <step...>, for a machine that limits concurrent heavy jobs;--quickis not CI-equivalent. It runs review:pre, the typecheck of the changed packages alone (no build; their dependencies' build from an earlierpnpm build), ESLint on the changed files, the changed test files alone,check:knowledgeandcheck:changesets, in minutes. It builds nothing and leaves out dependent packages, the tests the change reaches through an import, and the guards. It ignores--browser, and a passing run ends with "quick checks pass; runpnpm preflightbefore you flip", never "ready to flip". The default stays the scoped run of CI's main checks above.scripts/preflight.test.mjs: which checks each lane plans (scoped component change, spec-only, Lab-only, full suite,--browser, and--quick: no build, no guard, no dependents, only changed tests, and its own verdict line); that a failing command fails its check, is named for copying, and does not stop the next check; that the wrapper takes only heavy steps; that an empty test list passes without running; the table's verdict lines; and that the Chromium scope read fromci.ymlis a valid pattern.docs/contributing/pull-requests.mdadds "Before you mark ready", andAGENTS.mdadds one line.package.jsonadds thepreflightscript.Preflight is not a required step.
Tests
scripts/preflight.test.mjs: 18 passed (adds the committed-work stop and the no-change exit, the Lab lane's typecheck, Prettier on CI's file set and its spec-lane skip, and the verdict's "CI can run more" line). (The tests were written with the module, so the only red state was the missing module.)--base HEAD, heavy steps wrapped) went through review:pre, the full build, the scoped typecheck, ESLint,check:repo, the UI lists and run (275 test files, scoped as CI scopes them), and the Node lists, then started the Node run (1,631 files, because the source-reading guards always run, as in CI). I stopped it at a 55-minute bound on a loaded machine. Six UI tests failed there under a load average near 40 (touch-timing and clipboard cases, plus a postinstall test that reads the checkout's location). Those failures come from the machine, not from preflight: it reported them as CI would.CI impact
CI impact: none; a local command, and no workflow changes.
Overlap checked: none (no open pull request adds a local CI-equivalent runner)
Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard, on green, CodeBunny approval and Specs' exact-head
/approve-spec.