Repository navigation
Commit db5cd56
authored
fix(compiler)!: reject unknown schema-change values and follow dialect quoting in compile scanners (#912)
* fix(compiler)!: reject unknown on_schema_change, replay_on_change and dlt_sources keys
Unknown on_schema_change and replay_on_change values fell back to the
default policy, and dlt_sources groups and resources accepted any key.
They now fail compilation: MODEL headers and [defaults]/[path_defaults]
name the value, list the valid ones and show a valid header or TOML line;
dlt keys get the nearest supported key as help. bounded-<duration> must
carry a positive duration. The planner no longer maps unknown values to
a default.
BREAKING CHANGE: unknown on_schema_change or replay_on_change values and
unknown dlt_sources keys now fail compilation.
Refs: CHI-465
* fix(compiler): follow adapter lexical rules in compile-step SQL scanners
Reference extraction, SQL test and scenario CTE scanning, assertion target
detection, scope relationships and native SQL test planning now honour the
active adapter's lexical syntax (backslash escapes, escape and raw string
prefixes, triple quotes, dialect line comments and nested block comments)
instead of generic SQL rules. Cache keys include the lexical syntax.
Refs: CHI-466
* fix(compiler): stop double-encoding JOIN USING columns in exact-name binding
When a relation carries exact (quoted) column names, such as a source table
read from the warehouse, binding encodes every identifier. JOIN USING columns
were encoded twice, once through the SELECT and once through the JOIN node, so
valid joins failed with B002 "JOIN USING column must exist on both sides".
The capped microbatch dependency fixtures read a real source table again.
Refs: CHI-467
* fix(cli): print a JSON diagnostic report when compile --json stops on an error
When compile raised an error, such as a header parse failure, --json wrote
nothing to stdout. It now prints one JSON document with has_errors, stopped,
and the error's code, message and help, matching the stderr text. The exit
code is unchanged and progress stays on stderr.
Refs: CHI-470
* test(executor): make the microbatch overlap test wait for overlap instead of sleeping
The concurrent microbatch test relied on a 50 ms sleep for three delta
stagings to overlap and saw two under load. After each model's serial first
batch, the tracking adapter now holds stagings until three are active, with a
30 s timeout that fails the test with a clear message.
Refs: CHI-468
* fix(rules): key the Rules cache on the native build, not only the version
Local development builds shared one SQLBuild version, so the Rules cache under
target/rules-cache reused results from older builds until it was cleared. A
build script now hashes the native crate sources and lockfile, and the ruleset
fingerprint, model and custom-rule cache identities, and the SQL rule cache use
the version plus that hash. Released builds keep a stable identity.
Refs: CHI-471
* test(e2e): use the valid replay_on_change forward in microbatch lifecycle fixtures1 parent c93a99c commit db5cd56
129 files changed
Lines changed: 2979 additions & 409 deletions
File tree
- crates/sqlbuild-rules-native
- src
- bindings/_helpers
- compiler
- _helpers/sql_tests
- tests
- engine
- _helpers
- tests
- rules/_helpers
- semantic_validation/_helpers
- sql_scan
- _helpers
- main
- tests
- src/sqlbuild
- .agents/skills/sqlbuild/references/docs
- cli
- concepts
- models
- rules
- integrations
- cli/commands/_helpers
- compile
- entry
- compiler
- authored_values
- _helpers
- main
- compile
- _helpers
- assembly
- attachment
- config
- explicit_references
- refs
- scenarios
- sql_tests
- classes
- main
- discovery/_helpers
- integrations
- yml
- pipeline/main
- planner
- _helpers
- changes
- output
- sql_tests
- classes
- scopes
- _helpers
- main
- sql_analysis
- _helpers
- main
- lint/main
- rule_engine/_helpers/run
- tests
- e2e/src/sqlbuild/cli/commands/main
- build
- compile
- scenario
- test
- integration/src/sqlbuild
- cli/commands/main
- compiler/pipeline
- executor/build
- concurrent
- integrations/dbt
- unit/src/sqlbuild
- cli/commands/main/entry
- compiler
- compile/_helpers
- discovery/_helpers
- planner/_helpers
- changes
- sql_analysis
- _helpers
- main
- integrations/dbt
- lint
- website/src/content/docs/docs
- cli
- concepts
- models
- rules
- integrations
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| 472 | + | |
472 | 473 | | |
473 | 474 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | | - | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
| 131 | + | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 148 | + | |
| 149 | + | |
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
| |||
0 commit comments