Skip to content

fix(queries): defer expensive projection + functions follow-up #349

fix(queries): defer expensive projection + functions follow-up

fix(queries): defer expensive projection + functions follow-up #349

Workflow file for this run

name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Incremental compilation bloats the cache without helping CI (no warm
# incremental state across runs). Disabling it makes target/ smaller.
CARGO_INCREMENTAL: "0"
jobs:
fmt:
name: Format
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
# rustfmt.toml uses nightly-only options (wrap_comments, imports_granularity,
# group_imports, format_code_in_doc_comments, normalize_doc_attributes,
# empty_item_single_line, struct_field_align_threshold). Stable fmt
# silently drops them and reformats differently → CI mismatch.
# rust-toolchain.toml pins to stable, so install nightly *and* invoke it
# explicitly with `+nightly` so cargo doesn't fall back to the pinned channel.
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo +nightly fmt --all --check
# Sentinel: fail the build if a future `cargo vendor` / manual resync
# silently reverts the vendored datafusion-postgres patches that
# power the per-query optimize skip. See PATCHES.md for the recipe.
- name: vendor patches still applied
run: |
set -euo pipefail
grep -q 'was_pre_optimized' vendor/datafusion-postgres/src/hooks/mod.rs \
|| { echo "vendored hooks/mod.rs lost was_pre_optimized — see vendor/datafusion-postgres/PATCHES.md"; exit 1; }
grep -q 'was_pre_optimized' vendor/datafusion-postgres/src/handlers.rs \
|| { echo "vendored handlers.rs lost the optimize-skip patch — see vendor/datafusion-postgres/PATCHES.md"; exit 1; }
# Combined clippy + test. `cargo clippy` implies `cargo check`, and both
# share ~all artifacts with `cargo test` — running them in one job lets
# them reuse target/ instead of recompiling the world per-job.
build-test:
name: Clippy & Test
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 25
env:
AWS_SDK_LOAD_CONFIG: "false"
AWS_ENDPOINT_URL: http://127.0.0.1:9000
AWS_REGION: us-east-1
AWS_S3_BUCKET: timefusion-test
AWS_S3_ENDPOINT: http://127.0.0.1:9000
AWS_ALLOW_HTTP: "true"
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
PGWIRE_PORT: "12345"
PORT: "8080"
TIMEFUSION_TABLE_PREFIX: timefusion-ci-test
BATCH_INTERVAL_MS: "1000"
MAX_BATCH_SIZE: "1000"
ENABLE_BATCH_QUEUE: "true"
MAX_PG_CONNECTIONS: "100"
AWS_S3_LOCKING_PROVIDER: ""
WALRUS_DATA_DIR: /tmp/walrus-wal
# Use small cache sizes for CI tests (similar to test_config in object_store_cache.rs)
TIMEFUSION_FOYER_MEMORY_MB: "10"
TIMEFUSION_FOYER_DISK_MB: "50"
TIMEFUSION_FOYER_METADATA_MEMORY_MB: "10"
TIMEFUSION_FOYER_METADATA_DISK_MB: "50"
TIMEFUSION_FOYER_SHARDS: "2"
steps:
- name: Free disk space
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
# `public.ecr.aws/bitnami/minio` was withdrawn (Bitnami consolidated registries).
# GitHub Actions `services:` can't override the entrypoint to pass `server /data`
# to the official quay.io/minio/minio image, so start it manually and seed the
# buckets that the bitnami image used to auto-create via MINIO_DEFAULT_BUCKETS.
- name: Start MinIO
run: |
# Pinned to a known-good release so a breaking upstream tag doesn't silently break CI.
MINIO_IMAGE=quay.io/minio/minio:RELEASE.2025-04-22T22-12-26Z
MC_IMAGE=quay.io/minio/mc:RELEASE.2025-04-16T18-13-26Z
docker run -d --name minio \
-p 9000:9000 -p 9001:9001 \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin \
"$MINIO_IMAGE" server /data --console-address ":9001"
# `set -e` (GH Actions default) makes `curl && break` abort the script on the
# first failed curl, so we wrap the polling in an `if` instead.
for _ in {1..60}; do
if curl -sf http://localhost:9000/minio/health/live; then
break
fi
sleep 1
done
if ! curl -sf http://localhost:9000/minio/health/live; then
echo "MinIO failed to become healthy after 60s"
docker logs minio
exit 1
fi
# mc image's ENTRYPOINT is `mc` itself, so we override to /bin/sh to run a
# multi-command script. (Without --entrypoint, `mc sh -c '...'` is what runs
# and mc rejects `sh` as an unknown subcommand.)
docker run --rm --network host --entrypoint /bin/sh "$MC_IMAGE" -c '
mc alias set local http://localhost:9000 minioadmin minioadmin &&
mc mb -p local/timefusion-test local/timefusion-tests'
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
shared-key: build-test
- name: Clippy
run: cargo clippy --all-targets --all-features --locked -- -D warnings
- name: Test
run: cargo test --all-features --locked
# E2E suite: full pgwire → BufferedWriteLayer → WAL → Delta path against a
# per-test MinIO via testcontainers. Runs in its own job so failures are
# attributable and the suite can be made a required check independently.
e2e:
name: E2E
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 30
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: "0"
steps:
- name: Free disk space
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
shared-key: e2e
- name: E2E
# --test-threads=1: walrus-rust reads WALRUS_DATA_DIR from process
# env, so per-test WAL isolation requires serialization.
run: cargo test --test e2e --features e2e --locked -- --test-threads=1 --nocapture