Skip to content

Commit 3628fa2

Browse files
committed
feat!: failing locations impossible to miss, cursor windows per model, folder roots in the UI
Upgrade the server, its schedulers, every location and every worker together: 1. Run `sqb compile` on each project with this release: it now resolves job and sensor selectors (D017), which a location only checked when publishing. 2. Upgrade the server and schedulers, then every location and worker. 3. Container health checks: use `sqb location health --allow-starting` for liveness, so a location loading its first snapshot isn't restarted. Deploy readiness checks keep the plain command and wait for exit 0. feat!: the server alone computes a location's health state, and serves it feat: a failing location shows a banner on every page, a "Location failing" item on the Overview, its state on the Locations pages, and a location_failing platform event fix: resolve job and sensor selectors at compile, as a location does when it publishes fix(cli): report starting until a restarted location's own first load finishes fix: order a location's load reports by arrival, so a later publication clears earlier failures fix: fail plans at once with the load error when a location can't load the current code fix(cli): a crashed discovered-set check discovers again, so its failure is reported fix: a location that can't get its next generation number reports a failed load fix: a full build binds cursor intrinsics to the whole cursor range instead of refusing fix: one model's planning error no longer fails the whole plan fix: clamp an explicit cursor window to each model's cursor_start fix(ui): group the catalog and overview by folders below sql/ and python/nodes/ fix(server): name cost folders as the catalog does and offer only selectable path folders fix(ui): make each Cost drill one navigation, so Back right after drilling goes up fix: compute one build status per node on the server and render it on every page fix(cli): keep publication records off sqb dev's stdout fix(deps): upgrade to SQLQuack 0.23.1 and SQLClean 0.12.1 test: fix the duckshop benchmarks for SQLClean 0.12 findings and the sql/ layout, and stale tests for the new health shape BREAKING CHANGE: location health and planning report failures they used to hide. - GET /api/control/locations/{location_id}/targets/{target}/health returns {"state": ..., "observations": [...]} instead of a bare array of observations. - `sqb location health` exits 0 only when healthy. discovery_failed, degraded and the new change_plan_failed exit 1, the new starting state exits 3 (0 with --allow-starting), and 2 still means the state couldn't be read. A location's state is ordered by when its reports arrived, not by generation number. - `sqb compile` fails with D017 on a job or sensor selector a location would refuse to publish, such as a path selector without its sql/models/ or python/nodes/ root. - `sqb plan` exits 1 when any model can't be planned; that model's row has action "error" with error {code, message, help}, and the plan has has_errors: true. Compile, validation and source errors (S4xx) still fail the whole plan. Builds still refuse a selection containing a model that can't be planned. - A non-microbatch full build no longer fails with S204 on __cursor_start()/__cursor_end(): they bind to the model's cursor_start (or the cursor type's lowest value) and the type's highest value. - An explicit --start-cursor-ts/--end-cursor-ts window is clamped to each model's cursor_start, and a model whose floor is after the window is skipped with a reason; P001 is raised only when the window leaves nothing to build across the selection. Refs CHI-1657, CHI-1659, CHI-1660, CHI-1662, CHI-1665, CHI-1666
1 parent e1f92ba commit 3628fa2

237 files changed

Lines changed: 5172 additions & 866 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -213,24 +213,24 @@ sqlbuild-scopes = { path = "crates/sqlbuild-scopes" }
213213
sqlbuild-sqltext = { path = "crates/sqlbuild-sqltext" }
214214
sqlbuild-state = { path = "crates/sqlbuild-state" }
215215
# SQL lint Rules, quality Rules and the formatter.
216-
sqlclean = { git = "https://github.com/sqlstack-io/sqlclean.git", rev = "8550e6a45c95a4a9e8470a570ae786d6f0deee8e" }
216+
sqlclean = { git = "https://github.com/sqlstack-io/sqlclean.git", rev = "462a98779a2a11ff11884ff79feefbfb190ab8d1" }
217217
# SQL change fingerprints over SQLQuack's tokenizers.
218-
sqlquack-fingerprint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
218+
sqlquack-fingerprint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
219219
# Scopes, name resolution, types and lineage for the native analysis route.
220-
sqlquack-semantics = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174", features = ["bigquery", "clickhouse", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
220+
sqlquack-semantics = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d", features = ["bigquery", "clickhouse", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
221221
# SQLQuack's Snowflake-family parser and tokenizer, reached as SQLQuack exposes them.
222-
sqlquack-parse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
222+
sqlquack-parse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
223223
# SQLQuack's syntax tree and lossless tokens.
224-
sqlquack-syntax = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
224+
sqlquack-syntax = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
225225
# SQLQuack's tokenizer: lossless tokens and tokenize failures.
226-
sqlquack-tokenize = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
227-
sqlquack-syntax-bigquery = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
228-
sqlquack-syntax-clickhouse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
229-
sqlquack-syntax-databricks = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
230-
sqlquack-syntax-duckdb = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
231-
sqlquack-syntax-postgres = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
232-
sqlquack-syntax-sqlite = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
233-
sqlquack-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
226+
sqlquack-tokenize = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
227+
sqlquack-syntax-bigquery = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
228+
sqlquack-syntax-clickhouse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
229+
sqlquack-syntax-databricks = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
230+
sqlquack-syntax-duckdb = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
231+
sqlquack-syntax-postgres = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
232+
sqlquack-syntax-sqlite = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
233+
sqlquack-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
234234
stacker = "0.1"
235235
# Counts heap allocations in growth tests, which measure work instead of time.
236236
stats_alloc = "0.1"

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ E2E_DUCKDB_BUILD_INCREMENTAL_PATHS := \
184184
tests/e2e/src/sqlbuild/cli/commands/main/build/test_capped_microbatch_build.py \
185185
tests/e2e/src/sqlbuild/cli/commands/main/build/test_changed_builds.py \
186186
tests/e2e/src/sqlbuild/cli/commands/main/build/test_concurrent_microbatch_build.py \
187+
tests/e2e/src/sqlbuild/cli/commands/main/build/test_cursor_window_floors.py \
187188
tests/e2e/src/sqlbuild/cli/commands/main/build/test_cursor_observations.py \
188189
tests/e2e/src/sqlbuild/cli/commands/main/build/test_cursor_runtime_failures.py \
189190
tests/e2e/src/sqlbuild/cli/commands/main/build/test_dropped_relation_rebuild.py \

‎benchmarks/duckshop-10k/README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ iteration. `checksum.txt` records the full profile only.
2626

2727
The generator uses no randomness, clocks or environment: the same generator version always writes
2828
byte-identical files. `checksum.txt` holds the generator version, the file count and the SHA-256 of
29-
`MANIFEST.sha256`, a sorted list of the SHA-256 of every generated file.
29+
`MANIFEST.sha256`, a sorted list of the SHA-256 of every generated file. The generator writes it to
30+
`target/MANIFEST.sha256` in the generated project, beside SQLBuild's local build output, so the
31+
project root holds only project files.
3032

3133
When a change alters any generated file, bump `GENERATOR_VERSION` in `duckshop10k/__init__.py` and
3234
run `python benchmarks/duckshop-10k/generate.py --update-checksum`.
@@ -38,7 +40,7 @@ run `python benchmarks/duckshop-10k/generate.py --update-checksum`.
3840
| Models | 10,840 |
3941
| Staging, intermediate, marts and snapshots | 6,149 (56.7%), 2,519 (23.2%), 2,162 (19.9%), 10 |
4042
| Incremental models | 583, 112 of them with a capped automatic start and 112 renamed |
41-
| Python export assets | 433 in 241 modules sharing one helper module |
43+
| Python export assets | 433, each in its own `asset.py`, sharing one helper module |
4244
| Sources | 2,466 table sources and one expression source |
4345
| Unit tests and scenarios | 288 and 2 |
4446
| Dependency depth | 11 at most; 170 models at depth 7 or more |
@@ -57,7 +59,7 @@ A large project also carries planning workload the layers above barely touch, so
5759
it in the proportions such projects have: an incrementally kept history of every third timestamped
5860
intermediate table, one in five of them capping how far ahead its automatic start may sit and one in
5961
five renamed from an older name with `migrate_from`, and a Python export asset for every fifth
60-
published mart, a few per module, all sharing one helper module. A live plan reads a cursor bound for
62+
published mart, each in its own `asset.py`, all sharing one helper module. A live plan reads a cursor bound for
6163
each incremental model, plans each rename and discovers each Python node.
6264

6365
The models that use `HASH`, `TIMESTAMP_LTZ` or `CURRENT_TIMESTAMP()` are tagged `known_divergence`,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
generator 4 files 11674 sha256 c3a3d8f62a23c4ae770c70ceb5437d849bb32211edb12b6017af25a76fb8d7e2
1+
generator 5 files 11866 sha256 d0b3847b68e1aac09af58422d804badc23d8a880607bb8e2bce2efb11ba1ae6c

‎benchmarks/duckshop-10k/duckshop10k/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
regenerate checksum.txt, whenever a change alters any generated file.
55
"""
66

7-
GENERATOR_VERSION = "4"
7+
GENERATOR_VERSION = "5"
88
SEED = 20261024
99
PROJECT_NAME = "duckshop_10k"

‎benchmarks/duckshop-10k/duckshop10k/manifest.py‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
from duckshop10k import GENERATOR_VERSION
99

10-
MANIFEST_NAME = "MANIFEST.sha256"
10+
# Under the project's local build output, so the project root holds only SQLBuild project files.
11+
MANIFEST_PATH = "target/MANIFEST.sha256"
1112

1213

1314
def manifest(files: dict[str, str]) -> str:
@@ -36,16 +37,17 @@ def write_project(files: dict[str, str], out: Path) -> None:
3637
target = out / path
3738
target.parent.mkdir(parents=True, exist_ok=True)
3839
target.write_bytes(content.encode("utf-8"))
39-
(out / MANIFEST_NAME).write_bytes(manifest(files).encode("utf-8"))
40+
manifest_file = out / MANIFEST_PATH
41+
manifest_file.parent.mkdir(parents=True, exist_ok=True)
42+
manifest_file.write_bytes(manifest(files).encode("utf-8"))
4043

4144

4245
def read_project(out: Path) -> dict[str, str]:
43-
"""Every generated file below `out`, skipping the manifest and local build output."""
44-
skipped = {MANIFEST_NAME}
46+
"""Every generated file below `out`, skipping local build output, which holds the manifest."""
4547
local = ("target/", "logs/", ".sqlbuild/", "sqlbuild_local.toml")
4648
files: dict[str, str] = {}
4749
for path in sorted(out.rglob("*")):
4850
relative = path.relative_to(out).as_posix()
49-
if path.is_file() and relative not in skipped and not relative.startswith(local):
51+
if path.is_file() and not relative.startswith(local):
5052
files[relative] = path.read_bytes().decode("utf-8")
5153
return files

0 commit comments

Comments
 (0)