Skip to content

Commit 04f0b64

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 benchmark for SQLClean 0.12 findings and the sql/ layout 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. 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 04f0b64

224 files changed

Lines changed: 5066 additions & 826 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 \
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# A folder, an expansion, a glob, an intersection's name, a job name and a repeated name: one named node.
1+
# A folder, an expansion, a glob, an intersection's name and a repeated name: one named node.
22
name = "orders_folder_job"
33
description = "Selects the orders pipeline without listing it."
4-
select = "sql/models/orders +order_totals stg_* order_totals,tag:orders orders_listed_job order_totals"
4+
select = "sql/models/orders +order_totals stg_* order_totals,tag:orders order_totals"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
MODEL (description "Synthetic orders edge case order_totals");
1+
MODEL (description "Synthetic orders edge case order_totals", tags [orders]);
22
SELECT 1 AS order_id

‎benchmarks/duckshop/project/python/nodes/loaders/_writer.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import yaml
1919

20-
SOURCES_DIR = Path(__file__).resolve().parents[2] / "sql" / "sources"
20+
SOURCES_DIR = Path(__file__).resolve().parents[3] / "sql" / "sources"
2121
BATCH_SIZE = 500
2222
JSON_TYPES = {"VARIANT": "", "OBJECT": "::OBJECT", "ARRAY": "::ARRAY"}
2323

‎benchmarks/duckshop/project/sql/models/intermediate/customers/int_customer_order_sequence.sql‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ WITH orders AS (
2727

2828
valid_orders AS (
2929
SELECT
30-
o.order_id,
31-
o.customer_id,
32-
o.placed_at,
33-
o.placed_date_local,
34-
o.amount_usd,
35-
o.sales_channel
36-
FROM orders AS o
30+
order_id,
31+
customer_id,
32+
placed_at,
33+
placed_date_local,
34+
amount_usd,
35+
sales_channel
36+
FROM orders
3737
WHERE NOT @sql.is_status(@enum("order_status").CANCELLED)
3838
),
3939

‎benchmarks/duckshop/project/sql/models/intermediate/edge_cases/int_edge_amount_bit_reads.sql‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,13 @@ final AS (
107107
(f.group_hash = b.group_hash)::BOOLEAN AS group_hash_is_order_free
108108
FROM checks AS c
109109
INNER JOIN group_sizes AS s
110-
ON c.group_code = s.group_code,
111-
group_names AS n,
112-
hash_forward AS f,
113-
hash_backward AS b
114-
WHERE
115-
n.group_code = c.group_code
116-
AND f.group_code = c.group_code
117-
AND b.group_code = c.group_code
110+
ON c.group_code = s.group_code
111+
INNER JOIN group_names AS n
112+
ON c.group_code = n.group_code
113+
INNER JOIN hash_forward AS f
114+
ON c.group_code = f.group_code
115+
INNER JOIN hash_backward AS b
116+
ON c.group_code = b.group_code
118117
)
119118

120119
SELECT *

‎benchmarks/duckshop/project/sql/models/staging/inventory/stg_stock_movements.sql‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ final AS (
5757
d.moved_at_local,
5858
@sql.json_text(d.metadata:operator) AS operator_id
5959
FROM deduplicated AS d
60-
INNER JOIN effective_ids AS e
61-
ON d.movement_id = e.movement_id
60+
WHERE d.movement_id IN (SELECT e.movement_id FROM effective_ids AS e)
6261
)
6362

6463
SELECT *

‎benchmarks/duckshop/scripts/duckdb_project.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def write_declarations(out: pathlib.Path) -> None:
215215
folders.pop() / "_sqlbuild" / "_enums" if len(folders) == 1 else out / "sql" / "enums"
216216
)
217217
keep[folder / f"{name}.sql"] = types(enums[name].read_text())
218-
for gone in ("tests", "macros", "rules", "constants", "enums"):
218+
for gone in ("tests", "rules", "sql/macros", "sql/constants", "sql/enums"):
219219
shutil.rmtree(out / gone, ignore_errors=True)
220220
for folder in ("_macros", "macros", "constants", "_constants", "enums", "_enums"):
221221
for path in list(out.glob(f"sql/models/**/_sqlbuild/{folder}")):

0 commit comments

Comments
 (0)