Skip to content

Commit d4243f4

Browse files
authored
Merge branch 'main' into cm/reduce-persisted-entities-transfer-size
2 parents a422dc7 + abd5ba1 commit d4243f4

File tree

157 files changed

+5590
-520
lines changed

Some content is hidden

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

157 files changed

+5590
-520
lines changed

.claude/skills/testing-hashql/SKILL.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ For testing MIR transformation and analysis passes directly with programmaticall
180180
- Edge cases requiring specific MIR structures hard to produce from source
181181
- Benchmarking pass performance
182182

183+
**Key features:**
184+
185+
- Transform passes return `Changed` enum (`Yes`, `No`, `Unknown`) to indicate modifications
186+
- Test harness captures and includes `Changed` value in snapshots for verification
187+
- Snapshot format: before MIR → `Changed: Yes/No/Unknown` separator → after MIR
188+
183189
**Quick Example:**
184190

185191
```rust
@@ -201,10 +207,10 @@ builder
201207
let body = builder.finish(0, TypeBuilder::synthetic(&env).integer());
202208
```
203209

204-
📖 **Full Guide:** [resources/mir-builder-guide.md](resources/mir-builder-guide.md)
210+
📖 **Full Guide:** [references/mir-builder-guide.md](references/mir-builder-guide.md)
205211

206212
## References
207213

208-
- [compiletest Guide](resources/compiletest-guide.md) - Detailed UI test documentation
209-
- [Testing Strategies](resources/testing-strategies.md) - Choosing the right approach
210-
- [MIR Builder Guide](resources/mir-builder-guide.md) - Programmatic MIR construction for tests
214+
- [compiletest Guide](references/compiletest-guide.md) - Detailed UI test documentation
215+
- [Testing Strategies](references/testing-strategies.md) - Choosing the right approach
216+
- [MIR Builder Guide](references/mir-builder-guide.md) - Programmatic MIR construction for tests

.claude/skills/testing-hashql/references/mir-builder-guide.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,11 @@ builder.build_block(bb_merge).ret(x); // x receives value from param
228228

229229
## Test Harness Pattern
230230

231-
Standard pattern used across transform pass tests:
231+
Standard pattern used across transform pass tests. The harness captures and displays
232+
the `Changed` return value to verify pass behavior:
232233

233234
```rust
234-
use std::path::PathBuf;
235+
use std::{io::Write as _, path::PathBuf};
235236
use bstr::ByteVec as _;
236237
use hashql_core::{
237238
pretty::Formatter,
@@ -274,12 +275,16 @@ fn assert_pass<'heap>(
274275
.format(DefIdSlice::from_raw(&bodies), &[])
275276
.expect("should be able to write bodies");
276277

277-
text_format
278-
.writer
279-
.extend(b"\n\n------------------------------------\n\n");
280-
281-
// Run the pass
282-
YourPass::new().run(context, &mut bodies[0]);
278+
// Run the pass and capture change status
279+
let changed = YourPass::new().run(context, &mut bodies[0]);
280+
281+
// Include Changed value in snapshot for verification
282+
write!(
283+
text_format.writer,
284+
"\n\n{:=^50}\n\n",
285+
format!(" Changed: {changed:?} ")
286+
)
287+
.expect("infallible");
283288

284289
// Format after
285290
text_format

.config/mise/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ protoc = "32.1"
1818

1919
# CLI tools
2020
biome = "1.9.5-nightly.ff02a0b"
21+
"cargo:cargo-codspeed" = "4.1.0"
2122
"cargo:cargo-hack" = "0.6.37"
2223
"cargo:cargo-insta" = "1.43.1"
2324
"cargo:cargo-llvm-cov" = "0.6.18"

.github/workflows/codspeed.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CodSpeed Benchmarks
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
# `workflow_dispatch` allows CodSpeed to trigger backtest
9+
# performance analysis in order to generate initial data.
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
id-token: write
15+
16+
jobs:
17+
setup:
18+
runs-on: ubuntu-24.04
19+
permissions:
20+
id-token: write
21+
outputs:
22+
packages: ${{ steps.packages.outputs.packages }}
23+
steps:
24+
- name: Checkout source code
25+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
26+
with:
27+
fetch-depth: 2
28+
29+
- name: Install tools
30+
uses: ./.github/actions/install-tools
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
vault_address: ${{ secrets.VAULT_ADDR }}
34+
rust: false
35+
36+
- name: Determine changed packages that have codspeed
37+
id: packages
38+
run: |
39+
PACKAGES_QUERY='query { affectedPackages(base: "HEAD^" filter: {has: {field: "TASK_NAME", value: "build:codspeed"}}) {items {name path}}}'
40+
PACKAGES=$(turbo query "$PACKAGES_QUERY" \
41+
| jq --compact-output '.data.affectedPackages.items | [(.[] | select(.name != "//"))] | { name: [.[].name], include: . }')
42+
43+
echo "packages=$PACKAGES" | tee -a $GITHUB_OUTPUT
44+
45+
benchmarks:
46+
name: Run benchmarks
47+
needs: [setup]
48+
runs-on: ubuntu-24.04
49+
strategy:
50+
matrix: ${{ fromJSON(needs.setup.outputs.packages) }}
51+
fail-fast: false
52+
if: needs.setup.outputs.packages != '{"name":[],"include":[]}'
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
56+
with:
57+
fetch-depth: 2
58+
59+
- name: Clean up disk
60+
uses: ./.github/actions/clean-up-disk
61+
62+
- name: Install tools
63+
uses: ./.github/actions/install-tools
64+
with:
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
vault_address: ${{ secrets.VAULT_ADDR }}
67+
68+
- name: Prune repository
69+
uses: ./.github/actions/prune-repository
70+
with:
71+
scope: ${{ matrix.name }}
72+
73+
- name: Build the benchmark target
74+
run: turbo run build:codspeed --filter=${{ matrix.name }}
75+
76+
- name: Run the benchmark
77+
uses: CodSpeedHQ/action@346a2d8a8d9d38909abd0bc3d23f773110f076ad # v4.4.1
78+
with:
79+
mode: simulation
80+
run: turbo run test:codspeed --filter=${{ matrix.name }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
3232
with:
3333
publish: yarn changeset publish
34-
version: yarn changeset version && yarn
34+
version: yarn changeset:version
3535
env:
3636
GITHUB_TOKEN: ${{ secrets.MACHINE_USER_TOKEN }}
3737
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ blocks/**/.env
8585
# next.js build output
8686
**/.next
8787

88+
# next.js build output – once upgraded to Next.js 16, this can be removed, as it will be generated in the dist/ directory instead
89+
**/next-env.d.ts
90+
8891
# build files
8992
**/dist
9093
**/build

0 commit comments

Comments
 (0)