Skip to content

Add pnpm pre-ci:affected for a fast, diff-scoped pre-push check#7751

Draft
dmerand wants to merge 3 commits into
donald/dx-pre-cifrom
donald/dx-pre-ci-affected
Draft

Add pnpm pre-ci:affected for a fast, diff-scoped pre-push check#7751
dmerand wants to merge 3 commits into
donald/dx-pre-cifrom
donald/dx-pre-ci-affected

Conversation

@dmerand
Copy link
Copy Markdown
Contributor

@dmerand dmerand commented Jun 8, 2026

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?

pnpm pre-ci mirrors CI's full --all targets, which makes it thorough but slow — slow enough that people won't reach for it on every change, which defeats the point of having an easy pre-push check. This adds a fast, diff-scoped version for the inner loop and keeps the full run for when you actually want that confidence.

WHAT is this pull request doing?

  • Adds pnpm pre-ci:affected (and dev pre-ci:affected), the diff-scoped sibling of pre-ci.
  • Each gate in bin/ci-gates.js now knows its affected form: type-check / lint / build use the nx :affected scripts, unit tests use vitest run --changed, and knip just runs (it's quick and has no affected mode).
  • The codegen checks are skipped in affected mode unless your diff actually touches commands, flags, or GraphQL — and when they're skipped, the run reminds you to pnpm codegen if that applies. If it can't work out what changed, it errs toward running them.
  • While here, the changed-file detection learned to handle quoted and renamed paths from git status, so the codegen heuristic doesn't quietly miss them.

pnpm pre-ci itself is unchanged. Dev tooling only, nothing user-facing.

How to test your changes?

  1. On a code-only branch, pnpm pre-ci:affected runs the affected checks, runs knip, and skips codegen with a note.
  2. On a branch that touches a command or a .graphql file, the codegen checks run.
  3. pnpm check-ci-gates still passes — the gate set hasn't changed.

Post-release steps

None.

Copy link
Copy Markdown
Contributor Author

dmerand commented Jun 8, 2026

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jun 8, 2026
@dmerand dmerand changed the title Add pnpm pre-ci:affected fast mode Add pnpm pre-ci:affected for a fast, diff-scoped pre-push check Jun 8, 2026
@dmerand dmerand force-pushed the donald/dx-pre-ci-affected branch 2 times, most recently from ed599fc to ccde915 Compare June 8, 2026 14:45
@dmerand dmerand force-pushed the donald/dx-pre-ci branch from 277f70b to fb13f3d Compare June 8, 2026 14:58
@dmerand dmerand force-pushed the donald/dx-pre-ci-affected branch from ccde915 to 8b2b10a Compare June 8, 2026 14:58
@dmerand dmerand force-pushed the donald/dx-pre-ci branch from fb13f3d to de92462 Compare June 8, 2026 15:14
@dmerand dmerand force-pushed the donald/dx-pre-ci-affected branch from 8b2b10a to 6f30c6e Compare June 8, 2026 15:14
@dmerand dmerand force-pushed the donald/dx-pre-ci-affected branch from eb2d663 to e96df11 Compare June 8, 2026 19:31
@dmerand dmerand force-pushed the donald/dx-pre-ci branch from de92462 to 6a635d0 Compare June 8, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant