Add pnpm pre-ci mirroring PR CI gates, with manifest drift guard#7733
Draft
dmerand wants to merge 5 commits into
Draft
Add pnpm pre-ci mirroring PR CI gates, with manifest drift guard#7733dmerand wants to merge 5 commits into
dmerand wants to merge 5 commits into
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
fb13f3d to
de92462
Compare
09cebb5 to
5d90b53
Compare
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.

About this stack
This stack came out of reviewing recent contributor and agent sessions in
Shopify/cli, where the same avoidable friction kept recurring: failures found only after pushing, generated files regenerated by hand, local checks drifting from what CI actually enforces, and setup conventions relearned every time. The goal is to make the local dev loop mirror CI and keep the two single-sourced so they can't drift — then document it so people and agents stop rediscovering it.WHY are these changes introduced?
Building on the codegen PR below it. Even with that in place, there's still no single command that runs what the PR pipeline actually checks, so lint, type-check, knip, codegen, and test failures tend to surface only after you've pushed. And any helper we write to "run the checks locally" will quietly fall out of step with
tests-pr.ymlas gates get added or the pinned tool versions move.WHAT is this pull request doing?
pnpm pre-ci(alsodev pre-ci) runs the local gates in the same order CI does — type-check, lint, build, knip, the two codegen checks, unit tests — then prints a summary and tells you which CI-only gates it deliberately skips and why. It mirrors CI's full targets, so green here means green there; it's slower than the affected-onlydev check, on purpose.bin/ci-gates.jsis the one place that maps everytests-pr.ymljob (by id) to either a local command or a reason it's CI-only.pnpm check-ci-gatesis the guard: it fails if a workflow job isn't classified, if the manifest names a job that's gone, or if the Node/pnpm versions indev.ymlandtests-pr.ymldisagree. It parses the files with a small, hardened, dependency-free reader (kept lightweight so the CI job needs nothing installed) and is covered bybin/check-ci-gates.test.js.CI gate manifestjob runs that test and the guard on every PR, so the manifest can't silently drift from the workflow.Dev tooling only, nothing user-facing.
How to test your changes?
pnpm check-ci-gatespasses today.tests-pr.yml, or bumpDEFAULT_NODE_VERSION— it fails with a specific message. (Both are covered by the tests.)pnpm pre-ci(ordev pre-ci) runs the set and prints the summary.Notes
${{ … }}into theirs.pre-ciregenerates files as it checks, so it reminds you to glance atgit statusafterward.bin/ci-gates.jsto keep it green.Post-release steps
None.