Skip to content

fix: evaluate every rule over the whole project on selected runs - #1216

Merged
kvlonge merged 1 commit into
mainfrom
fix/model-rules-whole-project
Oct 22, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/model-rules-whole-project

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Why

With a selection, sqb plan, sqb build and sqb rules run --select evaluated model-scoped rules on the selection's slice of the project. A custom rule that reads ctx.graph.dependents(model) then saw only the selected dependents, so it could report findings that sqb compile does not, and selected jobs failed even though the project compiled cleanly. #1198 fixed this for project-wide rules only.

Changes

  • Selected runs evaluate every built-in and custom rule over the whole project, using compile's rules config with every exception. They reuse compile's rules cache and the early built-in speculation, and report only findings on selected models and on files that are not models. A project that compiles cleanly now passes every selection.
  • SQL lint rules still check each selected file on its own.
  • Removes the separate whole-project pass and its cache directory from fix: evaluate project-wide rules over the whole project on selected runs #1198.
  • Docs: rules execution and caching page.

Verification

  • New E2E cases: a custom rule reading ctx.graph.dependents under plan --select. The reported case passes; the case reproduced on a released sqb and fails there.
  • Focused rules, compile-selection and early-rules E2E and integration tests pass. The two wall-clock performance guards were over budget on a loaded machine; their compile path is unchanged.
  • make check-ci passes.

A selected plan or build evaluated model-scoped rules on its slice of the
project, so a custom rule reading ctx.graph.dependents saw only the
selection's dependents and could report findings that sqb compile does not.

Selected runs now evaluate built-in and custom rules over the whole project
with compile's rules config and every exception, reusing compile's rules
cache, and report only findings on selected models and on files that are not
models. SQL lint rules still check each selected file on its own. A project
that compiles cleanly now passes every selection.

Closes CHI-794
@kvlonge
kvlonge enabled auto-merge (squash) October 22, 2026 11:20
@kvlonge
kvlonge merged commit 5f46d68 into main Oct 22, 2026
46 checks passed
@kvlonge
kvlonge deleted the fix/model-rules-whole-project branch October 22, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant