Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ name: CI
# - code changes run check-ci, the Rust and Python tests, and the replay of the recorded cases,
# which reuses main's judgements for every case whose conversion and recording are unchanged;
# - a change under a full-replay path replays every case.
# The nightly run on main replays every case, refreshes the replay cache pull requests reuse,
# converts DuckShop within its time budget and fuzzes. Release Please dispatches a full run on
# The nightly run on main replays every case, checks every family's syntax obligations, refreshes
# the replay cache pull requests reuse, converts DuckShop within its time budget and fuzzes; when
# it fails it opens an issue labelled nightly-ci-failure, or comments on the one already open. Release Please dispatches a full run on
# each release pull request's branch, so every release replays every case first.
# A merge queue group runs the same checks as a pull request, scoped against the group's base.
on:
Expand Down Expand Up @@ -79,6 +80,9 @@ jobs:
UV_NO_SYNC: "1"
# The evidence pin check and the result baselines compare with the pull request's base.
EVIDENCE_BASE: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'origin/main' }}
# Pull requests and queue groups check the families their change touches; other runs, which
# have no base to compare with, check every family's syntax obligations.
SYNTAX_OBLIGATIONS_SINCE: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || '' }}
REPLAY: ${{ needs.changes.outputs.replay }}
# The Python tests and the replay take the module and binary from check-merge's gate build.
PYTHON_MODULE_BUILD: gate-build
Expand Down Expand Up @@ -243,3 +247,27 @@ jobs:
name: fuzz-artifacts
path: fuzz/artifacts
if-no-files-found: ignore

nightly-report:
name: Report a failed nightly run
if: failure() && github.event_name == 'schedule'
needs: [changes, site, checks, verify, duckshop, fuzz]
runs-on: ubuntu-24.04
permissions:
issues: write
steps:
- name: Open an issue, or comment on the one already open
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
LABEL: nightly-ci-failure
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
body="The nightly CI run on ${GITHUB_SHA} failed: ${RUN_URL}"
open=$(gh issue list --label "${LABEL}" --state open --json number --jq '.[0].number // empty')
if [[ -n "${open}" ]]; then
gh issue comment "${open}" --body "${body}"
else
gh label create "${LABEL}" --color B60205 --description "The nightly CI run failed" --force
gh issue create --title "Nightly CI failed" --label "${LABEL}" --body "${body}"
fi
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PYTHON_TYPED := scripts tests/unit/scripts python/src $(PYTHON_API_TESTS)
PYTHON_TESTS := tests/unit/scripts $(PYTHON_API_TESTS)
endif

.PHONY: distribution-notices format rust-lint python-check fensu syntax-coverage depth-probe depth-probe-debug instruction-counts instruction-baseline gate-build engine-free bundled-extensions dialect-builds generate-cases generated-cases generate-syntax-cases syntax-cases dialect-cases corpus-rerecord corpus-verdicts corpus-verdicts-baseline generate-referee-cases referee-cases referee-pending translation-files translation-results help pending check-syntax record-syntax check-convert record-convert sql-sizes sql-size-baseline sql-benchmark check-ci check-merge test test-rust test-python python-build python-module python-api python-wheel verify-recorded verify-changed replay-scope test-crate check-pr-metadata evidence-clone evidence-refresh evidence-pin evidence-pin-check clutter-guard census-duckshop fuzz-smoke gate gate-parallel census duckshop-compiled duckshop-measure
.PHONY: distribution-notices format rust-lint python-check fensu syntax-coverage depth-probe depth-probe-debug instruction-counts instruction-baseline gate-build engine-free bundled-extensions dialect-builds generate-cases generated-cases generate-syntax-cases syntax-obligations syntax-cases dialect-cases corpus-rerecord corpus-verdicts corpus-verdicts-baseline generate-referee-cases referee-cases referee-pending translation-files translation-results help pending check-syntax record-syntax check-convert record-convert sql-sizes sql-size-baseline sql-benchmark check-ci check-merge test test-rust test-python python-build python-module python-api python-wheel verify-recorded verify-changed replay-scope test-crate check-pr-metadata evidence-clone evidence-refresh evidence-pin evidence-pin-check clutter-guard census-duckshop fuzz-smoke gate gate-parallel census duckshop-compiled duckshop-measure

format:
cargo fmt --all
Expand Down Expand Up @@ -183,17 +183,28 @@ generated-cases:
# dialect's suite folder until then.
syntax_evidence_dir = $(if $(EVIDENCE_PINNED),$(EVIDENCE_ROOT)/syntax/$(1),$(call suite_dir,syntax,$(1)))

# The syntax-coverage families whose cases and marks scripts/build_syntax_cases.py writes.
# The Snowflake syntax-coverage families, whose obligations, cases and marks the builders write.
SYNTAX_FAMILIES = classes ddl dml expressions functions query scripting security_admin transaction_session utility
SYNTAX_CASE_ARGS = --evidence $(call syntax_evidence_dir,snowflake) \
--receipts $(call syntax_evidence_dir,snowflake)/receipts --held coverage/syntax/held.jsonl \
classes ddl dml expressions functions query scripting security_admin transaction_session utility
$(SYNTAX_FAMILIES)

# Rewrites the Snowflake syntax cases, marks and arity from the obligations and the recorded receipts.
# Once the evidence is pinned the cases go to the clone's working tree, to commit there.
generate-syntax-cases: EVIDENCE = working
generate-syntax-cases:
uv run python -m scripts.build_syntax_cases $(SYNTAX_CASE_ARGS)

# Fails when a Snowflake obligations, withdrawn or elisions file differs from what the builder writes.
# Only the families whose inputs changed since SYNTAX_OBLIGATIONS_SINCE are rebuilt (every family
# when the builder changed); with none changed the target prints that it skipped them all and
# passes. An empty SYNTAX_OBLIGATIONS_SINCE checks every family, as CI's nightly run does.
SYNTAX_OBLIGATIONS_SINCE ?= $(EVIDENCE_BASE)

syntax-obligations:
uv run python -m scripts.build_syntax_obligations_snowflake --check \
$(if $(SYNTAX_OBLIGATIONS_SINCE),--since $(SYNTAX_OBLIGATIONS_SINCE)) $(SYNTAX_FAMILIES)

# Fails when a syntax case, mark or arity file differs from what the committed receipts regenerate.
syntax-cases:
uv run python -m scripts.build_syntax_cases --check $(SYNTAX_CASE_ARGS)
Expand Down Expand Up @@ -225,7 +236,7 @@ referee-pending:
uv run python -m scripts.write_referee_pending $(REFEREE_ARGS)

# The static gate, the first step of `gate`, and the Python API's tests.
check-ci: rust-lint python-check fensu syntax-coverage depth-probe instruction-counts corpus-verdicts evidence-pin-check clutter-guard engine-free bundled-extensions dialect-builds generated-cases syntax-cases dialect-cases referee-cases translation-files python-api distribution-notices replay-scope ## The static gate CI runs.
check-ci: rust-lint python-check fensu syntax-coverage depth-probe instruction-counts corpus-verdicts evidence-pin-check clutter-guard engine-free bundled-extensions dialect-builds generated-cases syntax-obligations syntax-cases dialect-cases referee-cases translation-files python-api distribution-notices replay-scope ## The static gate CI runs.

# Each distribution ships the licence and third-party notices; its copies must match the root files.
distribution-notices:
Expand Down
7 changes: 7 additions & 0 deletions coverage/syntax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ Families: `query`, `dml`, `ddl`, `transaction_session`, `security_admin`, `utili
```sh
python -m scripts.fetch_syntax_docs_snowflake CACHE CACHE/idx/* # private cache, never committed
python -m scripts.build_syntax_catalogue_snowflake --cache CACHE --out coverage/syntax
python -m scripts.build_syntax_obligations_snowflake ddl query # obligations, withdrawn, elisions
```

Rebuild a family's obligations whenever its catalogue, its rows in `limits.toml` or the builder
changes. `make syntax-obligations`, part of `make check-ci`, fails when a committed obligations,
withdrawn or elisions file differs from what the builder writes; it rebuilds only the families
whose inputs or generated files changed since `EVIDENCE_BASE`, and passes when none did. With
`SYNTAX_OBLIGATIONS_SINCE=` (empty) it checks every family, as CI's nightly run does.

Pages with no Markdown export (the per-category command hubs) are fetched as HTML and catalogue
no form. A rebuild keeps every existing id whose (page, grammar) is unchanged. A form whose
grammar changed keeps its id when its natural id is unchanged or when all its earlier signatures
Expand Down
168 changes: 0 additions & 168 deletions coverage/syntax/obligations/ddl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176060,158 +176060,6 @@ required = true
anchor = "doc.sql.create-iceberg-table / Syntax"
note = "a string literal in place of <col_name> (DAY ( 'v1' )), observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o299"
kind = "option_present"
required = true
target = "[ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR (…"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "option present [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR ( <col…, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o300"
kind = "operand_type_class"
required = true
target = "<col_name> in [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> )…"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "a valid identifier, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o301"
kind = "alternative"
required = true
target = "{ <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR (… → <col_name>"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "alternative { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR ( <col_nam… → <col_name>, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o302"
kind = "option_absent"
required = true
target = "[ , { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR ( <col_name> ) |…"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "option absent [ , { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR ( <col_name> ) | MO…, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o303"
kind = "operand_type_class"
required = true
target = "<width> in [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) |…"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "a valid operand, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o304"
kind = "operand_type_class"
required = true
target = "<col_name> in [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> )… #3"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "a valid identifier, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o305"
kind = "alternative"
required = true
target = "{ <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> ,… → TRUNCATE ( <width> , <col_name> )"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "alternative { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_na… → TRUNCATE ( <width> , <col_name> ), observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o306"
kind = "operand_type_class"
required = true
target = "<col_name> in [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> )… #6"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "a valid identifier, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o307"
kind = "alternative"
required = true
target = "{ <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR (… → DAY ( <col_name> )"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "alternative { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR ( … → DAY ( <col_name> ), observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o308"
kind = "operand_type_class"
required = true
target = "<col_name> in [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> )… #5"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "a valid identifier, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o309"
kind = "alternative"
required = true
target = "{ <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR… → MONTH ( <col_name> )"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "alternative { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR … → MONTH ( <col_name> ), observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o310"
kind = "operand_type_class"
required = true
target = "<num_buckets> in [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> ,…"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "a valid integer_literal, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o311"
kind = "operand_type_class"
required = true
target = "<col_name> in [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> )… #2"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "a valid identifier, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o312"
kind = "alternative"
required = true
target = "{ <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> ,… → BUCKET ( <num_buckets> , <col_name> )"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "alternative { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <co… → BUCKET ( <num_buckets> , <col_name> ), observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o313"
kind = "operand_type_class"
required = true
target = "<col_name> in [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> )… #7"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "a valid identifier, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o314"
kind = "alternative"
required = true
target = "{ <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR (… → HOUR ( <col_name> )"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "alternative { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR (… → HOUR ( <col_name> ), observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o315"
kind = "operand_type_class"
required = true
target = "<col_name> in [ PARTITION BY ( { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> )… #4"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "a valid identifier, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o316"
kind = "alternative"
required = true
target = "{ <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR (… → YEAR ( <col_name> )"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "alternative { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR (… → YEAR ( <col_name> ), observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o317"
kind = "option_present"
required = true
target = "[ , { <col_name> | BUCKET ( <num_buckets> , <col_name> ) | TRUNCATE ( <width> , <col_name> ) | YEAR ( <col_name> ) |…"
anchor = "doc.sql.create-iceberg-table / Syntax / External Iceberg catalog / Iceberg REST in a catalog-linked database"
note = "the list continued at least once, observed"

[[obligation]]
id = "sf.ddl.create-iceberg-table.table.iceberg-rest-in-a-catalog-linked-database.o318"
kind = "option_present"
Expand Down Expand Up @@ -207727,14 +207575,6 @@ target = "<timestamp> in [ VERIFIED_AT <timestamp> ]"
anchor = "doc.sql.create-semantic-view / Variant syntax / CREATE OR ALTER SEMANTIC VIEW"
note = "a valid operand, observed"

[[obligation]]
id = "sf.ddl.create-semantic-view.create-or-alter-semantic.o505"
kind = "option_present"
required = true
target = "[ , ... ] #7"
anchor = "doc.sql.create-semantic-view / Variant syntax / CREATE OR ALTER SEMANTIC VIEW"
note = "the list continued at least once, observed"

[[obligation]]
id = "sf.ddl.create-semantic-view.create-or-alter-semantic.o506"
kind = "option_present"
Expand Down Expand Up @@ -210935,14 +210775,6 @@ target = "[ <constraint_name> ]"
anchor = "doc.sql.create-semantic-view / Syntax"
note = "option absent [ <constraint_name> ], observed"

[[obligation]]
id = "sf.ddl.create-semantic-view.create-semantic-view-tables.o526"
kind = "option_present"
required = true
target = "[ , ... ] #7"
anchor = "doc.sql.create-semantic-view / Syntax"
note = "the list continued at least once, observed"

[[obligation]]
id = "sf.ddl.create-semantic-view.create-semantic-view-tables.o527"
kind = "option_present"
Expand Down
Loading
Loading