Skip to content

ci: run only the jobs of the packages a change touched - #54

Merged
gjtorikian merged 4 commits into
mainfrom
ci/run-only-changed-packages
Nov 6, 2026
Merged

gjtorikian merged 4 commits into
mainfrom
ci/run-only-changed-packages

Conversation

@gjtorikian

Copy link
Copy Markdown
Collaborator

Summary

  • CI runs each package's job only when that package changed. A changes job classifies the pull request's files with dorny/paths-filter; a destination's job runs when its package changed, and every job runs when the engine changed (every destination depends on it), when a shared file changed (the lockfile, the workspace file, a root config, the workflow itself), on a push to main, or on a release PR (release-please--*). A job whose condition is false reports as skipped, which the branch rules accept as success, so the required checks keep their names.
  • The Docker workflow gets the same gate. Its matrix entries still all run, because each image's check is required by name and a job-level condition cannot read the matrix; an entry whose destination did not change skips every step and reports success in seconds.
  • Lint no longer builds and typechecks the whole workspace; typecheck moves into each package's CI job, after its build.
  • The pre-push hook builds, typechecks and tests only the packages whose files changed since the branch left its upstream (or main), plus the packages that depend on them, through pnpm's ...[ref] filter. A change to a shared root file runs everything, as CI does.

Testing

actionlint passes on the three workflows. This PR changes the CI workflow itself, which counts as shared, so every job runs here; the first package-only PR after it merges is where the skips show.

A `changes` job classifies the files of a pull request, and each
package's job runs only when that package changed: the engine, a shared
root file, a push to main or a release PR run everything, since every
destination depends on the engine. A skipped job reports as success to
the branch rules, so the required checks keep their names. The Docker
matrix entries all run and skip their steps instead, since a job-level
condition cannot read the matrix and each image's check is required.

Lint no longer builds and typechecks the whole workspace; typecheck
moves into each package's job, after its build. The pre-push hook runs
only the packages changed since the branch left its upstream, plus
their dependents, through pnpm's `...[ref]` filter.
@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the database startup change addresses the remaining finding.

Summary

This PR limits builds and checks to changed packages and the packages that depend on them.

  • CI runs checks only for packages touched by a change.
  • Docker checks run only for destinations touched by a change.
  • The pre-push hook checks only packages changed on the branch.

No new actionable issues were found in the changes since the previous review.

Reviews (3) · Last reviewed commit: "ci: start Postgres and MySQL in gated st..." · Reviewed by Greptile

Comment thread .github/workflows/ci.yml Resolved
Comment thread .husky/pre-push Resolved
Comment thread .github/workflows/ci.yml Resolved
…check the example

A job skipped by a job-level condition is skipped before its matrix
expands, so the checks the branch rules require by name would never be
reported and a destination-only PR would wait on them forever. Every
job now runs and skips its steps instead, as the Docker workflow does.

The hook's build selection takes dependencies in as well as dependents:
a destination compiles against the engine's built output, which a fresh
checkout lacks. The Postgres job typechecks the example package, which
Lint used to cover for the whole workspace.
…e root

pnpm's own change detection counts the workspace root as a changed
project when a hook or workflow file changes, and the root's build
recurses into every package. The hook now reads the changed package
directories from the diff and selects them with pnpm's directory
selectors; a change outside any package runs nothing unless it is a
shared root file, which runs everything.
Comment thread .github/workflows/ci.yml Resolved
A service container starts before the gate, so a PR that did not touch
the package still booted a database for every Node version before
skipping every step. Both databases now start in a step behind the same
condition as the rest, the way the ClickHouse job already does.
@gjtorikian
gjtorikian merged commit 272a149 into main Nov 6, 2026
25 checks passed
@gjtorikian
gjtorikian deleted the ci/run-only-changed-packages branch November 6, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant