Repository navigation
fix: evaluate every rule over the whole project on selected runs - #1216
Merged
Merged
Conversation
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
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.
Why
With a selection,
sqb plan,sqb buildandsqb rules run --selectevaluated model-scoped rules on the selection's slice of the project. A custom rule that readsctx.graph.dependents(model)then saw only the selected dependents, so it could report findings thatsqb compiledoes not, and selected jobs failed even though the project compiled cleanly. #1198 fixed this for project-wide rules only.Changes
Verification
ctx.graph.dependentsunderplan --select. The reported case passes; the case reproduced on a releasedsqband fails there.make check-cipasses.