Skip to content

Commit 1640fbd

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/native-cte-facts
2 parents a9e63bb + 509d559 commit 1640fbd

42 files changed

Lines changed: 2106 additions & 318 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.

‎.github/workflows/pull-request-metadata.yml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: Pull Request Metadata
22
run-name: >-
33
${{ inputs.request_id && format('{0} [{1}]', github.workflow, inputs.request_id)
4-
|| github.event.pull_request.title || github.event.head_commit.message || github.workflow }}
4+
|| github.event.pull_request.title || github.event.head_commit.message
5+
|| github.event.merge_group.head_commit.message || github.workflow }}
56
67
on:
78
pull_request:
89
types: [opened, edited, synchronize, reopened]
10+
merge_group:
911
workflow_dispatch:
1012
inputs:
1113
pr_number:
@@ -26,8 +28,16 @@ jobs:
2628
name: Pull Request Metadata
2729
runs-on: ubuntu-24.04
2830
steps:
31+
# The queue only admits pull requests whose metadata check already passed, so a merge group
32+
# reports success instead of skipping: a required check must report for the queue to merge.
33+
- name: Accept metadata validated on the pull request
34+
if: github.event_name == 'merge_group'
35+
run: echo "Pull request metadata was validated on the pull request before it was queued."
36+
2937
- uses: actions/checkout@v4
38+
if: github.event_name != 'merge_group'
3039
- name: Resolve pull request metadata
40+
if: github.event_name != 'merge_group'
3141
env:
3242
EVENT_NAME: ${{ github.event_name }}
3343
GH_TOKEN: ${{ github.token }}
@@ -41,6 +51,7 @@ jobs:
4151
fi
4252
4353
- name: Validate branch, title, and description
54+
if: github.event_name != 'merge_group'
4455
env:
4556
PR_METADATA_PATH: ${{ runner.temp }}/pull-request.json
4657
run: python -m scripts.validate_pr_metadata --metadata-file "${PR_METADATA_PATH}"

‎.github/workflows/verify.yml‎

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ name: Verify
22

33
on:
44
pull_request:
5+
merge_group:
56
workflow_dispatch:
67

78
permissions:
89
contents: read
910

11+
# Each merge group has its own gh-readonly-queue ref, so queued groups never cancel each other; the
12+
# queue itself discards a group's run when it rebuilds the group.
1013
concurrency:
11-
group: verify-${{ github.workflow }}-${{ github.ref }}
12-
cancel-in-progress: true
14+
group: verify-${{ github.workflow }}-${{ github.event.merge_group.head_ref || github.ref }}
15+
cancel-in-progress: ${{ github.event_name != 'merge_group' }}
1316

1417
jobs:
1518
changes:
@@ -32,8 +35,8 @@ jobs:
3235
id: scope
3336
env:
3437
EVENT_NAME: ${{ github.event_name }}
35-
BASE_SHA: ${{ github.event.pull_request.base.sha }}
36-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
38+
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
39+
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
3740
run: |
3841
write_scope() {
3942
{
@@ -48,7 +51,19 @@ jobs:
4851
} >> "${GITHUB_OUTPUT}"
4952
}
5053
51-
if [[ "${EVENT_NAME}" != "pull_request" ]]; then
54+
if [[ "${EVENT_NAME}" != "pull_request" && "${EVENT_NAME}" != "merge_group" ]]; then
55+
write_scope true true true true true true true true
56+
exit 0
57+
fi
58+
59+
# A merge group's head is its base plus every queued pull request ahead of and including
60+
# this one, so the base..head diff covers the whole group. Anything that prevents an exact
61+
# diff runs everything rather than risk skipping a suite. Three dots compare with the merge
62+
# base, so changes that landed on main after a branch started are not counted as its own.
63+
changed_paths="${RUNNER_TEMP}/changed-paths"
64+
if [[ -z "${BASE_SHA}" || -z "${HEAD_SHA}" ]] || \
65+
! git diff --name-only -z "${BASE_SHA}...${HEAD_SHA}" > "${changed_paths}"; then
66+
echo "Could not diff ${BASE_SHA:-<none>}...${HEAD_SHA:-<none>}; running every suite" >&2
5267
write_scope true true true true true true true true
5368
exit 0
5469
fi
@@ -135,9 +150,7 @@ jobs:
135150
broad=true
136151
;;
137152
esac
138-
# Three dots: compare with the merge base, so changes that landed on main after the branch
139-
# started are not counted as this pull request's changes.
140-
done < <(git diff --name-only -z "${BASE_SHA}...${HEAD_SHA}")
153+
done < "${changed_paths}"
141154
142155
if [[ "${changed}" != "true" ]]; then
143156
write_scope true true true true true true true true
@@ -590,7 +603,7 @@ jobs:
590603
- name: Check out the comparison base
591604
uses: actions/checkout@v4
592605
with:
593-
ref: ${{ github.event.pull_request.base.sha || 'main' }}
606+
ref: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'main' }}
594607
path: base
595608
- uses: astral-sh/setup-uv@v5
596609
with:

‎.github/workflows/version-guard.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Version Guard
22
run-name: >-
33
${{ inputs.request_id && format('{0} [{1}]', github.workflow, inputs.request_id)
4-
|| github.event.pull_request.title || github.event.head_commit.message || github.workflow }}
4+
|| github.event.pull_request.title || github.event.head_commit.message
5+
|| github.event.merge_group.head_commit.message || github.workflow }}
56
67
on:
78
pull_request:
@@ -10,6 +11,8 @@ on:
1011
push:
1112
branches:
1213
- main
14+
# Checks out the merge group's head, so the version that would land on main is the one checked.
15+
merge_group:
1316
workflow_dispatch:
1417
inputs:
1518
request_id:

‎.release-please-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.149.0"
2+
".": "0.150.0"
33
}

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## [0.150.0](https://github.com/chio-labs/sqlbuild/compare/v0.149.0...v0.150.0) (2026-10-09)
4+
5+
6+
### Features
7+
8+
* **native:** enrich analysis inputs natively behind the preview engine ([#1055](https://github.com/chio-labs/sqlbuild/issues/1055)) ([762eac9](https://github.com/chio-labs/sqlbuild/commit/762eac9e424d436a43b6d2238cbfe0115d9739c1))
9+
* **native:** run metadata checks natively behind the preview engine ([#1058](https://github.com/chio-labs/sqlbuild/issues/1058)) ([9a8e410](https://github.com/chio-labs/sqlbuild/commit/9a8e4109599d9a4a42ab02aba1d412bb3e8db5dc))
10+
* **native:** validate contracts natively behind the preview engine ([#1054](https://github.com/chio-labs/sqlbuild/issues/1054)) ([b930183](https://github.com/chio-labs/sqlbuild/commit/b93018345c9acc4d13000fd86ae5d1963d46bd4c))
11+
312
## [0.149.0](https://github.com/chio-labs/sqlbuild/compare/v0.148.0...v0.149.0) (2026-10-09)
413

514

‎Cargo.lock‎

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

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ python-boundary = "sqlbuild-python"
3737
polyglot-floor = "sqlbuild-analysis"
3838

3939
[workspace.package]
40-
version = "0.149.0"
40+
version = "0.150.0"
4141
edition = "2024"
4242
license = "Apache-2.0"
4343
publish = false
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//! Projections of planned SQL tests into the facts the compiler reports.
2+
3+
use std::collections::HashSet;
4+
5+
use crate::compiler::models::SqlTestPlan;
6+
7+
const ERROR_SEVERITY: &str = "error";
8+
const DEFAULT_WORKERS: usize = 4;
9+
10+
/// Each distinct error-severity warning message of one planned test, in warning order.
11+
pub(crate) fn error_messages(plan: &SqlTestPlan) -> Vec<String> {
12+
let mut seen: HashSet<&str> = HashSet::new();
13+
plan.warnings
14+
.iter()
15+
.filter(|warning| warning.severity == ERROR_SEVERITY)
16+
.filter(|warning| seen.insert(warning.message.as_str()))
17+
.map(|warning| warning.message.clone())
18+
.collect()
19+
}
20+
21+
pub(crate) fn default_workers() -> usize {
22+
DEFAULT_WORKERS
23+
}
24+
25+
pub(crate) fn default_true() -> bool {
26+
true
27+
}
28+
29+
pub(crate) fn default_set_difference() -> String {
30+
"EXCEPT".to_string()
31+
}

‎crates/sqlbuild-analysis/src/compiler/_helpers/sql_tests/mod.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pub mod cte_slices;
44
pub mod cte_sql;
55
pub mod expected_columns;
66
pub mod extraction;
7+
pub mod glue;
78
pub mod helper_names;
89
pub mod helper_scope;
910
pub mod markers;

0 commit comments

Comments
 (0)