Skip to content

Commit 75a12f0

Browse files
#78 Upgrade metabase to v0.50.36 (#80)
Co-authored-by: Tun Loakthar <thein.loakthar@exasol.com>
1 parent ddaa8be commit 75a12f0

File tree

16 files changed

+731
-292
lines changed

16 files changed

+731
-292
lines changed

.github/workflows/ci-build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
cancel-in-progress: true
1616
runs-on: ubuntu-latest
1717
env:
18-
METABASE_TAG: v0.48.0
18+
METABASE_TAG: v0.50.36
1919
steps:
2020
- name: Checkout the repository
2121
uses: actions/checkout@v4
@@ -34,24 +34,24 @@ jobs:
3434
- name: Set up JDK 11
3535
uses: actions/setup-java@v4
3636
with:
37-
distribution: temurin
37+
distribution: 'temurin'
3838
java-version: 11
3939

4040
- name: Install clojure tools
41-
uses: DeLaGuardo/setup-clojure@12.1
41+
uses: DeLaGuardo/setup-clojure@13.4
4242
with:
4343
cli: '1.11.1.1262'
4444

4545
- name: Cache Maven repository
46-
uses: actions/cache@v3
46+
uses: actions/cache@v4
4747
with:
4848
path: ~/.m2/repository
4949
key: ${{ runner.os }}-maven-${{ hashFiles('metabase-driver/deps.edn', 'metabase/**/deps.edn') }}
5050
restore-keys: |
5151
${{ runner.os }}-maven-
5252
5353
- name: Cache clj-kondo
54-
uses: actions/cache@v3
54+
uses: actions/cache@v4
5555
with:
5656
path: metabase-driver/.clj-kondo/.cache
5757
key: clj-kondo-cache-${{ hashFiles('metabase-driver/deps.edn') }}
@@ -62,6 +62,7 @@ jobs:
6262
run: |
6363
java --version
6464
echo Clojure: $(clojure -M --eval "(clojure-version)")
65+
clojure -M --eval '(println "Java" (System/getProperty "java.version") "Clojure" (clojure-version))'
6566
clojure --version
6667
cd metabase-driver && clojure -M:clj-kondo --version
6768

.github/workflows/integration-tests.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ jobs:
1111
strategy:
1212
fail-fast: true
1313
matrix:
14-
exasol_version: ["7.1.17", "8.18.1"] # Must be supported by integration-test-docker-environment
14+
exasol_version: ["7.1.30", "8.34.0"] # Must be supported by integration-test-docker-environment
15+
# See https://github.com/exasol/integration-test-docker-environment/tree/main/docker_db_config_template
1516
concurrency:
1617
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.exasol_version }}
1718
cancel-in-progress: true
1819
name: "Build with Exasol ${{ matrix.exasol_version }}"
1920
runs-on: ubuntu-latest
2021
env:
21-
METABASE_TAG: v0.48.0
22+
METABASE_TAG: v0.50.36
2223
steps:
2324
- name: Free Disk Space
2425
run: |
@@ -43,7 +44,7 @@ jobs:
4344
with:
4445
fetch-depth: 1
4546
repository: 'exasol/integration-test-docker-environment'
46-
ref: "2.0.0"
47+
ref: "4.2.0"
4748
path: 'integration-test-docker-environment'
4849

4950
- name: Set up JDK 11
@@ -53,20 +54,20 @@ jobs:
5354
java-version: 11
5455

5556
- name: Install clojure tools
56-
uses: DeLaGuardo/setup-clojure@12.1
57+
uses: DeLaGuardo/setup-clojure@13.4
5758
with:
5859
cli: '1.11.1.1262'
5960

6061
- name: Cache Maven repository
61-
uses: actions/cache@v3
62+
uses: actions/cache@v4
6263
with:
6364
path: ~/.m2/repository
6465
key: ${{ runner.os }}-maven-${{ hashFiles('metabase-driver/deps.edn', 'metabase-driver/scripts/run-integration-tests.sh', 'metabase/**/deps.edn') }}
6566
restore-keys: |
6667
${{ runner.os }}-maven-
6768
6869
- name: Cache node modules
69-
uses: actions/cache@v3
70+
uses: actions/cache@v4
7071
with:
7172
path: '**/node_modules'
7273
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
@@ -78,6 +79,7 @@ jobs:
7879
java --version
7980
echo Clojure: $(clojure -M --eval "(clojure-version)")
8081
clojure --version
82+
clojure -M --eval '(println "Java" (System/getProperty "java.version") "Clojure" (clojure-version))'
8183
8284
- name: Build Metabase static viz
8385
run: |

.github/workflows/release_droid_upload_github_release_assets.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
env:
14-
METABASE_TAG: v0.48.0
14+
METABASE_TAG: v0.50.36
1515
steps:
1616
- name: Checkout the repository
1717
uses: actions/checkout@v4
@@ -30,16 +30,16 @@ jobs:
3030
- name: Set up JDK 11
3131
uses: actions/setup-java@v4
3232
with:
33-
distribution: temurin
33+
distribution: 'temurin'
3434
java-version: 11
3535

3636
- name: Install clojure tools
37-
uses: DeLaGuardo/setup-clojure@12.1
37+
uses: DeLaGuardo/setup-clojure@13.4
3838
with:
3939
cli: '1.11.1.1262'
4040

4141
- name: Cache Maven repository
42-
uses: actions/cache@v3
42+
uses: actions/cache@v4
4343
with:
4444
path: ~/.m2/repository
4545
key: ${{ runner.os }}-maven-${{ hashFiles('metabase-driver/deps.edn', 'metabase/**/deps.edn') }}
@@ -51,6 +51,7 @@ jobs:
5151
java --version
5252
echo Clojure: $(clojure -M --eval "(clojure-version)")
5353
clojure --version
54+
clojure -M --eval '(println "Java" (System/getProperty "java.version") "Clojure" (clojure-version))'
5455
5556
- name: Build driver
5657
run: "$GITHUB_WORKSPACE/metabase-driver/scripts/build.sh"

SECURITY.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Security
2+
3+
If you believe you have found a new security vulnerability in this repository, please report it to us as follows.
4+
5+
## Reporting Security Issues
6+
7+
* Please do **not** report security vulnerabilities through public GitHub issues.
8+
9+
* Please create a draft security advisory on the Github page: the reporting form is under `> Security > Advisories`. The URL is https://github.com/exasol/metabase-driver/security/advisories/new.
10+
11+
* If you prefer to email, please send your report to `infosec@exasol.com`.
12+
13+
## Guidelines
14+
15+
* When reporting a vulnerability, please include as much information as possible, including the complete steps to reproduce the issue.
16+
17+
* Avoid sending us executables.
18+
19+
* Feel free to include any script you wrote and used but avoid sending us scripts that download and run binaries.
20+
21+
* We will prioritise reports that show how the exploits work in realistic environments.
22+
23+
* We prefer all communications to be in English.
24+
25+
* We do not offer financial rewards. We are happy to acknowledge your research publicly when possible.
26+

deps.edn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
:aliases
1212
{:dev
1313
{:extra-deps
14-
{io.github.metabase/metabase {:git/tag "v0.48.0" :git/sha "0ca7df3"}}}
14+
{io.github.metabase/metabase {:git/tag "v0.50.36" :git/sha "0ca7df3"}}}
1515

1616
; clojure -M:clj-kondo --lint src test --debug
1717
:clj-kondo
18-
{:replace-deps {clj-kondo/clj-kondo {:mvn/version "2023.10.20"}}
18+
{:replace-deps {clj-kondo/clj-kondo {:mvn/version "2025.07.28"}}
1919
:main-opts ["-m" "clj-kondo.main"]}}}

doc/changes/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Changes
22

3+
* [1.0.8](changes_1.0.8.md)
34
* [1.0.7](changes_1.0.7.md)
45
* [1.0.6](changes_1.0.6.md)
56
* [1.0.5](changes_1.0.5.md)

doc/changes/changes_1.0.8.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# metabase-driver 1.0.8, released 2025-08-01
2+
3+
Code name: Upgrade to Metabase v0.50.36
4+
5+
## Summary
6+
7+
This release adapts the driver to Metabase v0.50.36.
8+
9+
The driver now supports Metabase feature `:describe-fks`. This allows Metabase to retrieve metadata about Foreign Key Constraints from Exasol.
10+
11+
## Features
12+
13+
* #78: Upgraded to Metabase v0.50.36

doc/developer_guide/developer_guide.md

Lines changed: 98 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,35 @@ clojure -M --eval "(clojure-version)"
3636
clojure --version
3737
```
3838

39+
### Verify Correct Java Version
40+
41+
Metabase uses Java 11 by default. Check which Java version is used by Clojure:
42+
43+
```sh
44+
clojure -M --eval '(println "Java" (System/getProperty "java.version") "Clojure" (clojure-version))'
45+
# Only major java version:
46+
clojure -M --eval '(println (. (Runtime/version) major))'
47+
```
48+
49+
If this reports another Java version, update `JAVA_HOME` and check again.
50+
3951
## Setup Development Environment
4052

4153
1. Checkout Metabase at `$HOME/git/metabase` (= `$METABASE_DIR`) and build it:
4254

4355
```sh
44-
cd $HOME/git
45-
git clone https://github.com/metabase/metabase.git
46-
cd metabase
47-
git fetch --all --tags
48-
export METABASE_VERSION=v0.48.0
49-
git reset --hard
50-
rm -vf target/patch_excluded_test_applied
51-
git checkout "tags/${METABASE_VERSION}" -b "${METABASE_VERSION}-branch"
56+
export METABASE_DIR=$HOME/git/metabase
57+
export METABASE_VERSION=v0.50.36
58+
git clone https://github.com/metabase/metabase.git $METABASE_DIR
59+
git -C $METABASE_DIR fetch --all --tags
60+
git -C $METABASE_DIR reset --hard
61+
rm -vf $METABASE_DIR/target/patch_excluded_test_applied
62+
git -C $METABASE_DIR checkout "tags/${METABASE_VERSION}" -b "${METABASE_VERSION}-branch"
5263
# Build (this will take ~15min)
53-
./bin/build.sh
64+
$METABASE_DIR/bin/build.sh
5465
```
5566

56-
2. Download the Exasol JDBC driver from the [Download Portal](https://downloads.exasol.com/clients-and-drivers) and install it:
67+
2. Download the Exasol JDBC driver from the [Download Portal](https://downloads.exasol.com/clients-and-drivers) or get it from `~/.m2/repository/com/exasol/exasol-jdbc/$v/exasol-jdbc-$v.jar` and install it:
5768

5869
```sh
5970
cp exajdbc.jar "$METABASE_DIR/plugins"
@@ -119,7 +130,7 @@ export METABASE_EXASOL_DRIVER="$HOME/git/metabase-driver"
119130
cd $METABASE_EXASOL_DRIVER
120131
121132
# Build driver
122-
clojure -X:build :project-dir "\"$(pwd)\""
133+
./scripts/build.sh
123134
124135
# Install driver
125136
cp -v "$METABASE_EXASOL_DRIVER/target/exasol.metabase-driver.jar" "$METABASE_DIR/plugins/"
@@ -131,13 +142,21 @@ clojure -M:run
131142

132143
## Running Integration Tests
133144

134-
You need to have metabase checked out next to this repository.
145+
### Preconditions
135146

136-
Start Exasol docker container:
147+
* You need to have metabase checked out next to this repository.
137148

138-
```sh
139-
docker run --publish 8563:8563 --publish 2580:2580 --publish 443:443 --detach --privileged --stop-timeout 120 exasol/docker-db:7.1.23
140-
```
149+
* Start Exasol docker container:
150+
```sh
151+
docker run --publish 8563:8563 --publish 2580:2580 --publish 443:443 --detach --privileged --stop-timeout 120 exasol/docker-db:8.34.0
152+
```
153+
154+
* Build frontend code required for running integration tests:
155+
```sh
156+
cd $METABASE_DIR && yarn build-static-viz
157+
```
158+
159+
### Running
141160

142161
Start integration tests:
143162

@@ -150,10 +169,18 @@ This script builds and installs the driver before running the integration tests.
150169
To run only a single tests or only tests in a namespace add arguments:
151170

152171
```sh
172+
# Run single test
153173
./scripts/run-integration-tests.sh :only name.space/single-test
174+
# Run all tests in a name space
154175
./scripts/run-integration-tests.sh :only name.space
176+
# Run tests from multiple namespaces
177+
./scripts/run-integration-tests.sh :only "[name.space1 name.space2]"
155178
```
156179

180+
### Evaluating Test Results
181+
182+
When tests fail locally or in CI, search the log output for `ERROR in` or `FAIL in` to find test errors/failures.
183+
157184
### Using the REPL
158185

159186
```sh
@@ -208,34 +235,49 @@ Script `run-integration-tests.sh` automatically applies this patch when file `$M
208235
When the patch file has changed or you updated to a new Metabase release, do the following and re-run the integration tests with `run-integration-tests.sh`.
209236
210237
```sh
211-
cd $METABASE_DIR
212-
git reset --hard && rm -vf target/patch_excluded_test_applied
238+
export METABASE_DIR="$HOME/git/metabase"
239+
git -C $METABASE_DIR reset --hard && rm -fv $METABASE_DIR/target/patch_excluded_test_applied
213240
```
214241
215242
#### Applying Patch Fails
216243
217244
If applying the patch fails after upgrading to a new Metabase version, follow these steps:
218245
219-
1. Run `cd $METABASE_DIR && git reset --hard && rm -vf target/patch_excluded_test_applied`
220-
2. Remove the failed part from `exclude_tests.diff`
221-
3. Run integration tests `run-integration-tests.sh`. This will apply the patch.
222-
4. Modify Metabase tests to adapt them to Exasol
223-
5. Update patch by running `cd $METABASE_DIR && git diff > $METABASE_EXASOL_DRIVER/scripts/exclude_tests.diff`
246+
1. Run `export METABASE_DIR="$HOME/git/metabase" && export METABASE_EXASOL_DRIVER="$HOME/git/metabase-driver"`
247+
2. Run `git -C $METABASE_DIR reset --hard && rm -vf $METABASE_DIR/target/patch_excluded_test_applied`
248+
3. Remove the failed part from `exclude_tests.diff`
249+
4. Run integration tests `run-integration-tests.sh`. This will apply the patch.
250+
5. Modify Metabase tests to adapt them to Exasol
251+
6. Update patch by running `git -C $METABASE_DIR diff > $METABASE_EXASOL_DRIVER/scripts/exclude_tests.diff`
224252
225253
## Linting
226254
227255
```sh
228256
clojure -M:clj-kondo --lint src test --debug
229257
```
230258
231-
# Troubleshooting
259+
# Building a Release
232260
233-
## `FileNotFoundException: Could not locate metabase/test/data/exasol__init.class, metabase/test/data/exasol.clj or metabase/test/data/exasol.cljc on classpath.`
261+
Releases are built using [release-droid](https://github.com/exasol/release-droid).
234262
235-
Verify that `$METABASE_DIR/modules/drivers/exasol` is a symlink to the `metabase-driver` directory.
263+
# Troubleshooting
236264
237265
## Failing Integration Tests
238266
267+
### Error `Javascript resource not found`
268+
269+
Tests fail with the following error
270+
271+
```
272+
Javascript resource not found: frontend_client/app/dist/lib-static-viz.bundle.js
273+
```
274+
275+
then run
276+
277+
```sh
278+
cd $METABASE_DIR && yarn build-static-viz
279+
```
280+
239281
### Different Decimal Point
240282
241283
Tests fail on macOS because they expect numbers with a `.` as decimal point (e.g. `1000.0 µs`) but get a `,` (e.g. `1000,0 µs`), e.g.:
@@ -253,3 +295,33 @@ Solution: run tests under Linux with English locale or pass arguments `-J-Duser.
253295
### Time Dependent Tests
254296
255297
Some Metabase integration tests depend on the current timestamp and will fail when the year changes. See [issue #14](https://github.com/exasol/metabase-driver/issues/14) for details.
298+
299+
### Inconsistent Test Results in CI and Locally
300+
301+
If a tests fails in CI and succeeds locally or vice versa, ensure you have a clean working copy of `$METABASE_DIR`:
302+
303+
```sh
304+
export METABASE_DIR="$HOME/git/metabase"
305+
git -C $METABASE_DIR clean --no-quiet --force -d -x
306+
# Rebuild UI, required by integration tests.
307+
cd $METABASE_DIR && yarn build-static-viz
308+
```
309+
310+
This will delete all ignored files.
311+
312+
## Timeout During Build of Metabase
313+
314+
Metabase build using script `./bin/build.sh` fails with a timeout in `yarn`:
315+
316+
```
317+
...
318+
Step "$ \"yarn\"" failed with error "Timed out after 900000 ms."
319+
What would you like to do?
320+
[T]ry this step again
321+
[F]ail -- pass the failure of this step to the parent step (which can be retried)
322+
[S]kip this step
323+
[R]EPL -- open a REPL so you can debug things
324+
[Q]uit the build script (or return to the top level if running from the REPL) [T/F/S/R/Q] t
325+
```
326+
327+
Type `t` to try again. It should work at a second try.

0 commit comments

Comments
 (0)