Skip to content

Commit 8813e93

Browse files
authored
Merge branch 'cube-js:master' into master
2 parents e609725 + 0d13673 commit 8813e93

File tree

2,429 files changed

+157317
-531535
lines changed

Some content is hidden

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

2,429 files changed

+157317
-531535
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
**
22
!package.json
33
!tsconfig.base.json
4+
!tsconfig.json
45
!rollup.config.js
56
!yarn.lock
67
!lerna.json

.github/actions/codecov-fix.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../" && pwd)"
6+
7+
for path in "$repo_root"/packages/*/coverage/lcov.info; do
8+
[ -f "$path" ] || continue
9+
10+
pkg_dir="$(dirname "$path")" # packages/foo/coverage
11+
pkg_root="$(dirname "$pkg_dir")" # packages/foo
12+
tmp_path="$pkg_dir/lcov.fixed.info"
13+
14+
sed "s|SF:src/|SF:packages/$(basename "$pkg_root")/src/|g" "$path" > "$tmp_path"
15+
done
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
# Debug log for test containers
5+
export DEBUG=testcontainers
6+
7+
export TEST_PRESTO_VERSION=341-SNAPSHOT
8+
export TEST_PGSQL_VERSION=12.4
9+
10+
echo "::group::Trino ${TEST_PRESTO_VERSION} with PostgreSQL ${TEST_PGSQL_VERSION}"
11+
docker pull lewuathe/presto-coordinator:${TEST_PRESTO_VERSION}
12+
docker pull lewuathe/presto-worker:${TEST_PRESTO_VERSION}
13+
docker pull postgres:${TEST_PGSQL_VERSION}
14+
yarn lerna run --concurrency 1 --stream --no-prefix integration:trino
15+
echo "::endgroup::"

.github/workflows/drivers-tests.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,16 @@ on:
5757
# To test SQL API Push down
5858
- 'packages/cubejs-backend-native/**'
5959
- 'rust/cubesql/**'
60-
61-
env:
62-
CUBEJS_TESSERACT_ORCHESTRATOR: true
60+
workflow_dispatch:
61+
inputs:
62+
use_tesseract_sql_planner:
63+
description: 'Enable TESSERACT_SQL_PLANNER?'
64+
required: true
65+
default: 'false'
66+
type: choice
67+
options:
68+
- 'true'
69+
- 'false'
6370

6471
jobs:
6572
latest-tag-sha:
@@ -205,6 +212,7 @@ jobs:
205212
athena-export-bucket-s3
206213
bigquery-export-bucket-gcs
207214
clickhouse-export-bucket-s3
215+
clickhouse-export-bucket-s3-prefix
208216
databricks-jdbc
209217
databricks-jdbc-export-bucket-s3
210218
databricks-jdbc-export-bucket-s3-prefix
@@ -217,9 +225,12 @@ jobs:
217225
snowflake
218226
snowflake-encrypted-pk
219227
snowflake-export-bucket-s3
228+
snowflake-export-bucket-s3-prefix
220229
snowflake-export-bucket-azure
230+
snowflake-export-bucket-azure-prefix
221231
snowflake-export-bucket-azure-via-storage-integration
222232
snowflake-export-bucket-gcs
233+
snowflake-export-bucket-gcs-prefix
223234
# As per docs:
224235
# Secrets cannot be directly referenced in if: conditionals. Instead, consider setting
225236
# secrets as job-level environment variables, then referencing the environment variables
@@ -232,6 +243,7 @@ jobs:
232243
- bigquery-export-bucket-gcs
233244
- clickhouse
234245
- clickhouse-export-bucket-s3
246+
- clickhouse-export-bucket-s3-prefix
235247
- databricks-jdbc
236248
- databricks-jdbc-export-bucket-s3
237249
- databricks-jdbc-export-bucket-s3-prefix
@@ -247,9 +259,20 @@ jobs:
247259
- snowflake
248260
- snowflake-encrypted-pk
249261
- snowflake-export-bucket-s3
262+
- snowflake-export-bucket-s3-prefix
250263
- snowflake-export-bucket-azure
264+
- snowflake-export-bucket-azure-prefix
251265
- snowflake-export-bucket-azure-via-storage-integration
252266
- snowflake-export-bucket-gcs
267+
- snowflake-export-bucket-gcs-prefix
268+
use_tesseract_sql_planner: [ false ]
269+
include:
270+
- database: postgres
271+
use_tesseract_sql_planner: true
272+
- database: bigquery-export-bucket-gcs
273+
use_tesseract_sql_planner: true
274+
- database: athena-export-bucket-s3
275+
use_tesseract_sql_planner: true
253276
fail-fast: false
254277

255278
steps:
@@ -316,6 +339,8 @@ jobs:
316339
(contains(env.CLOUD_DATABASES, matrix.database) && env.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY != '') ||
317340
(!contains(env.CLOUD_DATABASES, matrix.database))
318341
env:
342+
DRIVERS_TESTS_CUBEJS_TESSERACT_SQL_PLANNER: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.use_tesseract_sql_planner) || matrix.use_tesseract_sql_planner }}
343+
319344
# Athena
320345
DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY: ${{ secrets.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY }}
321346
DRIVERS_TESTS_ATHENA_CUBEJS_AWS_SECRET: ${{ secrets.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_SECRET }}
@@ -335,6 +360,8 @@ jobs:
335360
DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_TOKEN: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_TOKEN }}
336361
DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AWS_KEY: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AWS_KEY }}
337362
DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AWS_SECRET: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AWS_SECRET }}
363+
DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_OAUTH_CLIENT_ID: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_OAUTH_CLIENT_ID }}
364+
DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_OAUTH_CLIENT_SECRET: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_OAUTH_CLIENT_SECRET }}
338365

339366
# Redshift
340367
DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_HOST: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_HOST }}

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
ref: 'main',
156156
inputs: {
157157
'cube-image': 'cubejs/cube:dev',
158-
'source-repo': context.repo.repo,
158+
'source-repo': `${context.repo.owner}/${context.repo.repo}`,
159159
'source-pr-url': prUrl,
160160
'source-commit-url': commitUrl,
161161
'initiator': '${{ github.actor }}'

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ jobs:
242242
matrix:
243243
node-version: [22.x]
244244
python-version: ["fallback"]
245-
os-version: [windows-2019]
245+
os-version: [windows-2022]
246246
include:
247-
- os-version: windows-2019
247+
- os-version: windows-2022
248248
package_target_arch: x64
249249
package_target_platform: win32
250250
package_target_libc: unknown
@@ -670,7 +670,7 @@ jobs:
670670
- aarch64-apple-darwin
671671
include:
672672
- target: x86_64-pc-windows-msvc
673-
os: windows-2019
673+
os: windows-2022
674674
executable_name: cubestored.exe
675675
strip: true
676676
# cubestored.exe: CantPackException: superfluous data between sections

.github/workflows/push.yml

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- 'package.json'
2020
- 'lerna.json'
2121
- 'rollup.config.js'
22+
- 'jest.base.config.js'
2223
- 'yarn.lock'
2324
branches:
2425
- 'master'
@@ -40,6 +41,7 @@ on:
4041
- 'package.json'
4142
- 'lerna.json'
4243
- 'rollup.config.js'
44+
- 'jest.base.config.js'
4345
- 'yarn.lock'
4446

4547
env:
@@ -118,15 +120,21 @@ jobs:
118120
run: yarn build
119121
- name: Lerna test
120122
run: yarn lerna run --concurrency 1 --stream --no-prefix unit
121-
- name: Upload coverage reports to Codecov
122-
uses: codecov/codecov-action@v5
123-
if: (matrix.node-version == '22.x')
124-
with:
125-
token: ${{ secrets.CODECOV_TOKEN }}
126-
files: ./packages/*/coverage/*
127-
verbose: true
128-
flags: cube-backend
129-
fail_ci_if_error: false
123+
- name: Fix lcov paths
124+
if: (matrix.node-version == '22.x' && matrix.transpile-worker-threads == true)
125+
run: |
126+
./.github/actions/codecov-fix.sh
127+
- name: Combine all fixed LCOV files
128+
if: (matrix.node-version == '22.x' && matrix.transpile-worker-threads == true)
129+
run: |
130+
echo "" > ./combined-unit.lcov
131+
find ./packages -type f -name lcov.fixed.info -exec cat {} + >> ./combined-unit.lcov || true
132+
- name: Upload coverage artifact
133+
if: (matrix.node-version == '22.x' && matrix.transpile-worker-threads == true)
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: coverage-unit
137+
path: ./combined-unit.lcov
130138

131139
lint:
132140
runs-on: ubuntu-24.04
@@ -404,10 +412,15 @@ jobs:
404412
matrix:
405413
node-version: [22.x]
406414
db: [
407-
'athena', 'bigquery', 'snowflake',
415+
'athena', 'bigquery', 'snowflake', 'trino',
408416
'clickhouse', 'druid', 'elasticsearch', 'mssql', 'mysql', 'postgres', 'prestodb',
409417
'mysql-aurora-serverless', 'crate', 'mongobi', 'firebolt', 'dremio', 'vertica'
410418
]
419+
use_tesseract_sql_planner: [ false ]
420+
include:
421+
- db: postgres
422+
node-version: 22.x
423+
use_tesseract_sql_planner: true
411424
fail-fast: false
412425

413426
steps:
@@ -473,6 +486,8 @@ jobs:
473486
(contains(env.CLOUD_DATABASES, matrix.db) && env.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY != '') ||
474487
(!contains(env.CLOUD_DATABASES, matrix.db))
475488
env:
489+
CUBEJS_TESSERACT_SQL_PLANNER: ${{ matrix.use_tesseract_sql_planner }}
490+
476491
# Firebolt Integration
477492
DRIVERS_TESTS_FIREBOLT_CUBEJS_FIREBOLT_ENGINE_NAME: ${{ secrets.DRIVERS_TESTS_FIREBOLT_CUBEJS_FIREBOLT_ENGINE_NAME }}
478493
DRIVERS_TESTS_FIREBOLT_CUBEJS_DB_NAME: ${{ secrets.DRIVERS_TESTS_FIREBOLT_CUBEJS_DB_NAME }}
@@ -494,6 +509,18 @@ jobs:
494509
# Snowflake
495510
DRIVERS_TESTS_SNOWFLAKE_CUBEJS_DB_USER: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_SNOWFLAKE_USER }}
496511
DRIVERS_TESTS_SNOWFLAKE_CUBEJS_DB_PASS: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_SNOWFLAKE_PASS }}
512+
- name: Fix lcov paths
513+
run: |
514+
./.github/actions/codecov-fix.sh
515+
- name: Combine all fixed LCOV files
516+
run: |
517+
echo "" > ./combined-integration-${{ matrix.db }}-${{ matrix.use_tesseract_sql_planner }}.lcov
518+
find ./packages -type f -name lcov.fixed.info -exec cat {} + >> ./combined-integration-${{ matrix.db }}.lcov || true
519+
- name: Upload coverage artifact
520+
uses: actions/upload-artifact@v4
521+
with:
522+
name: coverage-integration-${{ matrix.db }}-${{ matrix.use_tesseract_sql_planner }}
523+
path: ./combined-integration-${{ matrix.db }}-${{ matrix.use_tesseract_sql_planner }}.lcov
497524

498525
integration-smoke:
499526
needs: [latest-tag-sha, build-cubestore, build-native-linux]
@@ -776,3 +803,29 @@ jobs:
776803
with:
777804
name: cypress-screenshots-docker-dev-${{ matrix.name }}
778805
path: packages/cubejs-testing/cypress/screenshots
806+
807+
upload-coverage:
808+
name: Upload merged coverage to Codecov
809+
needs: [unit, integration]
810+
runs-on: ubuntu-latest
811+
permissions:
812+
contents: read
813+
actions: read
814+
steps:
815+
- name: Install Codecov CLI
816+
run: |
817+
curl -Os https://uploader.codecov.io/latest/linux/codecov
818+
chmod +x codecov
819+
- name: Download all coverage artifacts
820+
uses: actions/download-artifact@v4
821+
with:
822+
path: all-coverage
823+
- name: Merge all coverage files
824+
run: |
825+
find all-coverage -name '*.lcov' -exec cat {} + > merged-coverage.info
826+
- name: Upload merged coverage to Codecov
827+
run: |
828+
./codecov --token "${{ secrets.CODECOV_TOKEN }}" \
829+
--file ./merged-coverage.info \
830+
--flags cube-backend \
831+
--name "cube backend coverage"

.github/workflows/rust-cubesql.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ jobs:
5757
run: cd packages/cubejs-backend-native && cargo clippy --locked --workspace --all-targets --keep-going -- -D warnings
5858
- name: Clippy Native (with Python)
5959
run: cd packages/cubejs-backend-native && cargo clippy --locked --workspace --all-targets --keep-going --features python -- -D warnings
60+
- name: Clippy cubenativeutils
61+
run: cd rust/cubenativeutils && cargo clippy --locked --workspace --all-targets --keep-going -- -D warnings
62+
- name: Clippy cubesqlplanner
63+
run: cd rust/cubesqlplanner && cargo clippy --locked --workspace --all-targets --keep-going -- -D warnings
6064

6165
unit:
6266
# We use host instead of cross container, because it's much faster
@@ -85,6 +89,11 @@ jobs:
8589
with:
8690
crate: cargo-llvm-cov
8791
version: "0.6.10"
92+
- name: Install [email protected]
93+
uses: baptiste0928/cargo-install@v3
94+
with:
95+
crate: cargo-insta
96+
version: "1.42.0"
8897
- name: Unit tests (Rewrite Engine)
8998
env:
9099
CUBESQL_TESTING_CUBE_TOKEN: ${{ secrets.CUBESQL_TESTING_CUBE_TOKEN }}
@@ -94,7 +103,11 @@ jobs:
94103
CUBESQL_REWRITE_TIMEOUT: 60
95104
run: |
96105
cd rust/cubesql
97-
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
106+
# See https://github.com/taiki-e/cargo-llvm-cov/blob/main/README.md#get-coverage-of-external-tests
107+
# shellcheck source=/dev/null
108+
source <(cargo llvm-cov show-env --export-prefix)
109+
cargo insta test --all-features --workspace --unreferenced reject
110+
cargo llvm-cov report --lcov --output-path lcov.info
98111
- name: Upload code coverage
99112
uses: codecov/codecov-action@v5
100113
with:
@@ -312,7 +325,7 @@ jobs:
312325
matrix:
313326
# We do not need to test under all versions, we do it under linux
314327
node-version: [22.x]
315-
os-version: [windows-2019]
328+
os-version: [windows-2022]
316329
python-version: ["fallback"]
317330
fail-fast: false
318331

.github/workflows/rust-cubestore-master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ jobs:
189189
- x86_64-apple-darwin
190190
- aarch64-apple-darwin
191191
include:
192-
- os: windows-2019
192+
- os: windows-2022
193193
target: x86_64-pc-windows-msvc
194194
executable_name: cubestored.exe
195195
strip: true

.github/workflows/rust-cubestore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
- x86_64-apple-darwin
115115
- aarch64-apple-darwin
116116
include:
117-
- os: windows-2019
117+
- os: windows-2022
118118
target: x86_64-pc-windows-msvc
119119
executable_name: cubestored.exe
120120
strip: true

0 commit comments

Comments
 (0)