Skip to content

Commit 7bb9400

Browse files
authored
Merge branch 'master' into returnUsedPreAggregation
2 parents 5d89ccd + c97526f commit 7bb9400

File tree

1,102 files changed

+263197
-45505
lines changed

Some content is hidden

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

1,102 files changed

+263197
-45505
lines changed

.dockerignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
!rust/cubestore/bin
1212
!rust/cubesql/package.json
1313

14+
# Ignoring builds for native from local machime to protect a problem with different architecture
15+
packages/cubejs-backend-native/index.node
16+
packages/cubejs-backend-native/native/
17+
# Caches
1418
packages/cubejs-backend-native/target
1519
packages/*/node_modules/
1620
packages/*/dist/
1721
packages/*/coverage/
22+
# Other
1823
packages/cubejs-server-core/playground/
19-
packages/cubejs-serverless
20-
packages/cubejs-serverless-aws
21-
packages/cubejs-serverless-google

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ insert_final_newline = true
1111

1212
[*.rs]
1313
indent_size = 4
14+
15+
[rust/cubesql/cubesql/egraph-debug-template/**/*.{js,jsx,ts,tsx}]
16+
indent_size = 4

.github/ISSUE_TEMPLATE/sql_api_query_issue.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: SQL API Query Issue
33
about: Create a report to help us improve
44
title: ''
5-
labels: ''
5+
labels: 'api:sql'
66
assignees: ''
77

88
---
@@ -13,8 +13,11 @@ Search for `Failed SQL` log message.
1313
**Logical Plan**
1414
Search for `Can't rewrite plan` log message.
1515

16+
**Tool**
17+
Was thethe SQL query above generated by some BI tool or any other tool? Did you write it yourself?
18+
1619
**Version:**
17-
[e.g. 0.4.5]
20+
E.g., v1.1.0.
1821

1922
**Additional context**
2023
Add any other context about the problem here.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
# Debug log for test containers
5+
export DEBUG=testcontainers
6+
7+
echo "::group::Dremio [cloud]"
8+
yarn lerna run --concurrency 1 --stream --no-prefix integration:dremio
9+
10+
echo "::endgroup::"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
# Debug log for test containers
5+
export DEBUG=testcontainers
6+
7+
echo "::group::Firebolt [cloud]"
8+
yarn lerna run --concurrency 1 --stream --no-prefix integration:firebolt
9+
10+
echo "::endgroup::"

.github/actions/smoke.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,8 @@ echo "::endgroup::"
5555

5656
echo "::group::MongoBI"
5757
yarn lerna run --concurrency 1 --stream --no-prefix smoke:mongobi
58-
echo "::endgroup::"
58+
echo "::endgroup::"
59+
60+
echo "::group::RBAC"
61+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:rbac
62+
echo "::endgroup::"

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
**Check List**
2-
- [ ] Tests has been run in packages where changes made if available
2+
- [ ] Tests have been run in packages where changes made if available
33
- [ ] Linter has been run for changed code
44
- [ ] Tests for the changes have been added if not covered yet
55
- [ ] Docs have been added / updated if required

.github/workflows/cloud.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757

5858
strategy:
5959
matrix:
60-
node-version: [ 18.x ]
60+
node-version: [ 20.x ]
6161
db: [ 'athena', 'bigquery', 'snowflake' ]
6262
fail-fast: false
6363

@@ -80,7 +80,7 @@ jobs:
8080
restore-keys: |
8181
${{ runner.os }}-yarn-
8282
- name: Set Yarn version
83-
run: yarn policies set-version v1.22.19
83+
run: yarn policies set-version v1.22.22
8484
- name: Yarn install
8585
run: CUBESTORE_SKIP_POST_INSTALL=true yarn install --frozen-lockfile
8686
- name: Build client

.github/workflows/drivers-tests.yml

Lines changed: 89 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
name: Build native Linux ${{ matrix.node-version }} ${{ matrix.target }} Python ${{ matrix.python-version }}
8585
strategy:
8686
matrix:
87-
node-version: [ 18 ]
87+
node-version: [ 20 ]
8888
python-version: [ "fallback" ]
8989
target: [ "x86_64-unknown-linux-gnu" ]
9090
fail-fast: false
@@ -109,7 +109,7 @@ jobs:
109109
- name: Install Yarn
110110
run: npm install -g yarn
111111
- name: Set Yarn version
112-
run: yarn policies set-version v1.22.19
112+
run: yarn policies set-version v1.22.22
113113
- name: Install cargo-cp-artifact
114114
run: npm install -g [email protected]
115115
- uses: Swatinem/rust-cache@v2
@@ -144,6 +144,8 @@ jobs:
144144
if: (needs['latest-tag-sha'].outputs.sha != github.sha)
145145
runs-on: ubuntu-20.04
146146
timeout-minutes: 30
147+
env:
148+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
147149
steps:
148150
- name: Check out the repo
149151
uses: actions/checkout@v4
@@ -154,6 +156,7 @@ jobs:
154156
with:
155157
username: ${{ secrets.DOCKERHUB_USERNAME }}
156158
password: ${{ secrets.DOCKERHUB_TOKEN }}
159+
if: (env.DOCKERHUB_USERNAME != '')
157160
- name: Set up QEMU
158161
uses: docker/setup-qemu-action@v3
159162
- name: Download native build
@@ -167,40 +170,79 @@ jobs:
167170
context: .
168171
file: ./packages/cubejs-docker/testing-drivers.Dockerfile
169172
tags: cubejs/cube:testing-drivers
170-
push: true
173+
push: ${{ (env.DOCKERHUB_USERNAME != '') }}
174+
- name: Save Docker image as artifact
175+
run: |
176+
IMAGE_TAG=cubejs/cube:testing-drivers
177+
docker save -o image.tar $IMAGE_TAG
178+
gzip image.tar
179+
continue-on-error: true
180+
- name: Upload Docker image artifact
181+
uses: actions/upload-artifact@v4
182+
with:
183+
name: docker-image
184+
path: image.tar.gz
171185

172186
tests:
173187
runs-on: ubuntu-20.04
174188
timeout-minutes: 30
175189
needs: [latest-tag-sha, build]
176190
if: (needs['latest-tag-sha'].outputs.sha != github.sha)
191+
env:
192+
CLOUD_DATABASES: >
193+
athena-export-bucket-s3
194+
bigquery-export-bucket-gcs
195+
clickhouse-export-bucket-s3
196+
databricks-jdbc
197+
databricks-jdbc-export-bucket-s3
198+
databricks-jdbc-export-bucket-azure
199+
redshift
200+
redshift-export-bucket-s3
201+
snowflake
202+
snowflake-export-bucket-s3
203+
snowflake-export-bucket-azure
204+
snowflake-export-bucket-azure-via-storage-integration
205+
snowflake-export-bucket-gcs
206+
# As per docs:
207+
# Secrets cannot be directly referenced in if: conditionals. Instead, consider setting
208+
# secrets as job-level environment variables, then referencing the environment variables
209+
# to conditionally run steps in the job.
210+
DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY: ${{ secrets.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY }}
177211
strategy:
178212
matrix:
179213
node:
180-
- 18.x
214+
- 20.x
181215
database:
182-
- athena
183-
- bigquery
216+
- athena-export-bucket-s3
217+
- bigquery-export-bucket-gcs
184218
- clickhouse
219+
- clickhouse-export-bucket-s3
185220
- databricks-jdbc
186-
- databricks-jdbc-export-bucket
221+
- databricks-jdbc-export-bucket-s3
222+
- databricks-jdbc-export-bucket-azure
187223
- mssql
188224
- mysql
189225
- postgres
226+
- redshift
227+
- redshift-export-bucket-s3
190228
- snowflake
229+
- snowflake-export-bucket-s3
230+
- snowflake-export-bucket-azure
231+
- snowflake-export-bucket-azure-via-storage-integration
232+
- snowflake-export-bucket-gcs
191233
fail-fast: false
192234

193235
steps:
194236
- name: Checkout
195237
uses: actions/checkout@v4
196238

197-
- name: Install Node.js 18.x
239+
- name: Install Node.js 20.x
198240
uses: actions/setup-node@v4
199241
with:
200-
node-version: 18.x
242+
node-version: 20.x
201243

202244
- name: Configure `yarn`
203-
run: yarn policies set-version v1.22.19
245+
run: yarn policies set-version v1.22.22
204246

205247
- name: Get yarn cache directory path
206248
id: yarn-cache-dir-path
@@ -237,7 +279,22 @@ jobs:
237279
cd packages/cubejs-testing-drivers
238280
yarn tsc
239281
282+
- name: Download Docker image artifact
283+
uses: actions/download-artifact@v4
284+
with:
285+
name: docker-image
286+
287+
- name: Load Docker image into Docker Daemon
288+
run: |
289+
gunzip image.tar.gz
290+
docker load -i image.tar
291+
240292
- name: Run tests
293+
uses: nick-fields/retry@v3
294+
# It's enough to test for any one secret because they are set all at once or not set all
295+
if: |
296+
(contains(env.CLOUD_DATABASES, matrix.database) && env.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY != '') ||
297+
(!contains(env.CLOUD_DATABASES, matrix.database))
241298
env:
242299
# Athena
243300
DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY: ${{ secrets.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY }}
@@ -246,16 +303,34 @@ jobs:
246303
# BigQuery
247304
DRIVERS_TESTS_CUBEJS_DB_BQ_CREDENTIALS: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_BQ_CREDENTIALS }}
248305

306+
#GCS
307+
DRIVERS_TESTS_CUBEJS_DB_EXPORT_GCS_CREDENTIALS: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_EXPORT_GCS_CREDENTIALS }}
308+
309+
# Azure
310+
DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AZURE_KEY: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AZURE_KEY }}
311+
DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AZURE_SAS_TOKEN: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AZURE_SAS_TOKEN }}
312+
249313
# Databricks
250314
DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_URL: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_URL }}
251315
DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_TOKEN: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_DATABRICKS_TOKEN }}
252316
DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AWS_KEY: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AWS_KEY }}
253317
DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AWS_SECRET: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_EXPORT_BUCKET_AWS_SECRET }}
254318

319+
# Redshift
320+
DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_HOST: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_HOST }}
321+
DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_USER: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_USER }}
322+
DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_PASS: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_PASS }}
323+
255324
# Snowflake
256325
DRIVERS_TESTS_CUBEJS_DB_SNOWFLAKE_USER: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_SNOWFLAKE_USER }}
257326
DRIVERS_TESTS_CUBEJS_DB_SNOWFLAKE_PASS: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_SNOWFLAKE_PASS }}
258-
run: |
259-
cd ./packages/cubejs-testing-drivers
260-
export DEBUG=testcontainers
261-
yarn ${{ matrix.database }}-full
327+
with:
328+
max_attempts: 3
329+
retry_on: error
330+
retry_wait_seconds: 15
331+
timeout_minutes: 20
332+
command: |
333+
cd ./packages/cubejs-testing-drivers
334+
export DEBUG=testcontainers
335+
yarn ${{ matrix.database }}-full
336+

.github/workflows/master.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ jobs:
6464
workspaces: ./rust/cubesql -> target
6565
key: cubesql-x86_64-unknown-linux-gnu
6666
shared-key: cubesql-x86_64-unknown-linux-gnu
67-
- name: Install Node.js 18
67+
- name: Install Node.js 20
6868
uses: actions/setup-node@v4
6969
with:
70-
node-version: 18
70+
node-version: 20
7171
- name: Install Yarn
7272
run: npm install -g yarn
7373
- name: Set Yarn version
74-
run: yarn policies set-version v1.22.19
74+
run: yarn policies set-version v1.22.22
7575
# We don't need to install all yarn deps to build native
7676
- name: Install cargo-cp-artifact
7777
run: npm install -g [email protected]
@@ -137,12 +137,19 @@ jobs:
137137
with:
138138
github-token: ${{ secrets.GH_TRIGGER_TOKEN }}
139139
script: |
140+
const prUrl = context.payload.pull_request ? context.payload.pull_request.html_url : '';
141+
const commitUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/commit/${context.sha}`;
142+
140143
await github.rest.actions.createWorkflowDispatch({
141144
owner: 'cubedevinc',
142145
repo: 'sql-api-test-suite',
143146
workflow_id: 'test_and_run_test_suites.yml',
144147
ref: 'main',
145148
inputs: {
146-
'cube-image': 'cubejs/cube:dev'
149+
'cube-image': 'cubejs/cube:dev',
150+
'source-repo': context.repo.repo,
151+
'source-pr-url': prUrl,
152+
'source-commit-url': commitUrl,
153+
'initiator': '${{ github.actor }}'
147154
}
148155
})

0 commit comments

Comments
 (0)